UNPKG

entangle.ts

Version:

A declarative, event-driven framework for orchestrating business logic in TypeScript & Node.js applications.

29 lines (28 loc) 1.36 kB
import { ErrorHandler } from '../../errors/ErrorHandler'; import { HiggsField } from '../../higgs-field/HiggsField'; import { NotationString } from '../../shared/Notation'; import { Event } from '../../shared/types/Events.types'; import { Particle, ParticleLifecycle } from '../../shared/types/Particles.types'; import { Callback, ResolvableArgs } from '../../shared/types/Utils.types'; import { Superposition } from '../Superposition'; export declare class ParticleContractBuilder<TParticle, TArgs extends unknown[]> { private readonly parent; private readonly _event; private readonly _when?; private readonly _is?; private readonly contract; constructor(parent: Superposition, _event: string, _when?: NotationString | undefined, _is?: unknown | undefined); build(particleClass: Particle<TParticle, TArgs>): this; inScope(scope: HiggsField): this; using(...args: ResolvableArgs<TArgs>): this; emit(event: Event): this; requirements(events: Event[]): this; lifecycle(lifecycle: ParticleLifecycle): this; destroyOnInteraction(shouldDestroy: boolean): this; when(notationString: NotationString): this; is(value: unknown): this; once(): this; entanglement(entanglement: string): this; catch(errorHandler: ErrorHandler): this; then(callback?: Callback<[TParticle]>): Superposition; }