/** * Template management for spec-kit * * This module provides: * - Type definitions for templates (TemplateType, TemplateDefinition) * - Registry of all template definitions (TEMPLATES) * - Template resolution with custom/default fallback (resolveTemplate) * - Variable substitution (substituteVariables) * - Destination path calculation (getDestinationPath) */ import type { SpecKitConfig } from '../config.js'; import type { TemplateType, TemplateDefinition } from './types.js'; export { TEMPLATE_TYPES, isTemplateType } from './types.js'; export type { TemplateType, TemplateDefinition, TemplateVariables } from './types.js'; export { substituteVariables, createTemplateVariables } from './variables.js'; /** * Registry of all template definitions * * Each template type has: * - type: The template type identifier * - defaultFilename: Filename when copied to destination * - sourceFile: Filename to look for in custom templates directory * - defaultContent: Embedded default content (fallback) * - destSubdir: Optional subdirectory (e.g., 'checklists') */ export declare const TEMPLATES: Record; /** * Resolve template content with fallback to defaults * * Resolution order: * 1. Check for custom template at config.paths.templates + sourceFile * 2. Fall back to embedded defaultContent * * @param type - Template type to resolve * @param config - SpecKit configuration * @param repoRoot - Repository root path * @returns Template content string * * @example * ```typescript * const content = await resolveTemplate('spec', config, repoRoot); * // Returns custom .specify/templates/spec-template.md if exists * // Otherwise returns embedded default content * ``` */ export declare function resolveTemplate(type: TemplateType, config: SpecKitConfig, repoRoot: string): Promise; /** * Get destination path for a template * * Handles special cases: * - agent-file: Always placed at repo root * - checklist: Placed in checklists/ subdirectory * - others: Placed directly in feature directory * * @param type - Template type * @param featureDir - Feature directory path * @param repoRoot - Repository root path * @param customFilename - Optional custom filename override * @returns Full destination path * * @example * ```typescript * // Standard template * getDestinationPath('spec', '/repo/specs/123-feature', '/repo') * // Returns: '/repo/specs/123-feature/spec.md' * * // Checklist (subdirectory) * getDestinationPath('checklist', '/repo/specs/123-feature', '/repo') * // Returns: '/repo/specs/123-feature/checklists/checklist.md' * * // Agent file (repo root) * getDestinationPath('agent-file', '/repo/specs/123-feature', '/repo') * // Returns: '/repo/CLAUDE.md' * ``` */ export declare function getDestinationPath(type: TemplateType, featureDir: string, repoRoot: string, customFilename?: string): string; /** * Get the template definition for a given type * * @param type - Template type * @returns Template definition or undefined if not found */ export declare function getTemplateDefinition(type: string): TemplateDefinition | undefined; //# sourceMappingURL=index.d.ts.map