UNPKG

@wordpress/sync

Version:
17 lines 765 B
export type ObjectID = string; export type ObjectType = string; export type ObjectData = any; export type CRDTDoc = any; export type ObjectConfig = { fetch: (id: ObjectID) => Promise<ObjectData>; applyChangesToDoc: (doc: CRDTDoc, data: any) => void; fromCRDTDoc: (doc: CRDTDoc) => any; }; export type ConnectDoc = (id: ObjectID, type: ObjectType, doc: CRDTDoc) => Promise<() => void>; export type SyncProvider = { register: (type: ObjectType, config: ObjectConfig) => void; bootstrap: (type: ObjectType, id: ObjectID, handleChanges: (data: any) => void) => Promise<CRDTDoc>; update: (type: ObjectType, id: ObjectID, data: any) => void; discard: (type: ObjectType, id: ObjectID) => Promise<CRDTDoc>; }; //# sourceMappingURL=types.d.ts.map