import "minimal-polyfills/dist/lib/Array.prototype.find"; import { Handler } from "./types/Handler"; import { Operator } from "./types/Operator"; import { Ctx } from "./Ctx"; export declare const setPostCount: (evt: EvtCore, value: number) => void; /** Evt without evtAttach property, attachOnceMatched, createDelegate and without overload */ export declare class EvtCore { /** https://garronej.github.io/ts-evt/#evtpostcount */ readonly postCount: number; private traceId; private traceFormatter; private log; /** https://garronej.github.io/ts-evt/#evtenabletrace */ enableTrace(id: string, formatter?: (data: T) => string, log?: (message?: any, ...optionalParams: any[]) => void): void; /** https://garronej.github.io/ts-evt/#evtenabletrace */ disableTrace(): void; private readonly handlers; private readonly handlerTriggers; private readonly asyncHandlerChronologyMark; private readonly asyncHandlerChronologyExceptionRange; private readonly getChronologyMark; private readonly statelessByStatefulOp; protected onHandler: ((isAttach: boolean, handler: Handler) => void) | undefined; private detachHandler; private static doDetachIfNeeded; private triggerHandler; private addHandler; getStatelessOp(op: Operator): Operator.Stateless; private trace; /** * https://garronej.github.io/ts-evt/#evtattach-evtattachonce-and-evtpost * * Returns post count * */ post(data: T): number; /** Return isExtracted */ private postSync; private readonly postAsync; protected __waitFor(attachParams: Handler.PropsFromArgs): Promise; protected __attach(attachParams: Handler.PropsFromArgs): Promise; protected __attachExtract(attachParams: Handler.PropsFromArgs): Promise; protected __attachPrepend(attachParams: Handler.PropsFromArgs): Promise; protected __attachOnce(attachParams: Handler.PropsFromArgs): Promise; protected __attachOncePrepend(attachParams: Handler.PropsFromArgs): Promise; protected __attachOnceExtract(attachParams: Handler.PropsFromArgs): Promise; /** * https://garronej.github.io/ts-evt/#evtishandleddata * * Test if posting a given event data will have an effect. * * Return true if: * -There is at least one handler matching * this event data ( at least one handler's callback function * will be invoked if the data is posted. ) * -There is at least one handler that will be detached * if the event data is posted. * */ isHandled(data: T): boolean; /** https://garronej.github.io/ts-evt/#evtgethandlers */ getHandlers(): Handler[]; /** Detach every handlers of the Evt that are bound to the provided context */ detach(ctx: Ctx): Handler[]; /** (unsafe) Detach every handlers from the Evt */ detach(): Handler[]; }