@statezero/core
Version:
The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate
49 lines (48 loc) • 1.67 kB
TypeScript
export class EventPayload {
constructor(data: any);
event: any;
model: any;
operation_id: any;
pk_field_name: any;
configKey: any;
instances: any;
_cachedInstances: any;
get modelClass(): Function | null;
getFullInstances(): Promise<any>;
}
export class SyncManager {
registries: Map<any, any>;
followedModels: Map<any, any>;
followAllQuerysets: boolean;
followedQuerysets: Map<any, any>;
periodicSyncTimer: NodeJS.Timeout | null;
eventBatch: Map<any, any>;
debounceTimer: NodeJS.Timeout | null;
maxWaitTimer: NodeJS.Timeout | null;
debounceMs: number;
maxWaitMs: number;
batchStartTime: number | null;
syncQueue: PQueue<import("p-queue/dist/priority-queue").default, import("p-queue").QueueAddOptions>;
withTimeout(promise: any, ms: any): Promise<any>;
/**
* Initialize event handlers for all event receivers
*/
initialize(): void;
startPeriodicSync(): void;
syncStaleQuerysets(): void;
pruneUnreferencedModels(): void;
isStoreFollowed(registry: any, semanticKey: any): boolean;
cleanup(): void;
followModel(registry: any, modelClass: any): void;
unfollowModel(registry: any, modelClass: any): void;
manageRegistry(registry: any): void;
removeRegistry(registry: any): void;
handleEvent: (event: any) => void;
processBatch(reason?: string): void;
isQuerysetFollowed(queryset: any): boolean;
processQuerysetsBatch(representativeEvent: any, allEvents: any): void;
processMetrics(event: any): void;
processModels(event: any): void;
}
import PQueue from "p-queue";
export const syncManager: SyncManager;