safeer-pdf-generator
Version:
Framework-agnostic PDF generation library with chunking, merging, S3 upload, and email delivery
87 lines • 2.12 kB
TypeScript
import { TemplateCompilerFunction } from '../types.js';
/**
* Template registry for managing PDF templates
*/
export declare class TemplateRegistry {
private templates;
private defaultTemplateName;
constructor();
/**
* Register a new template
*/
register(name: string, compiler: TemplateCompilerFunction): void;
/**
* Get a template by name
*/
get(name: string): TemplateCompilerFunction;
/**
* Check if a template exists
*/
has(name: string): boolean;
/**
* Remove a template
*/
unregister(name: string): boolean;
/**
* Set the default template
*/
setDefault(name: string): void;
/**
* Get the default template
*/
getDefault(): TemplateCompilerFunction;
/**
* Get the default template name
*/
getDefaultName(): string;
/**
* List all available templates
*/
list(): string[];
/**
* Get template info
*/
getInfo(name: string): {
name: string;
isDefault: boolean;
isBuiltIn: boolean;
};
/**
* Clear all custom templates (keeps built-in ones)
*/
clearCustom(): void;
/**
* Clone the registry
*/
clone(): TemplateRegistry;
}
export declare const templateRegistry: TemplateRegistry;
/**
* Register a template globally
*/
export declare function registerTemplate(name: string, compiler: TemplateCompilerFunction): void;
/**
* Set the default template globally
*/
export declare function setDefaultTemplate(name: string): void;
/**
* List all available templates
*/
export declare function listTemplates(): string[];
/**
* Get template info
*/
export declare function getTemplateInfo(name: string): {
name: string;
isDefault: boolean;
isBuiltIn: boolean;
};
/**
* Check if template exists
*/
export declare function hasTemplate(name: string): boolean;
/**
* Resolve template from string name or function
*/
export declare function resolveTemplate(template?: string | TemplateCompilerFunction): TemplateCompilerFunction;
//# sourceMappingURL=registry.d.ts.map