svelte-kit-cookie-session-patch
Version:
⚒️ Encrypted 'stateless' cookie sessions for SvelteKit
26 lines (25 loc) • 890 B
TypeScript
/// <reference types="node" />
import type { CipherGCMTypes, BinaryLike as CBinaryLike } from "crypto";
declare type DriveKeyOptions = {
keyLength: number;
saltLength?: number;
iterations?: number;
digest?: "sha256" | "sha512";
};
export declare type DecrypterOptions = Partial<Omit<DriveKeyOptions, "KeyLength">> & {
algorithm: CipherGCMTypes;
inputEncoding?: "base64" | "hex";
stringEncoding?: "utf8" | "ascii";
ivLength?: number;
authTagLength?: number;
};
export declare type EncrypterOptions = Partial<Omit<DriveKeyOptions, "KeyLength">> & {
algorithm: CipherGCMTypes;
outputEncoding?: "base64" | "hex";
stringEncoding?: "utf8" | "ascii";
ivLength?: number;
authTagLength?: number;
};
export declare type BinaryLike = CBinaryLike;
export declare type EncryptionFunction<T> = (text: string, password: BinaryLike) => T;
export {};