UNPKG

@btfuse/core

Version:

A native-first framework for building hybdrid web-native applications

22 lines (21 loc) 857 B
export type TFuseAPICallbackHandler = (data: string) => void; /** * A singleton manager to manage native callbacks. * * Create a callback context and pass the return context id to native clients, * in which they can use to respond back. * * Note that plugin APIs are far more efficient and can handle a diverse set of data, * including large payloads, so when possible it's best to use a plugin API instead of a * callback API. * * This callback API is however, useful for building listener kind of services where the native * needs to continously callback to the webview with small data packets. */ export declare class FuseCallbackManager { private static $instance; private constructor(); static getInstance(): FuseCallbackManager; createCallback(cb: TFuseAPICallbackHandler): string; releaseCallback(id: string): void; }