UNPKG

crux-wrapper

Version:

A React provider for your crux application

26 lines 749 B
import type { CruxApi, CruxEntity, CruxSerializer, OnEffect, Request } from "./types.js"; type EffectLog = { type: "effect"; name: string; id: string; at: number; time: number; }; export type EventSenderLog = { type: "event"; name: string; at: number; } | EffectLog | { type: "response"; name: string; to: string; at: number; }; export declare function createSender<VM, R extends Request>(apiRef: { value: null | Promise<CruxApi>; }, onEffect: OnEffect<VM>, serializer: CruxSerializer<VM, R>, log?: (payload: EventSenderLog) => void): { send(event: CruxEntity): Promise<void>; handleEffect: (rawEffects: Uint8Array) => Promise<void>; }; export {}; //# sourceMappingURL=eventSender.d.ts.map