declare interface CookieOptions {
    domain?: string;
    path?: string;
    expires?: Date | string | number;
    "max-age"?: number;
    secure?: boolean;
    samesite?: string;
    partitioned?: boolean;
}

declare interface Cookies<T = string> {
    [key: string]: T;
}

declare type Decoder<T> = (value: string) => T;

declare type Encoder<T> = (value: T) => string;

declare function get<T = string>(key: string, decoder?: Decoder<T> | null): T | null;
export { get }
export { get as getCookie }

declare function getAll<T = string>(decoder?: Decoder<T> | null): Cookies<T>;
export { getAll }
export { getAll as getAllCookies }

declare function getRaw(key: string): string | null;
export { getRaw }
export { getRaw as getRawCookie }

declare function isEnabled(): boolean;
export { isEnabled as isCookieEnabled }
export { isEnabled }

declare function remove(key: string, options?: CookieOptions): void;
export { remove }
export { remove as removeCookie }

declare function set(key: string, value: any, options?: CookieOptions): void;

declare function set<T = string>(key: string, value: any, encoder: Encoder<T> | null, options?: CookieOptions): void;
export { set }
export { set as setCookie }

declare function setRaw(key: string, value: string, options?: CookieOptions): void;
export { setRaw }
export { setRaw as setRawCookie }

export { }
