chore: define interface Callback

This commit is contained in:
waiting
2018-06-14 10:37:18 +08:00
parent ac8c4cb9c0
commit 47a1443a51
+5 -4
View File
@@ -1,6 +1,6 @@
// Type definitions for node-ffi 0.1
// Type definitions for node-ffi 0.2
// Project: https://github.com/rbranson/node-ffi
// Definitions by: Paul Loyd <https://github.com/loyd>
// Definitions by: Paul Loyd <https://github.com/loyd>, Waiting Song <https://github.com/waitingsong>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -135,12 +135,13 @@ export const DynamicLibrary: {
* The function pointer may be used in other C functions that
* accept C callback functions.
*/
export const Callback: {
export interface Callback {
new (retType: any, argTypes: any[], abi: number, fn: any): Buffer;
new (retType: any, argTypes: any[], fn: any): Buffer;
(retType: any, argTypes: any[], abi: number, fn: any): Buffer;
(retType: any, argTypes: any[], fn: any): Buffer;
};
}
export const Callback: Callback;
export const ffiType: {
/** Get a `ffi_type *` Buffer appropriate for the given type. */