import { IModulePatcher, IModulePatchMap } from "./patchRequire"; export { PatchFunction, IModulePatcher, makePatchingRequire } from "./patchRequire"; export interface ISpanContext { traceId: string; spanId: string; traceFlags?: string; tracestate?: string; } declare type ScopeManager = any; export interface IStandardEvent { timestamp: number; data: T; } export declare type ISubscriber = (event: IStandardEvent) => void; export declare type IFilter = (publishing: boolean) => boolean; export declare type IPatchedCallback = (moduleName: string, version: string) => void; interface IPatchedModule { name: string; version: string; } export interface IChannel { shouldPublish(name: string): boolean; publish(name: string, event: T): void; subscribe(name: string, listener: ISubscriber, filter?: IFilter, patchCallback?: IPatchedCallback): void; unsubscribe(name: string, listener: ISubscriber, filter?: IFilter): void; bindToContext(cb: T): T; addContextPreservation(preserver: (cb: T) => T): void; registerMonkeyPatch(packageName: string, patcher: IModulePatcher): void; getPatchesObject(): IModulePatchMap; addPatchedModule(moduleName: string, version: string): void; } export declare const trueFilter: (publishing: boolean) => boolean; export declare class ContextPreservingEventEmitter implements IChannel { version: string; spanContextPropagator: ScopeManager; private subscribers; private contextPreservationFunction; private knownPatches; modulesPatched: IPatchedModule[]; private currentlyPublishing; shouldPublish(name: string): boolean; publish(name: string, event: T): void; subscribe(name: string, listener: ISubscriber, filter?: IFilter, patchCallback?: IPatchedCallback): void; unsubscribe(name: string, listener: ISubscriber, filter?: IFilter): boolean; reset(): void; bindToContext(cb: T): T; addContextPreservation(preserver: (cb: T) => T): void; registerMonkeyPatch(packageName: string, patcher: IModulePatcher): void; getPatchesObject(): IModulePatchMap; addPatchedModule(name: string, version: string): void; private checkIfModuleIsAlreadyPatched; } export declare const channel: IChannel;