declare const otpDigitLength: readonly [6, 8, 10]; type OtpSecret = string | Buffer; type OtpType = "hotp" | "totp"; type OtpHashAlgorithm = "sha1" | "sha256" | "sha512"; type OtpSecretStringEncoding = "base32" | BufferEncoding; type OtpDigitLength = (typeof otpDigitLength)[number]; interface TotpOptions { addChecksum?: boolean; algorithm?: OtpHashAlgorithm; digits?: OtpDigitLength; interval?: number; secretEncoding?: OtpSecretStringEncoding; t0?: number; time?: number; truncationOffset?: number; } interface TotpBufferSecretOptions extends Omit {} interface TotpStringSecretOptions extends TotpOptions {} interface TotpSpecificOptions extends Omit {} interface TotpSpecificBufferSecretOptions extends Omit {} interface TotpSpecificStringSecretOptions extends TotpSpecificOptions {} declare function generateTotp(secret: Buffer, options?: TotpBufferSecretOptions): string; declare function generateTotp(secret: string, options?: TotpStringSecretOptions): string; declare function generateTotp(secret: OtpSecret, options?: TotpOptions): string; declare function generateTotpSha1(secret: Buffer, options?: TotpSpecificBufferSecretOptions): string; declare function generateTotpSha1(secret: string, options?: TotpSpecificStringSecretOptions): string; declare function generateTotpSha256(secret: Buffer, options?: TotpSpecificBufferSecretOptions): string; declare function generateTotpSha256(secret: string, options?: TotpSpecificStringSecretOptions): string; declare function generateTotpSha512(secret: Buffer, options?: TotpSpecificBufferSecretOptions): string; declare function generateTotpSha512(secret: string, options?: TotpSpecificStringSecretOptions): string; interface HotpOptions { addChecksum?: boolean; algorithm?: OtpHashAlgorithm; digits?: OtpDigitLength; secretEncoding?: OtpSecretStringEncoding; truncationOffset?: number; } interface HotpBufferSecretOptions extends Omit {} interface HotpStringSecretOptions extends HotpOptions {} interface HotpSpecificOptions extends Omit {} interface HotpSpecificBufferSecretOptions extends Omit {} interface HotpSpecificStringSecretOptions extends HotpSpecificOptions {} declare function generateHotp(secret: Buffer, counter: number, options?: HotpBufferSecretOptions): string; declare function generateHotp(secret: string, counter: number, options?: HotpStringSecretOptions): string; declare function generateHotp(secret: OtpSecret, counter: number, options?: HotpOptions): string; declare function generateHotpSha1(secret: Buffer, counter: number, options?: HotpSpecificBufferSecretOptions): string; declare function generateHotpSha1(secret: string, counter: number, options?: HotpSpecificStringSecretOptions): string; declare function generateHotpSha256(secret: Buffer, counter: number, options?: HotpSpecificBufferSecretOptions): string; declare function generateHotpSha256(secret: string, counter: number, options?: HotpSpecificStringSecretOptions): string; declare function generateHotpSha512(secret: Buffer, counter: number, options?: HotpSpecificBufferSecretOptions): string; declare function generateHotpSha512(secret: string, counter: number, options?: HotpSpecificStringSecretOptions): string; interface OtpUriOptions { algorithm: OtpHashAlgorithm; digits: OtpDigitLength; counter: number; period: number; } interface HotpUriOptions extends Partial> {} interface TotpUriOptions extends Partial> {} declare function generateOtpUri(type: "hotp", issuer: string, subject: string, secret: string, options?: HotpUriOptions): string; declare function generateOtpUri(type: "totp", issuer: string, subject: string, secret: string, options?: TotpUriOptions): string; declare function generateOtpUri(type: OtpType, issuer: string, subject: string, secret: string, options?: HotpUriOptions | TotpUriOptions): string; declare function generateHotpUri(issuer: string, subject: string, secret: string, options?: HotpUriOptions): string; declare function generateTotpUri(issuer: string, subject: string, secret: string, options?: TotpUriOptions): string; export { generateTotpUri, generateTotpSha512, generateTotpSha256, generateTotpSha1, generateTotp, generateOtpUri, generateHotpUri, generateHotpSha512, generateHotpSha256, generateHotpSha1, generateHotp };