From 47a1443a51fe14cf1fb995422ee9d9080d899ba5 Mon Sep 17 00:00:00 2001 From: waiting <1661926154@qq.com> Date: Thu, 14 Jun 2018 10:18:41 +0800 Subject: [PATCH] chore: define interface Callback --- types/ffi/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/ffi/index.d.ts b/types/ffi/index.d.ts index 76e197e841..cf562cea06 100644 --- a/types/ffi/index.d.ts +++ b/types/ffi/index.d.ts @@ -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 +// Definitions by: Paul Loyd , Waiting Song // 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. */