@memory-bank/mcp
Version:
Memory-enabled Co-Pilot (MCP) server for managing project documentation and context
95 lines • 3.3 kB
TypeScript
/**
* Section Domain Model
*
* Represents a section within a template with multilingual title and content.
* Implements value object pattern - immutable and equality based on value.
*/
import { Language, LanguageCode } from '../i18n/Language.js';
/**
* Type for multilingual text mapping
*/
export type LanguageTextMap = Partial<Record<LanguageCode, string>>;
/**
* Section class represents a section of a template with localized titles and content
*/
export declare class Section {
private readonly _id;
private readonly _titleMap;
private readonly _contentMap;
private readonly _isOptional;
/**
* Constructor with validation
*
* @param id Section identifier
* @param titleMap Map of language codes to localized titles
* @param contentMap Optional map of language codes to localized content
* @param isOptional Whether this section is optional
* @throws Error if id is empty or titleMap is empty
*/
constructor(id: string, titleMap: LanguageTextMap, contentMap?: LanguageTextMap, isOptional?: boolean);
/**
* Gets the section identifier
*/
get id(): string;
/**
* Gets the map of language codes to titles
*/
get titleMap(): LanguageTextMap;
/**
* Gets the map of language codes to content
*/
get contentMap(): LanguageTextMap;
/**
* Gets whether this section is optional
*/
get isOptional(): boolean;
/**
* Creates a Section instance, validating inputs
*
* @param id Section identifier
* @param titleMap Map of language codes to localized titles
* @param contentMap Optional map of language codes to localized content
* @param isOptional Whether this section is optional
* @returns Section instance
* @throws Error if id is empty or titleMap is empty
*/
static create(id: string, titleMap: LanguageTextMap, contentMap?: LanguageTextMap, isOptional?: boolean): Section;
/**
* Gets the localized title for a specific language
*
* @param language Language to get title for
* @returns Localized title string
*/
getTitle(language: Language): string;
/**
* Gets the localized content for a specific language
*
* @param language Language to get content for
* @returns Localized content string or empty string if not available
*/
getContent(language: Language): string;
/**
* Creates a new Section with updated content for a language
*
* @param languageCode Language code to update content for
* @param content New content text
* @returns New Section instance with updated content
*/
withContent(languageCode: LanguageCode, content: string): Section;
/**
* Creates a new Section with updated title for a language
*
* @param languageCode Language code to update title for
* @param title New title text
* @returns New Section instance with updated title
*/
withTitle(languageCode: LanguageCode, title: string): Section;
/**
* Compare equality with another Section object
*
* @param other Another Section object to compare
* @returns true if equal, false otherwise
*/
equals(other: Section): boolean;
}
//# sourceMappingURL=Section.d.ts.map