Installation
npm install --save @types/cookie_js
Summary
This package contains type definitions for cookie_js (https://github.com/florian/cookie.js).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie_js.
declare module "cookie_js" {
export = cookie;
}
declare module "cookiejs" {
export = cookie;
}
declare function cookie(key: string, fallback?: string): string;
declare function cookie(keys: string[], fallback?: string): string;
interface UtilStatic {
isArray: (value: any) => boolean;
isObject: (value: any) => boolean;
toArray: (...args: any[]) => any[];
getKeys: (value: {}) => any[];
encode: (value: string) => string;
decode: (value: string) => string;
retrieve: (x: string, y: string) => string;
}
interface Options {
expires: number | string | Date;
domain: string;
path: string;
secure: boolean;
}
declare namespace cookie {
export function set(key: string, value: string, options?: any): void;
export function set(obj: any, options?: any): void;
export function remove(key: string): void;
export function remove(keys: string[]): void;
export function remove(...args: string[]): void;
export function removeSpecific(key: string, options?: any): void;
export function removeSpecific(keys: string[], options?: any): void;
export function empty(): void;
export function get(key: string, fallback?: string): string;
export function get(keys: string[], fallback?: string): any;
export function all(): any;
export function enabled(): boolean;
export var utils: UtilStatic;
export var defaults: Options;
}
Additional Details
- Last updated: Mon, 06 Nov 2023 22:41:05 GMT
- Dependencies: none
Credits
These definitions were written by slawiko.