/// export type OrgIdOptions = { /** * - When false create a new orgId if the id property is undefined. * - When true throw error id property is undefined * @defaults false */ checkUndefined: boolean; }; export declare class OrgId { #private; /** * Generates or accepts an OrgId string of 9 digit chars * @param id string of 9 digit chars optional if not passed will generate a new one * @param options object with options * @param options.checkUndefined if true will throw error if id is undefined * @defaults options: { checkUndefined: false } * @throws Will throw an error if the id is not 9 digit chars or contains non-numeric chars * @example * let orgId = new OrgId('728382478') * console.log(orgId.toString()) // '728382478' * console.log(orgId.toLongString()) // 'org_id_728382478' * * let newOrgId = new OrgId() * console.log(newOrgId.toString()) // '123456789' (randomly generated) * console.log(newOrgId.toLongString()) // 'org_id_123456789' */ constructor(id?: string, options?: OrgIdOptions); [Symbol.toPrimitive](hint: string): string; /** * return the id prefix with the string org_id_ * @returns 16 char length string * @example 1. orgId().toLongString() => 'org_id_YRTP34GS1' * @example 2. new OrgId('TWUWHW3H7').toLongString() => 'org_id_TWUWHW3H7' * @deprecated use instead orgId().name */ toLongString(): string; /** * return the generated or given id. here it will make the id uppercase. * @returns 9 char length string */ toString(): string; /** * Convert and return the active id as a hex string * @returns hex string of the active id */ toHexString(): string; /** * convert the active id in a Buffer and return the buffer * @return Buffer */ get id(): Buffer; /** * return the id prefix with the string org_id_ * @returns 16 char length string * @example orgId().toLongString() => 'org_id_MGGQFQLV9' */ get name(): string; /** * with the active id get the timestamp for when it was created * @returns Date */ getTimeStamp(): Date; /** * This is the string of the active id * @returns 9 char length string */ valueOf(): string; /** * With an active object compare a string to see if equal * @param value accepts a string that you will like to check with the active id for equality * @returns boolean */ isEqual(value: string | OrgId): boolean; } export declare const orgId: (id?: string, options?: OrgIdOptions) => OrgId; //# sourceMappingURL=OrgId.d.ts.map