stryker-api
Version:
The api for the extendable JavaScript mutation testing framework Stryker
37 lines • 1.6 kB
TypeScript
/**
* Represents a Factory to which items can register themselves and which can be used to create instances of said items.
* <TSettings> represents the type of the (one single) constructor argument used to create the instances.
* <T> represents the Type of the items created by this factory.
*/
declare abstract class Factory<TSettings, T> {
private readonly factoryName;
/**
* Creates a new Factory.
* @param factoryName The name of the Factory.
*/
constructor(factoryName: string);
private readonly classMap;
/**
* Retrieves the known names registered to this factory.
* @returns A list of sorted items which are registered.
*/
knownNames(): string[];
/**
* Registers a constructor function to this factory.
* @param name The name of the item.
* @param constructor The constructor of the item.
* @deprecated use `declareClassPlugin` or `declareFactoryPlugin`. See https://github.com/stryker-mutator/stryker-handbook/blob/master/stryker/api/plugins.md
*/
register(name: string, constructor: new (settings: TSettings) => T): void;
/**
* Creates a new instance of a registered item.
* @param name The name of the item.
* @param settings The settings object related to the item.
* @throws Will throw if no item has been registered with the specified name
* @returns A new instance of the requested item.
*/
create(name: string, settings: TSettings): T;
protected importSuggestion(name: string): string;
}
export default Factory;
//# sourceMappingURL=Factory.d.ts.map