win32-def
Definitions of Windows Date Types for node-ffi, node-ffi-napi
What can I do with this?
Write node-ffi or node-ffi-napi calling win32 native functions code by Typescript with Types support.
Installing
npm install win32-def
Usage
import * as Struct from 'ref-struct'
import { DStruct as DS } from 'win32-def'
const point = new Struct(DS.POINT)()
point.x = 100
point.y = 200
console.log(point)
import * as ref from 'ref-napi'
import * as Struct from 'ref-struct-di'
const myStruct = Struct(ref)
const point = new myStruct(DS.POINT)()
point.x = 100
point.y = 200
console.log(point)
import * as ref from 'ref'
import { K } from 'win32-api'
import { FModel as FM, DTypes as W } from 'win32-def'
const knl32 = K.load()
const buf = <FM.FFIBuffer> Buffer.alloc(4)
buf.writeInt32LE(12345, 0)
const hInstance = <FM.FFIBuffer> ref.alloc(W.HINSTANCE)
knl32.GetModuleHandleExW(0, null, hInstance)
Relevant
License
MIT
Languages