@zuiwoxing/posisi
Version:
一款基于typescript 前端控制组件,包括(IOC,AOP,Feign,Logger,Util等)
51 lines (50 loc) • 1.12 kB
TypeScript
/**
*@desc cookie工具
*@author liudejian
*@date 2020-03-26 17:28
**/
import { CookieAttributes } from 'js-cookie';
/**
* cookie工具
*/
export default class CookieUtil {
/**
* 默认cookie配置
*/
static defaultCookieConfig(): CookieAttributes;
/**
* 设置cookie
* @param key
* @param value
* @param options
*/
static setCookie(key: string, value: string, options: CookieAttributes): string | undefined;
/**
* 设置cookie
* @param key
* @param value
*/
static setDefaultCookie(key: string, value: string): string | undefined;
/**
* 设置对象cookie
* @param key
* @param value
* @param options
*/
static setObjCookie(key: string, value: any, options: CookieAttributes): string | undefined;
/**
* 获取cookie
* @param key
*/
static getObjCookie<T>(key: string): T;
/**
* 获取cookie
* @param key
*/
static getCookie(key: string): string | undefined;
/**
* 删除cookie
* @param key
*/
static removeCookie(key: string): void;
}