UNPKG

reactronic

Version:

Reactronic - Transactional Reactive State Management

58 lines (57 loc) 1.77 kB
import { LoggingOptions } from "./Logging.js"; export { LoggingLevel } from "./Logging.js"; export type { LoggingOptions, ProfilingOptions } from "./Logging.js"; import { Journal } from "./core/Journal.js"; import { Indicator } from "./core/Indicator.js"; export type SnapshotOptions = { readonly hint?: string; readonly isolation?: Isolation; readonly journal?: Journal; readonly logging?: Partial<LoggingOptions>; readonly token?: any; }; export type MemberOptions = { readonly kind: Kind; readonly isolation: Isolation; readonly order: number; readonly noSideEffects: boolean; readonly triggeringArgs: boolean; readonly throttling: number; readonly reentrance: Reentrance; readonly allowObsoleteToFinish: boolean; readonly journal: Journal | undefined; readonly indicator: Indicator | null; readonly logging?: Partial<LoggingOptions>; }; export declare enum Kind { plain = 0, atomic = 1, reactive = 2, cached = 3 } export declare enum Reentrance { preventWithError = 1, waitAndRestart = 0, cancelPrevious = -1, cancelAndWaitPrevious = -2, overwritePrevious = -3, runSideBySide = -4 } export declare enum Isolation { joinToCurrentTransaction = 0, joinAsNestedTransaction = 1, disjoinFromOuterTransaction = 2, disjoinFromOuterAndInnerTransactions = 3, disjoinForInternalDisposal = 4 } export type Operation<T> = { readonly options: MemberOptions; readonly args: ReadonlyArray<any>; readonly result: T; readonly error: any; readonly stamp: number; readonly isReusable: boolean; configure(options: Partial<MemberOptions>): MemberOptions; markObsolete(): void; pullLastResult(args?: any[]): T | undefined; };