export interface CookieAttributes { path?: string; domain?: string; expires?: number | Date; sameSite?: 'strict' | 'Strict' | 'lax' | 'Lax' | 'none' | 'None'; secure?: boolean; [property: string]: any; } export type CookieAttributesConfig = Readonly; export type Decoder = (value: string, name?: string) => T; export type Encoder = (value: T, name?: string) => string; export interface CookieDecoding { readonly decodeName?: Decoder; readonly decodeValue?: Decoder; } export interface CookieEncoding { readonly encodeName?: Encoder; readonly encodeValue?: Encoder; } export interface CookieCodecConfig { readonly decodeName: Decoder; readonly decodeValue: Decoder; readonly encodeName: Encoder; readonly encodeValue: Encoder; } export interface CookieConverter { read: Decoder; write: Encoder; } export type CookieConverterConfig = Readonly>; interface CookiesConfig { readonly converter: CookieConverterConfig; readonly attributes: CookieAttributesConfig; } interface CookiesApi { set: (name: string, value: W, attributes?: CookieAttributes) => string | undefined; get: (name?: string | undefined | null) => R | undefined | { [property: string]: R; }; remove: (name: string, attributes?: CookieAttributes) => void; withAttributes: (attributes: CookieAttributes) => Cookies; withConverter: (converter: { write?: Encoder; read?: Decoder; }) => Cookies; } export type Cookies = CookiesConfig & CookiesApi; export {};