UNPKG

@proofkit/webviewer

Version:

A utility to fetch data from FileMaker webviewer

45 lines (44 loc) 1.73 kB
/** * @private * set the name of the WebViewer to use for all fetches * @param name the Layout Object Name of the FileMaker WebViewer to callback too */ declare function setWebViewerName(name: string): void; /** * globalSettings */ export declare const globalSettings: { /** * * set the name of the WebViewer to use for all fetches * @param name the Layout Object Name of the FileMaker WebViewer to callback too */ setWebViewerName: typeof setWebViewerName; }; /** * Call a script in FileMaker, and get a response from the script either as a Promise or through a callback * * @param scriptName the name of the script to call. The script does have to follow conventions (see docs) * @param data optional script parameter, it can also just take a string */ export declare function fmFetch<T = unknown>(scriptName: string, data: string | object): Promise<T>; export declare function fmFetch(scriptName: string, data: string | object, /** * @param cb callback function to call when the script is done */ callback: () => void): void; /** * calls a FileMaker Script without a callback or a promise */ export declare function callFMScript<ScriptParams extends string | Record<any, any> = any>(scriptName: string, data: ScriptParams, option: FMScriptOption): void; export declare function callFMScript<ScriptParams extends string | Record<any, any> = any>(scriptName: string, data?: ScriptParams): void; export declare const FMScriptOption: { readonly CONTINUE: "0"; readonly HALT: "1"; readonly EXIT: "2"; readonly RESUME: "3"; readonly PAUSE: "4"; readonly SUSPEND_AND_RESUME: "5"; }; type FMScriptOption = (typeof FMScriptOption)[keyof typeof FMScriptOption]; export {};