import { BufferedPriorityQueue } from "./bufferedqueue.js"; import { Behavior } from "./behavior.js"; import { Extent } from "./extent.js"; import { Demandable, Resource } from "./resource.js"; import { DateProvider, GraphEvent, Subscription, Transient } from "./common"; interface SideEffect { block: (extent: Extent | null) => void; extent: Extent | null; behavior: Behavior | null; debugName?: string; } interface Action { block: (extent: Extent | null) => void; extent: Extent | null; resolve: ((value: any) => void) | null; debugName?: string; } export declare class Graph { dateProvider: DateProvider; currentEvent: GraphEvent | null; lastEvent: GraphEvent; activatedBehaviors: BufferedPriorityQueue; currentBehavior: Behavior | null; effects: SideEffect[]; actions: Action[]; untrackedBehaviors: Behavior[]; modifiedDemandBehaviors: Behavior[]; modifiedSupplyBehaviors: Behavior[]; updatedTransients: Transient[]; needsOrdering: Behavior[]; eventLoopState: EventLoopState | null; extentsAdded: Extent[]; extentsRemoved: Extent[]; validateLifetimes: boolean; justUpdatedCallbacks: Set; constructor(); action(block: () => void, debugName?: string): void; actionHelper(action: Action): void; actionAsync(block: () => void, debugName?: string): Promise; actionAsyncHelper(action: Action): Promise; private eventLoop; private validateAddedExtents; private validateRemovedExtents; private clearTransients; trackTransient(resource: Transient): void; resourceTouched(resource: Resource): void; private activateBehavior; private runNextBehavior; subscribeToJustUpdated(resources: Resource[], callback: () => void): () => void; _subscribeToJustUpdated(resources: Resource[], subscription: Subscription): () => void; _notifyJustUpdatedSubscribers(subscribers: Set): void; private turnSubscriptionsIntoSideEffects; sideEffect(block: () => void, debugName?: string): void; sideEffectHelper(sideEffect: SideEffect): void; debugHere(): string; private addUntrackedBehaviors; private addUntrackedSupplies; private addUntrackedDemands; private orderBehaviors; private sortDFS; debugCycleForBehavior(behavior: Behavior): Resource[]; private cycleDFS; addBehavior(behavior: Behavior): void; updateDemands(behavior: Behavior, newDemands: Demandable[] | null): void; updateSupplies(behavior: Behavior, newSupplies: Resource[] | null): void; removeBehavior(behavior: Behavior, sequence: number): void; addExtent(extent: Extent): void; removeExtent(extent: Extent): void; } declare enum EventLoopPhase { queued = 0, action = 1, updates = 2, sideEffects = 3 } export declare class EventLoopState { action: Action; actionUpdates: Resource[]; currentSideEffect: SideEffect | null; phase: EventLoopPhase; constructor(action: Action); } export {};