/** * Validate that component is empty for specific package type. */ declare function validateEmptyByType(type: string, name: string, value: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate that a component does not contain injection characters. * Shared helper to eliminate boilerplate across per-type validators. * @throws {PurlInjectionError} When validation fails and throws is true. * The error includes the specific character code, component name, and * package type so callers can log, alert, or handle injection attempts * at an elevated level. */ declare function validateNoInjectionByType(type: string, component: string, value: string | undefined, throws: boolean): boolean; /** * Validate package name component. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateName(name: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate package namespace component. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateNamespace(namespace: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate qualifier key format and characters. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateQualifierKey(key: string, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate qualifiers object structure and keys. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateQualifiers(qualifiers: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate that component is present and not empty. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateRequired(name: string, value: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate that component is required for specific package type. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateRequiredByType(type: string, name: string, value: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate that value does not start with a number. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateStartsWithoutNumber(name: string, value: string, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate that value is a string type. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateStrings(name: string, value: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate subpath component. * Rejects command injection characters (|, ;, `, $, <, >, \) while allowing * characters that are legitimate in decoded subpaths (?, #, space, etc. which * get percent-encoded in the PURL string representation). * @throws {PurlInjectionError} When command injection characters found and options.throws is true. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateSubpath(subpath: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate package type component format and characters. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateType(type: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; /** * Validate package version component. * Rejects command injection characters (|, ;, `, $, <, >, \) while allowing * characters legitimate in version strings (!, +, -, ., _, ~, space, %, ?, #). * @throws {PurlInjectionError} When command injection characters found and options.throws is true. * @throws {PurlError} When validation fails and options.throws is true. */ declare function validateVersion(version: unknown, options?: { throws?: boolean | undefined; } | boolean | undefined): boolean; export { validateEmptyByType, validateName, validateNamespace, validateNoInjectionByType, validateQualifiers, validateQualifierKey, validateRequired, validateRequiredByType, validateStartsWithoutNumber, validateStrings, validateSubpath, validateType, validateVersion, };