import ref from 'ref-napi'; import { SynXFuncs, Address } from './native'; /** * Represents basic types of preprocessor results. */ export declare type PreprocessorResults = ref.Type | Buffer | string | number | boolean | Address | bigint | null | undefined; /** * Represents a preprocessor result. * This can be a single value, an array of values, or a promise of either. */ export declare type PreprocessorResult = PreprocessorResults | PreprocessorResults[] | Promise | Promise; /** * Represents a preprocessor. * @param proxies SynXFuncs instance. * @param args Arguments to the function. * @returns Preprocessed arguments. */ export declare type Preprocessor = (proxies: SynXFuncs | PreprocessorResult, ...args: unknown[]) => PreprocessorResult; /** * Represents a postprocessor. * @param proxies SynXFuncs instance. * @param returnValue Return value of the function. * @param args Arguments to the function. * @returns Postprocessed return value. */ export declare type Postprocessor = (proxies: SynXFuncs, returnValue: unknown, ...args: unknown[]) => any; /** * Registers an object-specific preprocessor. * @param typename The object to register the preprocessor for. * @param processor The preprocessor to register. */ export declare function registerObjectPreprocessor(typename: Function, processor: Preprocessor): void; /** * Registers a type-specific preprocessor. * @param type The type to register the preprocessor for. * @param processor The preprocessor to register. * @returns Whether the preprocessor was registered. */ export declare function registerTypePreprocessor(type: string, processor: Preprocessor): void; /** * Creates a library from a given set of definitions. * @param libraryPath The path to the library. * @param imports The definitions to import. * @returns The created library. */ export declare function compose(libraryPath: string, imports: { [key: string]: { name: string; signature: (ref.Type | ref.Type[])[]; preprocessor?: Preprocessor; postprocessor?: Postprocessor; }; }): { [key: string]: (...args: any[]) => any; };