mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Resolve bluebird(Array) method * upgrade typescript version from bluebird-global * move testfile Reason: There are too many type definition files depending on jquery and it can not be managed. * upgrade typescript version from bluebird require packages * fix lint error: use-default-type-parameter
32 lines
821 B
TypeScript
32 lines
821 B
TypeScript
import java = require('java');
|
|
import pify = require('pify');
|
|
|
|
java.asyncOptions = {
|
|
syncSuffix: 'Sync',
|
|
asyncSuffix: '',
|
|
promiseSuffix: 'P',
|
|
promisify: pify
|
|
};
|
|
// todo: figure out why promise doesn't work here
|
|
/* java.registerClientP((): Promise<void> => {
|
|
return BluePromise.resolve();
|
|
}); */
|
|
|
|
interface ProxyFunctions {
|
|
[index: string]: Function;
|
|
}
|
|
|
|
java.ensureJvm()
|
|
.then(() => {
|
|
|
|
// java.d.ts does not declare any Java types.
|
|
// We can import a java class, but we don't know the shape of the class here, so must use any
|
|
var Boolean: any = java.import('java.lang.Boolean');
|
|
|
|
var functions: ProxyFunctions = {
|
|
accept: function(t: any): void { },
|
|
andThen: function(after: any): any {}
|
|
};
|
|
var proxy: any = java.newProxy('java.util.function.Consumer', functions);
|
|
});
|