import { ALPHANUMERIC, ALPHANUMERIC_LOWER, ALPHANUMERIC_UPPER, BASE64, BASE64URL, DIGITS, HEX_LOWER } from "./alphabets.ts"; import type { TokenPattern } from "./types.ts"; export { BUILTIN_PATTERNS, MIN_SEGMENT_LENGTH } from "./registry.ts"; export { scan } from "./scanner.ts"; export type { Alphabet, TokenPattern, TokenSpan, } from "./types.ts"; export { ALPHANUMERIC, ALPHANUMERIC_LOWER, ALPHANUMERIC_UPPER, BASE64, BASE64URL, DIGITS, HEX_LOWER, }; export interface TokenEncryptorOptions { types?: string[]; tweak?: Uint8Array; } export interface EncryptedSpan { /** Start position of the token in the original text. */ start: number; /** End position of the token in the original text. */ end: number; /** The full original token (prefix + body). */ original: string; /** The full encrypted token (prefix + encrypted body, or marker + body for heuristic). */ encrypted: string; /** Name of the pattern that matched (e.g., "github-pat", "sendgrid"). */ patternName: string; } export interface EncryptResult { /** The full encrypted text. */ text: string; /** One entry per token that was encrypted. */ spans: EncryptedSpan[]; } export declare class TokenEncryptor { private readonly key; private readonly cache; private readonly patterns; private destroyed; constructor(key: Uint8Array); private assertAlive; private getCipher; private makeTweak; private activePatterns; encrypt(text: string, options?: TokenEncryptorOptions): string; encryptWithSpans(text: string, options?: TokenEncryptorOptions): EncryptResult; decrypt(text: string, options?: TokenEncryptorOptions): string; private encryptSpan; private decryptSpan; private findHeuristicMarkerHits; register(pattern: TokenPattern): void; destroy(): void; }