UNPKG

longurl-js

Version:

LongURL - Programmable URL management framework with entity-driven design and production-ready infrastructure

26 lines (25 loc) 1.08 kB
/** * Pattern URL Generator * * Handles URL pattern generation with placeholders like {publicId} * Integrates with existing collision detection and error handling. */ import { GenerationResult, DatabaseConfig, UrlGenerationOptions } from '../types'; /** * Generate a URL using a pattern with {publicId} placeholder * * @param entityType Type of entity (any string) * @param entityId Original entity ID (for metadata/context) * @param urlPattern Pattern with {publicId} placeholder (e.g., 'weekend-emergency-plumber-austin-{publicId}') * @param options Configuration options * @param dbConfig Database configuration for collision detection * @returns Generated URL and result info */ export declare function generatePatternUrl(entityType: string, entityId: string, urlPattern: string, options: UrlGenerationOptions | undefined, dbConfig: DatabaseConfig): Promise<GenerationResult>; /** * Validate a URL pattern * * @param pattern Pattern to validate * @returns True if valid, false otherwise */ export declare function validateUrlPattern(pattern: string): boolean;