@codervisor/devlog-core
Version:
Core devlog management functionality
43 lines • 1.54 kB
TypeScript
/**
* Semantic key generation utility
* Generates kebab-case keys with hash suffixes to ensure uniqueness
*/
/**
* Generate a semantic key from title with hash suffix for uniqueness
*
* @param title - The title to generate a key from
* @param hashInput - Additional input for hash generation (e.g., description, timestamp)
* @returns A semantic key in kebab-case format with hash suffix
*
* @example
* generateSemanticKey("Fix Authentication Bug")
* // Returns: "fix-authentication-bug-a1b2c3d4"
*
* generateSemanticKey("Test Long Title", "some additional context")
* // Returns: "test-long-title-e5f6g7h8"
*/
export declare function generateSemanticKey(title: string, hashInput?: string): string;
/**
* Generate a key from a title with additional context for uniqueness
*
* @param title - The main title
* @param type - The entry type (feature, bugfix, etc.)
* @param description - Optional description for additional context
* @returns A semantic key with hash suffix
*/
export declare function generateDevlogKey(title: string, type: string, description?: string): string;
/**
* Validate that a key meets the required format
*
* @param key - The key to validate
* @returns True if key is valid
*/
export declare function isValidKey(key: string): boolean;
/**
* Extract the semantic part (without hash) from a generated key
*
* @param key - The generated key
* @returns The semantic part of the key
*/
export declare function extractSemanticPart(key: string): string;
//# sourceMappingURL=key-generator.d.ts.map