UNPKG

@carlosv2/glue

Version:

Dependency injection library that stays out of the way

42 lines 2.87 kB
import { DefinitionContext } from './context/index.js'; import { Tag } from './service.js'; import { Maybe } from './utils.js'; export type Call<T> = { method: T; params: T[]; }; export declare abstract class Processor<T> { protected abstract glob(pattern: string): string[]; protected abstract getFullPath(baseFile: string, relative: string, shouldExist?: boolean): string; protected abstract readContents(path: string): string; protected abstract serialise(path: string, data: unknown): string; protected abstract deserialise(path: string, data: string): unknown; protected abstract addExtend(path: string): void; protected abstract addParameter(id: string, parameter: T): void; protected abstract addAlias(id: string, alias: T): void; protected abstract addService(id: string, service: T): void; fromPaths(pattern: string): void; fromPath(path: string): void; fromContent(path: string, content: string): void; fromData(path: string, content: unknown): void; protected abstract processEnvStrValue(context: DefinitionContext, name: string, fallback: Maybe<string>): T; protected abstract processEnvBoolValue(context: DefinitionContext, name: string, fallback: Maybe<string>): T; protected abstract processEnvNumValue(context: DefinitionContext, name: string, fallback: Maybe<string>): T; protected abstract processEvalValue(context: DefinitionContext, code: string): T; protected abstract processLiteralValue(context: DefinitionContext, value: unknown): T; protected abstract processParameterValue(context: DefinitionContext, id: string): T; protected abstract processServiceValue(context: DefinitionContext, id: string): T; protected abstract processSymbolValue(context: DefinitionContext, path: string, name: Maybe<string>): T; protected abstract processTagListValue(context: DefinitionContext, name: string): T; protected abstract processTagObjectValue(context: DefinitionContext, name: string): T; protected parseValue(context: DefinitionContext, value: unknown): T; protected abstract processAlias(context: DefinitionContext, aliased: string): T; protected parseAlias(context: DefinitionContext, value: unknown): T; protected abstract processConstructorService(context: DefinitionContext, symbol: T, args: T[], scope: Maybe<string>, tags: Tag[], calls: Call<T>[]): T; protected abstract processFactoryService(context: DefinitionContext, symbol: T, factory: T, args: T[], scope: Maybe<string>, tags: Tag[], calls: Call<T>[]): T; protected abstract processPropertyService(context: DefinitionContext, symbol: T, property: T, scope: Maybe<string>, tags: Tag[], calls: Call<T>[]): T; private parseTag; private parseCall; protected parseService(context: DefinitionContext, value: unknown): T; } //# sourceMappingURL=processor.d.ts.map