@tarojs/plugin-http
Version:
Taro 小程序端支持使用 web 请求 的插件
48 lines (47 loc) • 1.02 kB
TypeScript
export declare class Cookie {
#private;
constructor();
static parse(cookieStr: string): {
key: string;
value: string;
path: string | null;
domain: string | null;
expires: number | null;
maxAge: number | null;
secure: boolean;
httpOnly: boolean;
} | null;
/**
* 判断 domain
*/
$_checkDomain(host: any, cookieDomain: any): boolean;
/**
* 判断 path
*/
$_checkPath(path: any, cookiePath: any): boolean;
/**
* 判断过期
*/
$_checkExpires(cookie: any): boolean;
/**
* 设置 cookie
*/
setCookie(cookie: any, url: any): void;
/**
* 拉取 cookie
*/
getCookie(url: string, includeHttpOnly?: boolean): string;
/**
* 序列化
*/
serialize(): string;
/**
* 反序列化
*/
deserialize(str: any): void;
}
/**
* 创建 cookie 实例并反序列化
* @returns
*/
export declare function createCookieInstance(): Cookie;