/// import { FFITypeList } from './common'; /** Return the correct calling convention on Win32 */ export declare function stdCallOnWin32(): number | undefined; /** Base callback strategy */ export declare abstract class CallbackStrategy { types: FFITypeList; private readonly abi; constructor(types: FFITypeList, abi: number | undefined); protected getWrappedCallback(scope: any, func: (...args: any[]) => any): Buffer; /** Get a callback pointer for this strategy */ abstract getCallback(func: (...args: any[]) => any): Buffer; /** Notify the strategy that the callback has been called */ callbackCalled?(): void; } /** * Keep the callback pointer forever * * This will obviously leak memory but might be more suitable in some cases */ export declare class ForeverStrategy extends CallbackStrategy { private readonly callbacks; /** * @inheritDoc */ getCallback(func: (...args: any[]) => any): Buffer; } /** * Keep the callback pointer until another callback is supplied */ export declare class ReplaceStrategy extends CallbackStrategy { protected callback: Buffer | undefined; /** * @inheritDoc */ getCallback(func: (...args: any[]) => any): Buffer; } /** * Keep the callback pointer until the callback is called or another is supplied */ export declare class UntilCalledStrategy extends CallbackStrategy { protected callback: Buffer | undefined; /** * @inheritDoc */ getCallback(func: (...args: any[]) => any): Buffer; /** * @inheritDoc */ callbackCalled?(): void; } /** To enforce callback strategy constructors */ export declare type ICallbackStrategyConstructor = new (types: FFITypeList, abi: number | undefined) => CallbackStrategy; /** * Available callback caching strategies */ export declare const Strategy: { forever: typeof ForeverStrategy; replace: typeof ReplaceStrategy; untilCalled: typeof UntilCalledStrategy; };