import { Base } from "../../class/Base.js"; import { AnyFunction } from "../../class/Mixin.js"; import { SetImmediateHelperDesc } from "../../util/Helpers.js"; import { LeveledQueue } from "../../util/LeveledQueue2.js"; import { Atom } from "../atom/Atom.js"; import { ChronoReference } from "../atom/Identifiable.js"; import { Quark } from "../atom/Quark.js"; import { CalculationModeGen, CalculationModeSync } from "../CalculationMode.js"; import { Owner } from "../data/Immutable.js"; import { Effect, EffectHandler, HasProposedValueEffect, HasProposedValueSymbol, PreviousValueOfEffect, PreviousValueOfSymbol, ProgressNotificationEffect, ProposedArgumentsOfEffect, ProposedArgumentsOfSymbol, ProposedOrPreviousSymbol, ProposedOrPreviousValueOfEffect, ProposedOrPreviousValueOfSymbol, ProposedValueOfEffect, ProposedValueOfSymbol, RejectEffect, RejectSymbol } from "../Effect.js"; import { Iteration } from "./Iteration.js"; import { Transaction } from "./Transaction.js"; export declare type GarbageCollectionStrategy = 'eager'; /** * The type of the argument for the [[commit]] call. Currently empty. */ export declare type CommitArguments = {}; /** * The type of the return value of the [[commit]] call. */ export declare type CommitResult = { /** * If the transaction has been rejected, this property will be filled with the [[RejectEffect]] instance */ rejectedWith?: RejectEffect | null; }; /** * A constant which will be used a commit result, when graph is not available. */ export declare const CommitZero: CommitResult; declare const ChronoGraph_base: (new (...input: any[]) => Base & import("typescript-serializable-mixin/index.js").Serializable & import("typescript-mixin-class/src/class/Mixin").ZeroBaseClass & { $class: string; $mode: import("typescript-serializable-mixin/index.js").SerializationMode; $includedProperties: object; $excludedProperties: object; toJSON(key: string): any; }) & typeof Base & (new (...input: any[]) => import("typescript-serializable-mixin/index.js").Serializable & import("typescript-mixin-class/src/class/Mixin").ZeroBaseClass) & { prototype: import("typescript-serializable-mixin/index.js").Serializable & import("typescript-mixin-class/src/class/Mixin").ZeroBaseClass; fromJSON: (json: object) => { $class: string; $mode: import("typescript-serializable-mixin/index.js").SerializationMode; $includedProperties: object; $excludedProperties: object; toJSON(key: string): any; }; } & { new (...input: any[]): { $class: string; $mode: import("typescript-serializable-mixin/index.js").SerializationMode; $includedProperties: object; $excludedProperties: object; toJSON(key: string): any; }; fromJSON: (json: object) => { $class: string; $mode: import("typescript-serializable-mixin/index.js").SerializationMode; $includedProperties: object; $excludedProperties: object; toJSON(key: string): any; }; }; export declare class ChronoGraph extends ChronoGraph_base implements Owner { historyLimit: number; identity: this; nextTransaction: Transaction[]; previous: this; atomsById: Map; isInitialCommit: boolean; isCommitting: boolean; ongoing: Promise; /** * If this option is enabled with `true` value, all data modification calls ([[write]], [[addIdentifier]], [[removeIdentifier]]) will trigger * a delayed [[commit]] call (or [[commitAsync]], depending from the [[autoCommitMode]] option). */ autoCommit: boolean; /** * How long to delay a commit after the data modification call has been made. */ autoCommitTimeout: number; /** * Indicates the default commit mode, which is used in [[autoCommit]]. */ autoCommitMode: 'sync' | 'async'; autoCommitHandler: AnyFunction; autoCommitTimeoutId: SetImmediateHelperDesc; effectHandlerSync: EffectHandler; effectHandlerAsync: EffectHandler; transactionClass: typeof Transaction; stack: LeveledQueue; bindAtomConstructor(cons: Cls): Cls; $immutable: Transaction; garbageCollection: GarbageCollectionStrategy; frozen: boolean; enableProgressNotifications: boolean; onComputationCycle: 'throw' | 'warn' | 'reject' | 'ignore'; initialize(props?: Partial): void; destroy(): void; get immutable(): Transaction; set immutable(immutable: Transaction); immutableForWrite(): this['immutable']; setCurrent(immutable: this['immutable']): void; getLastIteration(): Iteration; clear(): void; sweep(): void; mark(): void; unmark(): void; forEveryTransactionInHistory(func: (transaction: Transaction, reachable: boolean) => any): void; get activeTransaction(): Transaction; get currentTransaction(): Transaction; get currentIteration(): Iteration; finalizeCommit(iteration: Iteration): void; finalizeCommitAsync(iteration: Iteration): Promise; onDataWrite(writtenTo: Atom): void; scheduleAutoCommit(): void; unScheduleAutoCommit(): void; /** * Returns boolean, indicating whether the auto-commit is pending. */ hasPendingAutoCommit(): boolean; get dirty(): boolean; onPropagationProgressNotification(notification: ProgressNotificationEffect): void; onEffectAsync(effect: Effect): Promise; resolve(atom: Atom): Atom; onEffectSync(effect: Effect): unknown; commitAsync(args?: CommitArguments): Promise; doCommitAsync(arg?: CommitArguments): Promise; commit(arg?: CommitArguments): CommitResult; beforeCommit(): void; afterCommit(): void; reject(reason?: Reason): void; undo(): void; redo(): void; branch(config?: Partial): this; checkout(atom: T): T; getLatestQuarkOf(atom: T): Quark; addAtom(atom: A): A; addAtoms(atoms: Atom[]): void; removeAtom(atom: Atom): void; removeAtoms(atoms: Atom[]): void; addPossiblyStaleStrictAtomToTransaction(atom: Atom): void; registerQuark(quark: Quark): void; forEveryAtom(func: (atom: Atom) => any): void; get atomCount(): number; undoTo(sourceTransaction: Transaction, tillTransaction: Transaction): void; redoTo(sourceTransaction: Transaction, tillTransaction: Transaction): void; [RejectSymbol](effect: RejectEffect): unknown; [ProposedOrPreviousSymbol](effect: Effect): unknown; [PreviousValueOfSymbol](effect: PreviousValueOfEffect): unknown; [ProposedValueOfSymbol](effect: ProposedValueOfEffect): unknown; [ProposedArgumentsOfSymbol](effect: ProposedArgumentsOfEffect): unknown; [ProposedOrPreviousValueOfSymbol](effect: ProposedOrPreviousValueOfEffect): unknown; [HasProposedValueSymbol](effect: HasProposedValueEffect): any; readFieldWithAccessor(atom: Atom): unknown; staleInNextBatch: Atom[]; activeBatchRevision: number; batchDepth: number; activeAtom: Atom; enterBatch(): void; leaveBatch(): void; startBatch(): void; endBatch(): void; untracked(func: AnyFunction): R; } export declare const globalGraph: ChronoGraph; export {};