import type { InjectableClass, InjectableFunction, InjectionToken } from 'typed-inject'; import { Reporter } from '../report/index.js'; import { TestRunner } from '../test-runner/index.js'; import { Checker } from '../check/index.js'; import { Ignorer } from '../ignore/ignorer.js'; import { PluginContext } from './contexts.js'; import { PluginKind } from './plugin-kind.js'; /** * Represents a StrykerPlugin */ export type Plugin = ClassPlugin>> | FactoryPlugin>> | ValuePlugin; /** * Represents a plugin that is created with a factory method */ export interface FactoryPlugin>> { readonly kind: TPluginKind; readonly name: string; /** * The factory method used to create the plugin */ readonly factory: InjectableFunction; } /** * Represents a plugin that is provided as a simple value. */ export interface ValuePlugin { readonly kind: TPluginKind; readonly name: string; readonly value: PluginInterfaces[TPluginKind]; } /** * Represents a plugin that is created by instantiating a class. */ export interface ClassPlugin>> { readonly kind: TPluginKind; readonly name: string; /** * The prototype function (class) used to create the plugin. * Not called `class` here, because that is a keyword */ readonly injectableClass: InjectableClass; } /** * Declare a class plugin. Use this method in order to type check the dependency graph of your plugin * @param kind The plugin kind * @param name The name of the plugin * @param injectableClass The class to be instantiated for the plugin */ export declare function declareClassPlugin>>(kind: TPluginKind, name: string, injectableClass: InjectableClass): ClassPlugin; /** * Declare a factory plugin. Use this method in order to type check the dependency graph of your plugin, * @param kind The plugin kind * @param name The name of the plugin * @param factory The factory used to instantiate the plugin */ export declare function declareFactoryPlugin>>(kind: TPluginKind, name: string, factory: InjectableFunction): FactoryPlugin; /** * Declare a value plugin. Use this method for simple plugins where you don't need values to be injected. * @param kind The plugin kind * @param name The name of the plugin * @param value The plugin */ export declare function declareValuePlugin(kind: TPluginKind, name: string, value: PluginInterfaces[TPluginKind]): ValuePlugin; /** * Lookup type for plugin interfaces by kind. */ export interface PluginInterfaces { [PluginKind.Reporter]: Reporter; [PluginKind.TestRunner]: TestRunner; [PluginKind.Checker]: Checker; [PluginKind.Ignore]: Ignorer; } /** * Lookup type for plugins by kind. */ export type Plugins = { [TPluginKind in keyof PluginInterfaces]: Plugin; }; //# sourceMappingURL=plugins.d.ts.map