@technobuddha/library
Version:
A large library of useful functions
42 lines (41 loc) • 970 B
TypeScript
/**
* Initialize the cookie system with the browsers cookies
* Parse a string containing cookies for use by other cookie method
*
* @param input string to be decoded
*/
export declare function init(input?: string): void;
/**
* Get the value of a cookie
*
* @param name name of a cookie
*/
export declare function get(name: string): string | undefined;
/**
* Get the names of all cookies
*
* @returns array of cookie names
*/
export declare function names(): string[];
/**
* Add or update a cookie
*
* @param name name of the cookie
* @param value value of the cookie
* @param expires Expiration date
*/
export declare function add(name: string, value: string, expires?: string | Date): void;
/**
* Delete a cookie
*
* @param name
*/
export declare function del(name: string): void;
declare const _default: {
init: typeof init;
get: typeof get;
names: typeof names;
add: typeof add;
del: typeof del;
};
export default _default;