/** * Extract variable names from a template string. * Supports ${var} and ${var:filter} syntax. * @param {string} template * @returns {string[]} */ export function extractVariables(template: string): string[]; /** * Resolve a template string by replacing ${var} placeholders with values. * Supports the :upper filter. * When a variable has no value, uses the field's default if available. * Applies prefix/suffix around the resolved value (only if non-empty). * @param {string} template * @param {Object} values - key/value map of field values * @param {Array} [fields] - optional array of field definitions (with default, prefix, suffix) * @returns {string} */ export function resolveTemplate(template: string, values: any, fields?: any[]): string; /** * Parse a filename to extract the base name, increment, and extension. * "rapport (3).pdf" → { baseName: "rapport", increment: 3, extension: ".pdf" } * "rapport.pdf" → { baseName: "rapport", increment: 0, extension: ".pdf" } * "rapport" → { baseName: "rapport", increment: 0, extension: "" } * @param {string} fileName * @returns {{ baseName: string, increment: number, extension: string }} */ export function parseFileName(fileName: string): { baseName: string; increment: number; extension: string; }; /** * Build an incremented filename. * ("rapport", 3, ".pdf") → "rapport (3).pdf" * ("rapport", 0, ".pdf") → "rapport.pdf" * @param {string} baseName * @param {number} increment * @param {string} extension * @returns {string} */ export function buildIncrementedName(baseName: string, increment: number, extension: string): string; /** * Deduplicate a list of filenames against each other and against existing names. * @param {string[]} newNames - the names to deduplicate * @param {string[]} existingNames - the names already present in the folder * @returns {string[]} - deduplicated names, in the same order */ export function deduplicateFileNames(newNames: string[], existingNames: string[]): string[]; /** * Build a regex from a nature's cm:name template string. * Each ${field} placeholder becomes a named capture group. * @param {string} template - e.g. "${NUMMARCHE}_${NATURE}" * @param {Map} fieldMap - Map of field name → field definition * @returns {{ regex: RegExp, fieldNames: Array<{groupName: string, fieldName: string}> } | null} */ export function buildTemplateRegex(template: string, fieldMap: Map): { regex: RegExp; fieldNames: Array<{ groupName: string; fieldName: string; }>; } | null; /** * Compute the specificity score of a template string. * Specificity = length of static text (everything outside ${…}) after removing underscores. * @param {string} template - e.g. "${NUM}-FAC-${NATURE}" * @returns {number} */ export function computeTemplateSpecificity(template: string): number; /** * Detect a document nature by matching a filename against nature templates. * @param {string} filename - filename with extension * @param {Array} natures - array of nature definitions (with metadata["cm:name"].template) * @param {Array} fields - array of field definitions * @returns {{ nature: Object, extractedMetadata: Object } | null} */ export function detectNatureFromFilename(filename: string, natures: any[], fields: any[]): { nature: any; extractedMetadata: any; } | null; //# sourceMappingURL=classificationPlanUtils.d.ts.map