Variables
CIF: (retType: any, types: any[], abi?: any) => Buffer
Defined in node-ffi/node-ffi.d.ts:159
CIF_var: (retType: any, types: any[], numFixedArgs: number, abi?: any) => Buffer
Defined in node-ffi/node-ffi.d.ts:160
Callback: { (retType: any, argTypes: any[], abi: number, fn: any): Buffer; (retType: any, argTypes: any[], fn: any): Buffer; new(retType: any, argTypes: any[], abi: number, fn: any): Buffer; new(retType: any, argTypes: any[], fn: any): Buffer; }
Defined in node-ffi/node-ffi.d.ts:144
Turns a JavaScript function into a C function pointer.
The function pointer may be used in other C functions that
accept C callback functions.
Defined in node-ffi/node-ffi.d.ts:147
Returns
Buffer
Defined in node-ffi/node-ffi.d.ts:148
Returns
Buffer
constructor( ) : Buffer
Defined in node-ffi/node-ffi.d.ts:145
Returns
Buffer
constructor( ) : Buffer
Defined in node-ffi/node-ffi.d.ts:146
Returns
Buffer
Defined in node-ffi/node-ffi.d.ts:107
Defined in node-ffi/node-ffi.d.ts:123
This class loads and fetches function pointers for dynamic libraries
(.so, .dylib, etc). After the libray's function pointer is acquired, then you
call get(symbol)
to retreive a pointer to an exported symbol. You need to
call get___
on the pointer to dereference it into its actual value, or
turn the pointer into a callable function with ForeignFunction
.
public close( ) : number
Defined in node-ffi/node-ffi.d.ts:109
Close library, returns the result of the dlclose
system function.
Returns
number
public error( ) : string
Defined in node-ffi/node-ffi.d.ts:113
Get the result of the dlerror
system function.
Returns
string
public get( symbol: string ) : Buffer
Defined in node-ffi/node-ffi.d.ts:111
Get a symbol from this library.
Parameters
Returns
Buffer
FFI_BAD_ABI: number
Defined in node-ffi/node-ffi.d.ts:165
FFI_BAD_TYPEDEF: number
Defined in node-ffi/node-ffi.d.ts:164
FFI_DEFAULT_ABI: number
Defined in node-ffi/node-ffi.d.ts:166
FFI_FIRST_ABI: number
Defined in node-ffi/node-ffi.d.ts:167
FFI_LAST_ABI: number
Defined in node-ffi/node-ffi.d.ts:168
FFI_OK: number
Defined in node-ffi/node-ffi.d.ts:163
FFI_SYSV: number
Defined in node-ffi/node-ffi.d.ts:169
Defined in node-ffi/node-ffi.d.ts:180
FFI_TYPES: { [key: string]: Buffer; }
Defined in node-ffi/node-ffi.d.ts:162
Defined in node-ffi/node-ffi.d.ts:162
Returns
Buffer
FFI_UNIX64: number
Defined in node-ffi/node-ffi.d.ts:170
Defined in node-ffi/node-ffi.d.ts:60
Defined in node-ffi/node-ffi.d.ts:71
Represents a foreign function in another library. Manages all of the aspects
of function execution, including marshalling the data parameters for the
function into native types and also unmarshalling the return from function
execution.
( args?: Array<any> ) : any
Defined in node-ffi/node-ffi.d.ts:61
Parameters
args?: Array<any> optional
Returns
any
public async( args?: Array<any> )
Defined in node-ffi/node-ffi.d.ts:62
Parameters
args?: Array<any> optional
Defined in node-ffi/node-ffi.d.ts:37
Defined in node-ffi/node-ffi.d.ts:53
Creates and returns a type for a C function pointer.
public abi: number
Defined in node-ffi/node-ffi.d.ts:44
optional public alignment?: number
The alignment of this datatype when placed inside a struct.
public argTypes: Type []
Defined in node-ffi/node-ffi.d.ts:41
The type of arguments.
public ffi_type: Buffer
Defined in node-ffi/node-ffi.d.ts:43
Is set for node-ffi functions.
public indirection: number
The current level of indirection of the buffer.
optional public name?: string
Inherited from
Type .name
Defined in ref/ref.d.ts:18
The name to use during debugging for this datatype.
public retType: Type
Defined in node-ffi/node-ffi.d.ts:39
The type of return value.
public size: number
Inherited from
Type .size
Defined in ref/ref.d.ts:10
The size in bytes required to hold this datatype.
public get( buffer: Buffer , offset: number ) : any
Inherited from
Type .get
Defined in ref/ref.d.ts:14
To invoke when ref.get
is invoked on a buffer of this type.
Parameters
Returns
any
public set( buffer: Buffer , offset: number , value: any )
Inherited from
Type .set
Defined in ref/ref.d.ts:16
To invoke when ref.set
is invoked on a buffer of this type.
Parameters
offset: number
value: any
Defined in node-ffi/node-ffi.d.ts:49
Get a ForeignFunction
of this function type.
Parameters
Returns
ForeignFunction
public toPointer( fn: (...args: any[]) => any ) : Buffer
Defined in node-ffi/node-ffi.d.ts:47
Get a Callback
pointer of this function type.
Parameters
fn: (...args: any[]) => any
Returns
Buffer
HAS_OBJC: boolean
Defined in node-ffi/node-ffi.d.ts:161
LIB_EXT: string
Defined in node-ffi/node-ffi.d.ts:179
Library: { EXT: string; (libFile: string, funcs?: { [key: string]: any[]; }, lib?: Object): any; new(libFile: string, funcs?: { [key: string]: any[]; }, lib?: Object): any; }
Defined in node-ffi/node-ffi.d.ts:15
Provides a friendly API on-top of DynamicLibrary
and ForeignFunction
.
( ) : any
Defined in node-ffi/node-ffi.d.ts:31
Returns
any
constructor( ) : any
Defined in node-ffi/node-ffi.d.ts:24
Returns
any
public Library.EXT: string
Defined in node-ffi/node-ffi.d.ts:17
The extension to use on libraries.
RTLD_DEFAULT: Buffer
Defined in node-ffi/node-ffi.d.ts:178
RTLD_GLOBAL: number
Defined in node-ffi/node-ffi.d.ts:174
RTLD_LAZY: number
Defined in node-ffi/node-ffi.d.ts:171
RTLD_LOCAL: number
Defined in node-ffi/node-ffi.d.ts:173
Defined in node-ffi/node-ffi.d.ts:177
RTLD_NODELETE: number
Defined in node-ffi/node-ffi.d.ts:176
RTLD_NOLOAD: number
Defined in node-ffi/node-ffi.d.ts:175
RTLD_NOW: number
Defined in node-ffi/node-ffi.d.ts:172
Defined in node-ffi/node-ffi.d.ts:78
Defined in node-ffi/node-ffi.d.ts:100
For when you want to call to a C function with variable amount of arguments.
i.e. printf
.
This function takes care of caching and reusing ForeignFunction
instances that
contain the same ffi_type argument signature.
Defined in node-ffi/node-ffi.d.ts:83
What gets returned is another function that needs to be invoked with the rest
of the variadic types that are being invoked from the function.
Parameters
args?: Array<any> optional
Returns
ForeignFunction
public returnType: any
Defined in node-ffi/node-ffi.d.ts:90
Return type as a property of the function generator to
allow for monkey patching the return value in the very rare case where the
return type is variadic as well
ffiType: { FFI_TYPE: "ref-struct".StructType; (type: "ref".Type): Buffer; (type: string): Buffer; }
Defined in node-ffi/node-ffi.d.ts:151
Defined in node-ffi/node-ffi.d.ts:153
Get a ffi_type *
Buffer appropriate for the given type.
Returns
Buffer
Defined in node-ffi/node-ffi.d.ts:155
Get a ffi_type *
Buffer appropriate for the given type.
Returns
Buffer
public ffiType.FFI_TYPE: StructType
Defined in node-ffi/node-ffi.d.ts:156
types: { void: "ref".Type; int64: "ref".Type; ushort: "ref".Type; int: "ref".Type; uint64: "ref".Type; float: "ref".Type; uint: "ref".Type; long: "ref".Type; double: "ref".Type; int8: "ref".Type; ulong: "ref".Type; Object: "ref".Type; uint8: "ref".Type; longlong: "ref".Type; CString: "ref".Type; int16: "ref".Type; ulonglong: "ref".Type; bool: "ref".Type; uint16: "ref".Type; char: "ref".Type; byte: "ref".Type; int32: "ref".Type; uchar: "ref".Type; size_t: "ref".Type; uint32: "ref".Type; short: "ref".Type; }
Defined in node-ffi/node-ffi.d.ts:183
Default types.
public types.CString: Type
Defined in node-ffi/node-ffi.d.ts:188
public types.Object: Type
Defined in node-ffi/node-ffi.d.ts:187
public types.bool: Type
Defined in node-ffi/node-ffi.d.ts:189
public types.byte: Type
Defined in node-ffi/node-ffi.d.ts:190
public types.char: Type
Defined in node-ffi/node-ffi.d.ts:190
public types.double: Type
Defined in node-ffi/node-ffi.d.ts:186
public types.float: Type
Defined in node-ffi/node-ffi.d.ts:185
public types.int: Type
Defined in node-ffi/node-ffi.d.ts:185
public types.int16: Type
Defined in node-ffi/node-ffi.d.ts:189
public types.int32: Type
Defined in node-ffi/node-ffi.d.ts:191
public types.int64: Type
Defined in node-ffi/node-ffi.d.ts:184
public types.int8: Type
Defined in node-ffi/node-ffi.d.ts:187
public types.long: Type
Defined in node-ffi/node-ffi.d.ts:186
public types.longlong: Type
Defined in node-ffi/node-ffi.d.ts:188
public types.short: Type
Defined in node-ffi/node-ffi.d.ts:192
public types.size_t: Type
Defined in node-ffi/node-ffi.d.ts:191
public types.uchar: Type
Defined in node-ffi/node-ffi.d.ts:191
public types.uint: Type
Defined in node-ffi/node-ffi.d.ts:186
public types.uint16: Type
Defined in node-ffi/node-ffi.d.ts:190
public types.uint32: Type
Defined in node-ffi/node-ffi.d.ts:192
public types.uint64: Type
Defined in node-ffi/node-ffi.d.ts:185
public types.uint8: Type
Defined in node-ffi/node-ffi.d.ts:188
public types.ulong: Type
Defined in node-ffi/node-ffi.d.ts:187
public types.ulonglong: Type
Defined in node-ffi/node-ffi.d.ts:189
public types.ushort: Type
Defined in node-ffi/node-ffi.d.ts:184
public types.void: Type
Defined in node-ffi/node-ffi.d.ts:184