import { InjectionToken, Provider } from '@nestjs/common'; import { ClsPlugin, ClsPluginHooks } from './cls-plugin.interface'; /** * Extend this class to create a new ClsPlugin * * It contains the basic structure for a plugin, including * some helper methods for common operations. */ export declare abstract class ClsPluginBase implements ClsPlugin { readonly name: string; imports: any[]; providers: Provider[]; exports: any[]; /** * @param name {@link ClsPlugin.name} */ constructor(name: string); protected get hooksProviderToken(): string; /** * Register the plugin hooks provider * * This is a shorthand for manually registering a provider * that returns the plugin hooks object provided under * the `hooksProviderToken` token. * * @example * ``` * this.registerHooks({ * inject: [OPTIONS], * useFactory: (options: PluginOptions): ClsPluginHooks => ({ * afterSetup: (cls: ClsService) => { * cls.set('some-key', options.pluginData); * } * }) * }) * ``` */ protected registerHooks(opts: { inject?: InjectionToken[]; useFactory: (...args: any[]) => ClsPluginHooks; }): void; } export declare function getPluginHooksToken(name: string): string; export declare function isPluginHooksToken(token: string | symbol): boolean; //# sourceMappingURL=cls-plugin-base.d.ts.map