import { C as AnyStringFractionalIndex, E as FractionalIndexBase, S as AnyFractionalIndex, T as FractionalIndex, _ as fraci, a as AnyStringFraci, b as AnyBinaryFractionalIndex, c as DEFAULT_MAX_RETRIES, d as FraciOptions, f as FraciOptionsBase, g as createFraciCache, h as StringFraciOptions, i as AnyFraci, l as Fraci, m as MAX_GENERATED_KEYS, n as FractionalIndexOf, o as BinaryFraciOptions, p as FraciOptionsBaseToBase, r as AnyBinaryFraci, s as DEFAULT_MAX_LENGTH, t as FraciOf, u as FraciCache, v as fraciBinary, w as AnyStringFractionalIndexBase, x as AnyBinaryFractionalIndexBase, y as fraciString } from "./types-CZ96tVYo.cjs"; //#region src/bases.d.ts /** Decimal */ declare const BASE10 = "0123456789"; /** Lowercase hex */ declare const BASE16L = "0123456789abcdef"; /** Uppercase hex */ declare const BASE16U = "0123456789ABCDEF"; /** Lowercase alphabets */ declare const BASE26L = "abcdefghijklmnopqrstuvwxyz"; /** Uppercase alphabets */ declare const BASE26U = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; /** Lowercase alphanumeric characters */ declare const BASE36L = "0123456789abcdefghijklmnopqrstuvwxyz"; /** Uppercase alphanumeric characters */ declare const BASE36U = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; /** Alphabets */ declare const BASE52 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; /** Alphanumeric characters */ declare const BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; /** Characters used in Base64 URL */ declare const BASE64URL = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"; /** HTML safe chars */ declare const BASE88 = "!#$%()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"; /** All ASCII (excluding control chars and newlines) */ declare const BASE95 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; //#endregion //#region src/lib/errors.d.ts /** * Error codes for the Fraci library. * * These codes help identify specific error conditions that may occur during library operations. * * - `INITIALIZATION_FAILED`: Indicates that the library failed to initialize. * Currently seen when the base string does not meet the requirements, or when the specified model or field does not exist in the generated Prisma client. * - `INTERNAL_ERROR`: Indicates an internal error in the library. Please file an issue if you see this. * - `INVALID_ARGUMENT`: Indicates that a numeric option or generation argument is outside its supported range. * - `INVALID_FRACTIONAL_INDEX`: Indicates that an invalid fractional index was provided to `generateKeyBetween` or `generateNKeysBetween` functions. * - `MAX_LENGTH_EXCEEDED`: Indicates that the maximum length of the generated key was exceeded. * - `MAX_RETRIES_EXCEEDED`: Indicates that the maximum number of retries was exceeded when generating a key. * * @see {@link FraciError} - The custom error class for the Fraci library */ type FraciErrorCode = "INITIALIZATION_FAILED" | "INTERNAL_ERROR" | "INVALID_ARGUMENT" | "INVALID_FRACTIONAL_INDEX" | "MAX_LENGTH_EXCEEDED" | "MAX_RETRIES_EXCEEDED"; /** * Custom error class for the Fraci library. * * This class encapsulates errors that occur during fractional indexing operations, * providing structured error information through error codes and descriptive messages. * Use the utility functions {@link isFraciError} and {@link getFraciErrorCode} to safely work with these errors. * * @see {@link FraciErrorCode} - The error codes for the Fraci library * @see {@link isFraciError} - Type guard to check if an error is a FraciError * @see {@link getFraciErrorCode} - Function to extract the error code from a FraciError */ declare class FraciError extends Error { /** * The specific error code identifying the type of error. */ readonly code: FraciErrorCode; /** * A descriptive message providing details about the error condition. */ readonly message: string; readonly name: "FraciError"; constructor( /** * The specific error code identifying the type of error. */ code: FraciErrorCode, /** * A descriptive message providing details about the error condition. */ message: string); } /** * Type guard that checks if the given error is an instance of {@link FraciError}. * * This is useful in error handling blocks to determine if an error originated from the Fraci library. * * @param error - The error to check * @returns `true` if the error is a {@link FraciError}, `false` otherwise * * @example * ```typescript * try { * // Some Fraci operation * } catch (error) { * if (isFraciError(error)) { * // Handle Fraci-specific error * } else { * // Handle other types of errors * } * } * ``` * * @see {@link FraciError} - The custom error class for the Fraci library * @see {@link getFraciErrorCode} - Function to extract the error code from a {@link FraciError} */ declare function isFraciError(error: unknown): error is FraciError; /** * Extracts the error code from a {@link FraciError}. * * This function safely extracts the error code without requiring type checking first. * If the error is not a {@link FraciError}, it returns `undefined`. * * @param error - The error to extract the code from * @returns The {@link FraciErrorCode} if the error is a {@link FraciError}, `undefined` otherwise * * @example * ```typescript * try { * // Some Fraci operation * } catch (error) { * switch (getFraciErrorCode(error)) { * case "MAX_LENGTH_EXCEEDED": * case "MAX_RETRIES_EXCEEDED": * // Handle specific error case * break; * * default: * // Handle other cases, including unknown errors * // or Fraci errors that are not handled above * break; * } * } * ``` * * @see {@link FraciError} - The custom error class for the Fraci library * @see {@link FraciErrorCode} - The error codes for the Fraci library * @see {@link isFraciError} - Type guard to check if an error is a {@link FraciError} */ declare function getFraciErrorCode(error: unknown): FraciErrorCode | undefined; //#endregion export { AnyBinaryFraci, type AnyBinaryFractionalIndex, type AnyBinaryFractionalIndexBase, AnyFraci, type AnyFractionalIndex, AnyStringFraci, type AnyStringFractionalIndex, type AnyStringFractionalIndexBase, BASE10, BASE16L, BASE16U, BASE26L, BASE26U, BASE36L, BASE36U, BASE52, BASE62, BASE64URL, BASE88, BASE95, BinaryFraciOptions, DEFAULT_MAX_LENGTH, DEFAULT_MAX_RETRIES, Fraci, FraciCache, FraciError, FraciErrorCode, type FraciOf, FraciOptions, FraciOptionsBase, FraciOptionsBaseToBase, type FractionalIndex, type FractionalIndexBase, type FractionalIndexOf, MAX_GENERATED_KEYS, StringFraciOptions, createFraciCache, fraci, fraciBinary, fraciString, getFraciErrorCode, isFraciError }; //# sourceMappingURL=index.d.cts.map