@memory-bank/mcp
Version:
Memory-enabled Co-Pilot (MCP) server for managing project documentation and context
90 lines • 2.91 kB
TypeScript
/**
* Template Domain Model
*
* Represents a template with multilingual properties and sections.
* Implements value object pattern - immutable and equality based on value.
*/
import { Language } from '../i18n/Language.js';
import { Section, LanguageTextMap } from './Section.js';
/**
* Template class represents a template with localized names and sections
*/
export declare class Template {
private readonly _id;
private readonly _type;
private readonly _nameMap;
private readonly _sections;
/**
* Constructor with validation
*
* @param id Template identifier
* @param type Template type
* @param nameMap Map of language codes to localized names
* @param sections Optional array of template sections
* @throws Error if id is empty, type is empty, or nameMap is empty
*/
constructor(id: string, type: string, nameMap: LanguageTextMap, sections?: Section[]);
/**
* Gets the template identifier
*/
get id(): string;
/**
* Gets the template type
*/
get type(): string;
/**
* Gets the map of language codes to names
*/
get nameMap(): LanguageTextMap;
/**
* Gets the array of sections
*/
get sections(): Section[];
/**
* Creates a Template instance, validating inputs
*
* @param id Template identifier
* @param type Template type
* @param nameMap Map of language codes to localized names
* @param sections Optional array of template sections
* @returns Template instance
* @throws Error if id is empty, type is empty, or nameMap is empty
*/
static create(id: string, type: string, nameMap: LanguageTextMap, sections?: Section[]): Template;
/**
* Gets the localized name for a specific language
*
* @param language Language to get name for
* @returns Localized name string
*/
getName(language: Language): string;
/**
* Gets a section by ID
*
* @param sectionId Section ID to look for
* @returns Section if found, null otherwise
*/
getSection(sectionId: string): Section | null;
/**
* Creates a new Template with a section added or updated
*
* @param section Section to add or update
* @returns New Template instance with the section added or updated
*/
withSection(section: Section): Template;
/**
* Creates a new Template with a section removed
*
* @param sectionId ID of section to remove
* @returns New Template instance with the section removed, or this instance if not found
*/
withoutSection(sectionId: string): Template;
/**
* Compare equality with another Template object
*
* @param other Another Template object to compare
* @returns true if equal, false otherwise
*/
equals(other: Template): boolean;
}
//# sourceMappingURL=Template.d.ts.map