Functions
_attach( buffer: Buffer , object: Object )
Defined in ref/ref.d.ts:163
Attach object to buffer such.
It prevents object from being garbage collected until buffer does.
Parameters
_reinterpret( buffer: Buffer , size: number , offset?: number ) : Buffer
Defined in ref/ref.d.ts:166
Same as ref.reinterpret, except that this version does not attach buffer.
Parameters
size: number
offset?: number optional
Returns
Buffer
_reinterpretUntilZeros( buffer: Buffer , size: number , offset?: number ) : Buffer
Defined in ref/ref.d.ts:169
Same as ref.reinterpretUntilZeros, except that this version does not attach buffer.
Parameters
size: number
offset?: number optional
Returns
Buffer
_writeObject( buffer: Buffer , offset: number , object: Object )
Defined in ref/ref.d.ts:175
Same as ref.writeObject, except that this version does not attach object.
Parameters
offset: number
object: Object
_writePointer( buffer: Buffer , offset: number , pointer: Buffer )
Defined in ref/ref.d.ts:172
Same as ref.writePointer, except that this version does not attach pointer.
Parameters
address( buffer: Buffer ) : number
Defined in ref/ref.d.ts:28
Get the memory address of buffer.
Parameters
Returns
number
alloc( type: Type , value?: any ) : Buffer
Defined in ref/ref.d.ts:30
Allocate the memory with the given value written to it.
Parameters
Returns
Buffer
alloc( type: string , value?: any ) : Buffer
Defined in ref/ref.d.ts:32
Allocate the memory with the given value written to it.
Parameters
type: string
value?: any optional
Returns
Buffer
allocCString( string: string , encoding?: string ) : Buffer
Defined in ref/ref.d.ts:39
Allocate the memory with the given string written to it with the given
encoding (defaults to utf8). The buffer is 1 byte longer than the
string itself, and is NULL terminated.
Parameters
string: string
encoding?: string optional
Returns
Buffer
coerceType( type: Type ) : Type
Defined in ref/ref.d.ts:42
Coerce a type.
Parameters
Returns
Type
coerceType( type: string ) : Type
Defined in ref/ref.d.ts:44
Coerce a type. String are looked up from the ref.types object.
Parameters
Returns
Type
deref( buffer: Buffer ) : any
Defined in ref/ref.d.ts:52
Get value after dereferencing buffer.
That is, first it checks the indirection count of buffer's type, and
if it's greater than 1 then it merely returns another Buffer, but with
one level less indirection.
Parameters
Returns
any
derefType( type: Type ) : Type
Defined in ref/ref.d.ts:55
Create clone of the type, with decremented indirection level by 1.
Parameters
Returns
Type
derefType( type: string ) : Type
Defined in ref/ref.d.ts:57
Create clone of the type, with decremented indirection level by 1.
Parameters
Returns
Type
get( buffer: Buffer , offset?: number , type?: Type ) : any
Defined in ref/ref.d.ts:61
Check the indirection level and return a dereferenced when necessary.
Parameters
offset?: number optional
type?: Type optional
Returns
any
get( buffer: Buffer , offset?: number , type?: string ) : any
Defined in ref/ref.d.ts:63
Check the indirection level and return a dereferenced when necessary.
Parameters
offset?: number optional
type?: string optional
Returns
any
Defined in ref/ref.d.ts:65
Get type of the buffer. Create a default type when none exists.
Parameters
Returns
Type
isNull( buffer: Buffer ) : boolean
Defined in ref/ref.d.ts:67
Check the NULL.
Parameters
Returns
boolean
readCString( buffer: Buffer , offset?: number ) : string
Defined in ref/ref.d.ts:69
Read C string until the first NULL.
Parameters
Returns
string
readInt64BE( buffer: Buffer , offset?: number ) : any
Defined in ref/ref.d.ts:76
Read a big-endian signed 64-bit int.
If there is losing precision, then return a string, otherwise a number.
Parameters
Returns
any
readInt64LE( buffer: Buffer , offset?: number ) : any
Defined in ref/ref.d.ts:83
Read a little-endian signed 64-bit int.
If there is losing precision, then return a string, otherwise a number.
Parameters
Returns
any
readObject( buffer: Buffer , offset?: number ) : Object
Defined in ref/ref.d.ts:86
Read a JS Object that has previously been written.
Parameters
Returns
Object
readPointer( buffer: Buffer , offset?: number , length?: number ) : Buffer
Defined in ref/ref.d.ts:88
Read data from the pointer.
Parameters
offset?: number optional
length?: number optional
Returns
Buffer
readUInt64BE( buffer: Buffer , offset?: number ) : any
Defined in ref/ref.d.ts:95
Read a big-endian unsigned 64-bit int.
If there is losing precision, then return a string, otherwise a number.
Parameters
Returns
any
readUInt64LE( buffer: Buffer , offset?: number ) : any
Defined in ref/ref.d.ts:102
Read a little-endian unsigned 64-bit int.
If there is losing precision, then return a string, otherwise a number.
Parameters
Returns
any
Defined in ref/ref.d.ts:105
Create pointer to buffer.
Parameters
Returns
Buffer
refType( type: Type ) : Type
Defined in ref/ref.d.ts:107
Create clone of the type, with incremented indirection level by 1.
Parameters
Returns
Type
refType( type: string ) : Type
Defined in ref/ref.d.ts:109
Create clone of the type, with incremented indirection level by 1.
Parameters
Returns
Type
reinterpret( buffer: Buffer , size: number , offset?: number ) : Buffer
Defined in ref/ref.d.ts:116
Create buffer with the specified size, with the same address as source.
This function "attaches" source to the returned buffer to prevent it from
being garbage collected.
Parameters
size: number
offset?: number optional
Returns
Buffer
reinterpretUntilZeros( buffer: Buffer , size: number , offset?: number ) : Buffer
Defined in ref/ref.d.ts:122
Scan past the boundary of the buffer's length until it finds size number
of aligned NULL bytes.
Parameters
size: number
offset?: number optional
Returns
Buffer
set( buffer: Buffer , offset: number , value: any , type?: Type )
Defined in ref/ref.d.ts:126
Write pointer if the indirection is 1, otherwise write value.
Parameters
offset: number
value: any
type?: Type optional
set( buffer: Buffer , offset: number , value: any , type?: string )
Defined in ref/ref.d.ts:128
Write pointer if the indirection is 1, otherwise write value.
Parameters
offset: number
value: any
type?: string optional
writeCString( buffer: Buffer , offset: number , string: string , encoding?: string )
Defined in ref/ref.d.ts:130
Write the string as a NULL terminated. Default encoding is utf8.
Parameters
offset: number
string: string
encoding?: string optional
writeInt64BE( buffer: Buffer , offset: number , input: number )
Defined in ref/ref.d.ts:133
Write a big-endian signed 64-bit int.
Parameters
offset: number
input: number
writeInt64BE( buffer: Buffer , offset: number , input: string )
Defined in ref/ref.d.ts:135
Write a big-endian signed 64-bit int.
Parameters
offset: number
input: string
writeInt64LE( buffer: Buffer , offset: number , input: number )
Defined in ref/ref.d.ts:137
Write a little-endian signed 64-bit int.
Parameters
offset: number
input: number
writeInt64LE( buffer: Buffer , offset: number , input: string )
Defined in ref/ref.d.ts:139
Write a little-endian signed 64-bit int.
Parameters
offset: number
input: string
writeObject( buffer: Buffer , offset: number , object: Object )
Defined in ref/ref.d.ts:145
Write the JS Object. This function "attaches" object to buffer to prevent
it from being garbage collected.
Parameters
offset: number
object: Object
writePointer( buffer: Buffer , offset: number , pointer: Buffer )
Defined in ref/ref.d.ts:151
Write the memory address of pointer to buffer at the specified offset. This
function "attaches" object to buffer to prevent it from being garbage collected.
Parameters
writeUInt64BE( buffer: Buffer , offset: number , input: number )
Defined in ref/ref.d.ts:155
Write a little-endian unsigned 64-bit int.
Parameters
offset: number
input: number
writeUInt64BE( buffer: Buffer , offset: number , input: string )
Defined in ref/ref.d.ts:157
Write a little-endian unsigned 64-bit int.
Parameters
offset: number
input: string