UNPKG

legal-markdown-js

Version:

Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version

73 lines 2.09 kB
/** * File Naming Utilities * * This module provides utilities for generating file names with suffixes, * handling conflicts, and managing file naming conventions used throughout * the Legal Markdown JS application. */ /** * Common file suffixes used in the application */ export declare const FILE_SUFFIXES: { readonly HIGHLIGHT: "HIGHLIGHT"; readonly ORIGINAL: "ORIGINAL"; readonly PROCESSED: "PROCESSED"; }; /** * Add a suffix to a filename before the extension * * @param filePath The original file path * @param suffix The suffix to add (without dots) * @returns The new file path with suffix * * @example * ```typescript * addSuffixToFilename('document.pdf', 'HIGHLIGHT') * // Returns: 'document.HIGHLIGHT.pdf' * * addSuffixToFilename('/path/contract.md', 'ORIGINAL') * // Returns: '/path/contract.ORIGINAL.md' * ``` */ export declare function addSuffixToFilename(filePath: string, suffix: string): string; /** * Generate paths for original and processed versions of a file * * @param filePath The base file path * @returns Object with original and processed file paths * * @example * ```typescript * generateArchivePaths('/archive/document.md') * // Returns: { * // original: '/archive/document.ORIGINAL.md', * // processed: '/archive/document.PROCESSED.md' * // } * ``` */ export declare function generateArchivePaths(filePath: string): { original: string; processed: string; }; /** * Generate highlight version file path * * @param filePath The original file path * @returns The file path with HIGHLIGHT suffix * * @example * ```typescript * generateHighlightPath('document.pdf') * // Returns: 'document.HIGHLIGHT.pdf' * ``` */ export declare function generateHighlightPath(filePath: string): string; /** * Check if two file contents are identical * * @param content1 First file content * @param content2 Second file content * @returns True if contents are identical */ export declare function areContentsIdentical(content1: string, content2: string): boolean; //# sourceMappingURL=file-naming.d.ts.map