UNPKG

europa-build

Version:

Tool for generating and maintaining Europa plugins and presets

40 lines (39 loc) 1.66 kB
import { LoggableOptions } from "../logger/Logger"; import { TemplateContext, TemplateProvider } from "./provider/TemplateProvider"; import { TemplateProviderType } from "./provider/TemplateProviderType"; declare const _logger: unique symbol; declare const _providers: unique symbol; /** * A basic manager for template providers that are mapped to their general names and types. */ export declare class TemplateManager { private readonly [_logger]; private readonly [_providers]; /** * Creates an instance of {@link TemplateManager} using the `options` provided. * * @param [options] - The options to be used. */ constructor(options?: TemplateManagerOptions); /** * Returns the template provider with the specified `name` and `type`. * * @param name - The name of the template provider to be returned. * @param type - The {@link TemplateProviderType} of the template provider to be returned. * @return The template provider matching `name` and `type`. * @throws If no template provider could be found with `name` and `type`. */ getProvider<C extends TemplateContext>(name: string, type: TemplateProviderType): TemplateProvider<C>; /** * Returns all template providers with the specified `type`. * * @param type - The {@link TemplateProviderType} of the template providers to be returned. * @return The template providers matching `type`. */ getProvidersForType(type: TemplateProviderType): TemplateProvider<any>[]; } /** * The options used by {@link TemplateManager}. */ export declare type TemplateManagerOptions = LoggableOptions; export {};