UNPKG

win32-def

Version:
43 lines 1.63 kB
import type { BigIntStr, MethodTypeUnknown } from '@waiting/shared-types'; export type _WIN64 = boolean; export type _UNICODE = boolean; export type StructTypeConstructor<T = object> = new () => Record<keyof T, string | number | BigIntStr | Buffer>; /** * @link https://koffi.dev/functions#calling-conventions */ export declare enum CallingConvention { Cdecl = "", Stdcall = "__stdcall", Fastcall = "__fastcall", Thiscall = "__thiscall" } export type PID = number; export type PPID = number; export type FnDefName = string; export type FnDefParam = string; export type FnDefRetType = FnDefParam; export type FnDefMultipleChoiceParam = FnDefParam[]; /** Runtime input arguments of typeDef */ export type FnDefArgs = FnDefParam[]; export type FnDefCallParam = FnDefParam | FnDefMultipleChoiceParam; /** Input parameters array of typeDef */ export type FnDefCallParams = readonly FnDefCallParam[] | never[]; /** Full parameters include input/output of typeDef */ export type FnDefFullParams = [FnDefRetType, FnDefCallParams]; export type FuncDefListInner<T = DllFuncsType> = Map<(keyof T) & string, FnDefFullParams>; export type FuncDefList<T = DllFuncsType> = { [K in keyof T as K extends `${string}_Async` ? never : K & string]: any[] | readonly any[]; }; export type FnDefListMap = Map<string, FnDefFullParams>; /** * usage: * ```ts * import * as T from 'win32-def' * export interface Foo extends FM.DllFuncsModel { * SDT_OpenPort(port: T.UINT): T.INT * SDT_ClosePort(): T.INT * } * ``` */ export type DllFuncsType = Record<string, MethodTypeUnknown>; //# sourceMappingURL=ffi.types.d.ts.map