Merge pull request #26537 from waitingsong/ffi

chore(ffi): define interface Callback
This commit is contained in:
Nathan Shively-Sanders
2018-06-20 15:10:43 -07:00
committed by GitHub
+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. */