/** * Load per-type work-item templates for the annotation-driven sync. * * Templates are plain markdown files with frontmatter + annotated sections. * They describe the default shape of a synced file for each work-item type: * - which frontmatter keys are prefilled (and in what order) * - which body sections appear (and which ADO refnames they map to) * * Load order for a given work-item type (case-insensitive, spaces→hyphens): * 1. `MCP_ADO_SYNC_TEMPLATE_DIR/{type-slug}.md` — user override, if set * 2. Built-in template shipped with the package * 3. Generic fallback (title + Description section only) */ export interface TemplateBodyField { /** ADO refname this section maps to. */ refname: string; /** Heading text shown in the file. */ heading: string; } export interface WorkItemTemplate { /** Work-item type the template applies to (from frontmatter `type`). */ type: string; /** Frontmatter defaults (ordered), keyed by the key used in the template. */ frontmatterOrder: string[]; /** Frontmatter default values by key. */ frontmatterDefaults: Record; /** Body section definitions, in template order. */ bodyFields: TemplateBodyField[]; /** Raw template content for diagnostics. */ raw: string; } /** * Slugify a work-item type for filename lookup. * "User Story" → "user-story", "Bug" → "bug". */ export declare function slugifyType(type: string): string; /** * Load a template by work-item type. Returns the generic fallback if no * built-in or override template exists. */ export declare function loadTemplate(workItemType: string): WorkItemTemplate; /** * Parse a template file into a WorkItemTemplate. */ export declare function parseTemplate(raw: string, typeHint: string): WorkItemTemplate; /** Apply placeholder substitution ({{project}}, {{parent}}) to default values. */ export declare function applyTemplatePlaceholders(template: WorkItemTemplate, ctx: { project: string; parent?: number; }): WorkItemTemplate; /** * List all body-field refnames known for a work-item type. Used when * deciding which ADO fields to HTML-detect on pull. */ export declare function templateBodyRefnames(workItemType: string): string[]; //# sourceMappingURL=template-loader.d.ts.map