import { EvtCore } from "./EvtCore"; import { Handler } from "./types/Handler"; import { Operator } from "./types/Operator"; import { Ctx } from "./Ctx"; import { merge } from "./util/merge"; import { from } from "./util/fromEvent"; declare type VoidCtx = import("./Ctx").VoidCtx; export declare class Evt extends EvtCore { /** return a new Ctx instance */ static newCtx(): T extends void ? VoidCtx : Ctx; /** * Evt.weakCtx(obj) always return the same instance of VoidCtx for a given object. * No strong reference to the object is created * when the object is no longer referenced it's associated Ctx will be freed from memory. */ static readonly getCtx: (obj: object) => import("./Ctx").VoidCtx; static merge: typeof merge; static from: typeof from; readonly getEvtAttach: () => Evt>; readonly getEvtDetach: () => Evt>; constructor(); postAsyncOnceHandled(data: T): Promise; postSyncOnceHandled(data: T): Promise; private __postOnceHandled; private __parseOverloadParams; pipe(): Evt; pipe(op: Operator.fλ): Evt; pipe(op: (data: T) => data is U): Evt; pipe(op: (data: T) => boolean): Evt; pipe(ctx: Ctx): Evt; pipe(ctx: Ctx, op: Operator.fλ): Evt; pipe(ctx: Ctx, op: (data: T) => data is U): Evt; pipe(ctx: Ctx, op: (data: T) => boolean): Evt; pipe(op1: Operator.fλ, op2: Operator.fλ): Evt; pipe(op1: Operator.fλ, op2: (data: B) => data is C): Evt; pipe(op1: Operator.fλ, op2: (data: B) => boolean): Evt; pipe(op1: (data: T) => data is B, op2: Operator.fλ): Evt; pipe(op1: (data: T) => boolean, op2: Operator.fλ): Evt; pipe(op1: (data: T) => data is B, op2: (data: B) => data is C): Evt; pipe(op1: (data: T) => data is B, op2: (data: B) => boolean): Evt; pipe(op1: (data: T) => boolean, op2: (data: T) => data is B): Evt; pipe(op1: (data: T) => boolean, op2: (data: T) => boolean): Evt; pipe(op1: Operator.fλ, op2: Operator.fλ, op3: Operator.fλ): Evt; pipe(op1: Operator.fλ, op2: Operator.fλ, op3: Operator.fλ, op4: Operator.fλ): Evt; pipe(op1: Operator.fλ, op2: Operator.fλ, op3: Operator.fλ, op4: Operator.fλ): Evt; pipe(op1: Operator.fλ, op2: Operator.fλ, op3: Operator.fλ, op4: Operator.fλ, op5: Operator.fλ): Evt; pipe(op1: Operator, op2: Operator): Evt; pipe(op1: Operator, op2: Operator, op3: Operator): Evt; pipe(op1: Operator, op2: Operator, op3: Operator, op4: Operator): Evt; pipe(op1: Operator, op2: Operator, op3: Operator, op4: Operator, op5: Operator): Evt; pipe(...ops: [Operator, ...Operator[]]): Evt; pipe(...ops: [Operator, ...Operator[]]): Evt; /** * op - fλ * * ctx * * timeout? */ waitFor(op: Operator.fλ.Stateless, ctx: Ctx, timeout?: number): Promise; /** * op - Type guard * * ctx * * timeout? */ waitFor(op: (data: T) => data is Q, ctx: Ctx, timeout?: number): Promise; /** * op - Filter * * ctx * * timeout? */ waitFor(op: (data: T) => boolean, ctx: Ctx, timeout?: number): Promise; /** * op - fλ * * timeout? */ waitFor(op: Operator.fλ.Stateless, timeout?: number): Promise; /** * op - Type guard * * timeout? */ waitFor(op: (data: T) => data is Q, timeout?: number): Promise; /** * op - Filter * * timeout? */ waitFor(op: (data: T) => boolean, timeout?: number): Promise; /** * ctx * * timeout? */ waitFor(ctx: Ctx, timeout?: number): Promise; /** * timeout? */ waitFor(timeout?: number): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * timeout * * callback */ $attach(op: Operator.fλ, ctx: Ctx, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * callback */ $attach(op: Operator.fλ, ctx: Ctx, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * timeout * * callback */ $attach(op: Operator.fλ, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * callback */ $attach(op: Operator.fλ, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Type guard * * ctx * * timeout * * callback */ attach(op: (data: T) => data is Q, ctx: Ctx, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Filter * * ctx * * timeout * * callback */ attach(op: (data: T) => boolean, ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Type guard * * ctx * * callback */ attach(op: (data: T) => data is Q, ctx: Ctx, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Filter * * ctx * * callback */ attach(op: (data: T) => boolean, ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Type guard * * timeout * * callback */ attach(op: (data: T) => data is Q, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Filter * * timeout * * callback */ attach(op: (data: T) => boolean, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * ctx * * timeout * * callback */ attach(ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Type guard * * callback */ attach(op: (data: T) => data is Q, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Filter * * callback */ attach(op: (data: T) => boolean, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * ctx * * callback */ attach(ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * timeout * * callback */ attach(timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * callback */ attach(callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * timeout * * callback */ $attachOnce(op: Operator.fλ.Stateless, ctx: Ctx, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * callback */ $attachOnce(op: Operator.fλ.Stateless, ctx: Ctx, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * timeout * * callback */ $attachOnce(op: Operator.fλ.Stateless, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * callback */ $attachOnce(op: Operator.fλ.Stateless, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Type guard * * ctx * * timeout * * callback */ attachOnce(op: (data: T) => data is Q, ctx: Ctx, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Filter * * ctx * * timeout * * callback */ attachOnce(op: (data: T) => boolean, ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Type guard * * ctx * * callback */ attachOnce(op: (data: T) => data is Q, ctx: Ctx, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Filter * * ctx * * callback */ attachOnce(op: (data: T) => boolean, ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Type guard * * timeout * * callback */ attachOnce(op: (data: T) => data is Q, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Filter * * timeout * * callback */ attachOnce(op: (data: T) => boolean, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * ctx * * timeout * * callback */ attachOnce(ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Type guard * * callback */ attachOnce(op: (data: T) => data is Q, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * op - Filter * * callback */ attachOnce(op: (data: T) => boolean, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * ctx * * callback */ attachOnce(ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * timeout * * callback */ attachOnce(timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpostdata * * callback */ attachOnce(callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * timeout * * callback */ $attachExtract(op: Operator.fλ, ctx: Ctx, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * callback */ $attachExtract(op: Operator.fλ, ctx: Ctx, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * timeout * * callback */ $attachExtract(op: Operator.fλ, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * callback */ $attachExtract(op: Operator.fλ, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Type guard * * ctx * * timeout * * callback */ attachExtract(op: (data: T) => data is Q, ctx: Ctx, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - fλ * * ctx * * timeout * * callback */ attachExtract(op: (data: T) => boolean, ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Type guard * * ctx * * callback */ attachExtract(op: (data: T) => data is Q, ctx: Ctx, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Filter * * ctx * * callback */ attachExtract(op: (data: T) => boolean, ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Type guard * * timeout * * callback */ attachExtract(op: (data: T) => data is Q, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Filter * * timeout * * callback */ attachExtract(op: (data: T) => boolean, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Type guard * * callback */ attachExtract(op: (data: T) => data is Q, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Filter * * callback */ attachExtract(op: (data: T) => boolean, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * timeout * * callback */ $attachPrepend(op: Operator.fλ, ctx: Ctx, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * callback */ $attachPrepend(op: Operator.fλ, ctx: Ctx, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * timeout * * callback */ $attachPrepend(op: Operator.fλ, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * callback */ $attachPrepend(op: Operator.fλ, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * op - Type guard * * ctx * * timeout * * callback */ attachPrepend(op: (data: T) => data is Q, ctx: Ctx, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * op - Filter * * ctx * * timeout * * callback */ attachPrepend(op: (data: T) => boolean, ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * op - Type guard * * ctx * * callback */ attachPrepend(op: (data: T) => data is Q, ctx: Ctx, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * op - Filter * * ctx * * callback */ attachPrepend(op: (data: T) => boolean, ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * op - Type guard * * timeout * * callback */ attachPrepend(op: (data: T) => data is Q, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * op - Filter * * timeout * * callback */ attachPrepend(op: (data: T) => boolean, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * ctx * * timeout * * callback */ attachPrepend(ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * op - Type guard * * callback */ attachPrepend(op: (data: T) => data is Q, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * op - Filter * * callback */ attachPrepend(op: (data: T) => boolean, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * ctx * * callback */ attachPrepend(ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * timeout * * callback */ attachPrepend(timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and-evtattachonceprepend * * callback */ attachPrepend(callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * timeout * * callback */ $attachOncePrepend(op: Operator.fλ.Stateless, ctx: Ctx, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * callback */ $attachOncePrepend(op: Operator.fλ.Stateless, ctx: Ctx, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * timeout * * callback */ $attachOncePrepend(op: Operator.fλ.Stateless, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * callback */ $attachOncePrepend(op: Operator.fλ.Stateless, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * op - Type guard * * ctx * * timeout * * callback */ attachOncePrepend(op: (data: T) => data is Q, ctx: Ctx, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * op - Filter * * ctx * * timeout * * callback */ attachOncePrepend(op: (data: T) => boolean, ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * op - Type guard * * ctx * * callback */ attachOncePrepend(op: (data: T) => data is Q, ctx: Ctx, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * op - Filter * * ctx * * callback */ attachOncePrepend(op: (data: T) => boolean, ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * op - Type guard * * timeout * * callback */ attachOncePrepend(op: (data: T) => data is Q, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * op - Filter * * timeout * * callback */ attachOncePrepend(op: (data: T) => boolean, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * ctx * * timeout * * callback */ attachOncePrepend(ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * op - Type guard * * callback */ attachOncePrepend(op: (data: T) => data is Q, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * op - Filter * * callback */ attachOncePrepend(op: (data: T) => boolean, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * ctx * * callback */ attachOncePrepend(ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * timeout * * callback */ attachOncePrepend(timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachprepend-and--evtattachonceprepend * * callback */ attachOncePrepend(callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * timeout * * callback */ $attachOnceExtract(op: Operator.fλ.Stateless, ctx: Ctx, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * ctx * * callback */ $attachOnceExtract(op: Operator.fλ.Stateless, ctx: Ctx, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * timeout * * callback */ $attachOnceExtract(op: Operator.fλ.Stateless, timeout: number, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#op---fλ * * op - fλ * * callback */ $attachOnceExtract(op: Operator.fλ.Stateless, callback: (transformedData: U) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Type guard * * ctx * * timeout * * callback */ attachOnceExtract(op: (data: T) => data is Q, ctx: Ctx, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Filter * * ctx * * timeout * * callback */ attachOnceExtract(op: (data: T) => boolean, ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Type guard * * ctx * * callback */ attachOnceExtract(op: (data: T) => data is Q, ctx: Ctx, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Filter * * ctx * * callback */ attachOnceExtract(op: (data: T) => boolean, ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Type guard * * timeout * * callback */ attachOnceExtract(op: (data: T) => data is Q, timeout: number, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Filter * * timeout * * callback */ attachOnceExtract(op: (data: T) => boolean, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * ctx * * timeout */ attachOnceExtract(ctx: Ctx, timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Type guard * * callback */ attachOnceExtract(op: (data: T) => data is Q, callback: (data: Q) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * op - Filter * * callback */ attachOnceExtract(op: (data: T) => boolean, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * ctx * * callback */ attachOnceExtract(ctx: Ctx, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * timeout * * callback */ attachOnceExtract(timeout: number, callback: (data: T) => void): Promise; /** * https://garronej.github.io/ts-evt/#evtattachextract-and-evtattachonceextract * * callback */ attachOnceExtract(callback: (data: T) => void): Promise; } export {};