UNPKG

@chris.troutner/ipfs-message-port-client

Version:
42 lines 1.23 kB
export = Query; declare class Query<I, O> { /** * @param {string} namespace - component namespace on the server. * @param {string} method - remote method this is a query of. * @param {QueryInput<I>} input - query input. */ constructor(namespace: string, method: string, input: QueryInput<I>); /** @type {Promise<O>} */ result: Promise<O>; succeed: (value: O | PromiseLike<O>) => void; fail: (reason?: any) => void; signal: AbortSignal | undefined; input: QueryInput<I>; namespace: string; method: string; timeout: number; /** @type {number|null} */ timerID: number | null; /** * Data that will be structure cloned over message channel. * * @returns {Object} */ toJSON(): Object; /** * Data that will be transferred over message channel. * * @returns {Transferable[]|void} */ transfer(): Transferable[] | void; } declare namespace Query { export { QueryOptions, QueryInput }; } type QueryInput<I_1> = I_1 & QueryOptions; type QueryOptions = { signal?: AbortSignal | undefined; timeout?: number | undefined; transfer?: Transferable[] | undefined; }; //# sourceMappingURL=query.d.ts.map