/** * Error thrown if an Alphabet receives less characters than needed * * @class InvalidInputError * @extends {Error} */ declare class InvalidInputError$1 extends Error { /** * Creates an instance of InvalidInputError * * @memberof InvalidInputError */ constructor(source: unknown); } /** * Error thrown if an Alphabet receives duplicate characters * * @class DuplicateCharacterError * @extends {Error} */ declare class DuplicateCharacterError$1 extends Error { /** * Creates an instance of DuplicateCharacterError * * @param {object} [meta={source, duplicate}] * @memberof DuplicateCharacterError */ constructor(source: string, duplicate: string); } declare const InvalidInputError: typeof InvalidInputError$1; declare const DuplicateCharacterError: typeof DuplicateCharacterError$1; /** * Immutable alphabet * * @class Alphabet */ declare class Alphabet { constructor(source?: string); /** * Obtain the configured characters * * @readonly * @memberof Alphabet */ get characters(): string; /** * Get the number of bytes of the alphabet * * @readonly * @memberof Alphabet */ get byteLength(): number; /** * Get the character length of the alphabet * * @readonly * @memberof Alphabet */ get length(): number; /** * Extract part of the alphabet and return it as a (singleton) instance of alphabet * * @param {number} start * @param {number} end * @returns {Alphabet} instance * @memberof Alphabet */ slice(start: number, end: number): Alphabet; /** * Get the character at given index * * @param {number} index * @returns {string} char * @memberof Alphabet */ charAt(index: number): string; /** * Get the character code at given index * * @param {numer} index * @returns {number} charcode * @memberof Alphabet */ charCodeAt(index: number): number | undefined; /** * Get the code point at given index * * @param {numer} index * @returns {number} codepoint * @memberof Alphabet */ codePointAt(index: number): number | undefined; /** * Get the index of the given character * * @param {string} char * @returns {number} index * @memberof Alphabet */ indexOf(char: string): number; /** * Map any amount of indices to the corresponding characters (wrapping the * indices around if they exceed the length of the alphabet) * * @param {number} ...list * @returns {string} [char] * @memberof Alphabet */ map(...list: Array): Array; /** * Convert the Alphabet into a string * * @returns {string} chars * @memberof Alphabet */ toString(): string; /** * Ensure the Alphabet is properly JSON-stringified * * @returns * @memberof Alphabet */ toJSON(): string; /** * Obtain a singleton instance of Alphabet representing the provided characters * * @static * @param {*} characters * @returns * @memberof Alphabet */ static from(characters: string): Alphabet; } export { Alphabet, DuplicateCharacterError, InvalidInputError };