export declare class Guid { private static readonly patternV4; private static readonly emptyStr; private static readonly MAX_UINT_8; private contentStr?; private contentInt?; private readonly DASH; private readonly DASH_REGEXP; /** * Creates a new Guid object using a string, if no string is provided (or the string is not valid), * the Guid value will be initialized with all zeroes (empty Guid). * * @param str is the string to use to initialize the Guid object. If its not valid an empty GUID string will be used. */ constructor(str?: string); /** * Returns a new Guid object with an all zeroes internal value. * * @returns new Guid object with an internal value with all zeroes (an empty GUID, non valid). */ static empty(): Guid; /** * Returns a Guid object with a random valid UUID v4 value. * The method allows the use of a custom random value generator that implements the Crypto API. * The internal guid value is generated using the provided generator (if any), if not provided, it attempts * to generate random values from the Crypto API of the browser. If the browser does not support the Crypto API, * Math.random() is used as a fallback to generate random values. * * @param generator? - Custom random values generator that implements the Crypto API. * @returns A new Guid object with a valid random value generated by the provided generator or the defaults. */ static newGuid(generator?: Crypto): Guid; /** * Checks if a string represents a valid v4 GUID. * * @returns true if its a valid v4 GUID value represented as string. */ static isValid(str: string): boolean; /** * Checks if the current internal value is a valid v4 GUID. * * @returns true if its a valid v4 GUID value. */ isValid(): boolean; /** * Checks if the current internal value is empty (all zeroes value). * * @returns true if the object has an empty value. */ isEmpty(): boolean; /** * Checks if the current Guid object is equal to the provided one. * * @param otherGuid represents the Guid object to compare to this one. * @returns true if this object value is equal to the provided one. */ equals(otherGuid: Guid): boolean; /** * Returns the object value as string. * * @returns the string representing the Guid value. */ toString(): string; /** * Returns the object value as number. * * @returns the hex number representing the Guid value. */ toNumber(): number; /** * Attempts to get the number GUID value for the current object. * * @returns the hex number representing the Guid value or -1 if its value cannot be parsed. */ private getNumberFromGuidString; /** * Generates a string with a valid GUID v4 value from a custom Crypto object or the defaults. * * @param generator? is the custom generator of values to use to generate the value. * @returns a valid GUID v4 value as a string. */ private static generate; /** * Generates an Uint8Array with 16 random values generated using the crypto object provided or the defaults. * * @param generator is the Crypto implementation to use instead of the defaults. * @returns an Uint8Array with 16 random values. */ private static generateRandomBytes; /** * Generates an Uint8Array with 16 random values generated using the crypto object provided. * * @param crypto is the Crypto implementation to use to generate the random values to fill the array. * @returns an Uint8Array with 16 random values. */ private static getCryptoRandomBytes; /** * Generates an Uint8Array with 16 random values generated using the Math.random() method. * * @returns an Uint8Array with 16 random values. */ private static getRandomBytes; /** * Sets the bytes of an Uint8Array to match the RFC definition of v4 GUIDs. * * @param arr is the array to be modified. */ private static setSpecialBytesForV4Guid; /** * Returns the Crypto object that implements the Crypto API from the browser. * * @returns Crypto object from the browser implementation. */ private static getCryptoImplementation; }