import type { CustomOptions, CustomValidate } from "../custom/index.ts"; /** * @credits * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex. * [Valibot](https://github.com/fabian-hiller/valibot/blob/c3de9371c2cfa4e126734ddf0e2ab1de98e8a6ef/library/src/regex.ts#L166) */ export declare const GUID_REGEX: RegExp; export declare const EMPTY_GUID: string; /** * Determines whether the input is a GUID. * * @param input The value to check. * @param validate Additional validation to run against the input if it is a GUID. Default is `undefined`. * @returns `true` if the input is a GUID, `false` otherwise. */ export declare function isGuid(input: unknown, validate?: CustomValidate): input is string; export type GuidOptions = Omit, "typecheck">; /** * Verifies that the input is a GUID, and returns it. * If the input is not a GUID, the fallback value is returned. * * @param input The value to check. * @param fallback The value to return if the input is not a GUID. Default is `null`. * @returns The GUID value of the input, or the fallback if the input is not a GUID. * * @remarks * This function will clean the input by removing any surrounding quotes or braces. * * @example * ```ts * guid("bf9ae065-a590-41e5-ac53-386c65f565db", null); // "bf9ae065-a590-41e5-ac53-386c65f565db" * guid("{bf9ae065-a590-41e5-ac53-386c65f565db}", null); // "bf9ae065-a590-41e5-ac53-386c65f565db" * guid("\"bf9ae065-a590-41e5-ac53-386c65f565db\"", null); // "bf9ae065-a590-41e5-ac53-386c65f565db" * ``` */ export declare function guid(input: unknown, fallback: string, options?: GuidOptions): string; export declare function guid(input: unknown, fallback?: string | null | undefined, options?: GuidOptions): string | null;