@agent-graph/core
Version:
A lightweight AI Agent orchestration solution
22 lines • 1.36 kB
TypeScript
export type InferPlaceholders<T extends string> = T extends `${string}{${infer Placeholder}}${infer Rest}` ? Placeholder | InferPlaceholders<Rest> : never;
export type DedentOptions = {
escapeSpecialCharacters?: boolean;
};
/** ref: https://github.com/dmnd/dedent */
export declare function dedent<T extends string = string>(str: T, options?: DedentOptions): T;
export declare function inject<T extends string, P extends Record<string, string | undefined>>(template: T, params: P): string;
export type TemplateOptions = {
dedent?: boolean;
dedentOptions?: DedentOptions;
};
export declare class StringTemplate<T extends string = string, PH extends string = InferPlaceholders<T>, PS extends Record<string, string> = Record<PH, string>> {
private template;
private readonly options;
constructor(template: T, options?: TemplateOptions);
fill(params: PS): string;
partial(params: Partial<PS>): this;
concat<T1 extends string = string, PH1 extends string = InferPlaceholders<T1>, PS1 extends Record<string, string> = Record<PH1, string>>(template: StringTemplate<T1, PH1, PS1>): StringTemplate<string, PH | PH1, PS & PS1>;
toString(): T;
}
export declare function fromString<T extends string = string>(t: T): StringTemplate<T, InferPlaceholders<T>, Record<InferPlaceholders<T>, string>>;
//# sourceMappingURL=template.d.ts.map