@mptool/all 0.7.3 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.mts +9 -15
- package/lib/index.d.ts +9 -15
- package/lib/index.js +7 -7
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +7 -7
- package/lib/index.mjs.map +1 -1
- package/package.json +5 -5
package/lib/index.d.mts
CHANGED
|
@@ -1093,7 +1093,6 @@ interface CookieType {
|
|
|
1093
1093
|
sameSite?: boolean | "lax" | "strict" | "none" | undefined;
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
|
-
declare const getCookieScopeDomain: (domain?: string) => string[];
|
|
1097
1096
|
/**
|
|
1098
1097
|
* Cookie 类
|
|
1099
1098
|
*/
|
|
@@ -1131,18 +1130,19 @@ declare class Cookie {
|
|
|
1131
1130
|
* @see RFC 6265
|
|
1132
1131
|
*/
|
|
1133
1132
|
declare const normalizeDomain: (domain?: string) => string;
|
|
1133
|
+
declare const getDomain: (domainOrURL: string) => string;
|
|
1134
|
+
declare const getCookieScopeDomain: (domain?: string) => string[];
|
|
1134
1135
|
interface UrlInfo {
|
|
1135
1136
|
domain: string;
|
|
1136
1137
|
path: string;
|
|
1137
1138
|
}
|
|
1138
|
-
declare const getDomain: (domainOrURL: string) => string;
|
|
1139
1139
|
declare const parseUrl: (url: string) => UrlInfo;
|
|
1140
|
-
type
|
|
1140
|
+
type Url = string;
|
|
1141
|
+
type CookieOptions = Url | {
|
|
1141
1142
|
domain?: string;
|
|
1142
1143
|
path?: string;
|
|
1143
1144
|
};
|
|
1144
|
-
declare const
|
|
1145
|
-
declare const parseCookieHeader: (setCookieHeader: string, domain: string) => Cookie[];
|
|
1145
|
+
declare const getUrlInfo: (options: CookieOptions) => UrlInfo;
|
|
1146
1146
|
|
|
1147
1147
|
type CookieMap = Map<string, Cookie>;
|
|
1148
1148
|
type CookieStoreType = Map<string, CookieMap>;
|
|
@@ -1159,6 +1159,7 @@ interface SetCookieOptions {
|
|
|
1159
1159
|
* CookieStore 类
|
|
1160
1160
|
*/
|
|
1161
1161
|
declare class CookieStore {
|
|
1162
|
+
#private;
|
|
1162
1163
|
/** 存储键值 */
|
|
1163
1164
|
private key;
|
|
1164
1165
|
private store;
|
|
@@ -1234,7 +1235,7 @@ declare class CookieStore {
|
|
|
1234
1235
|
*
|
|
1235
1236
|
* @param domain 指定域名
|
|
1236
1237
|
*/
|
|
1237
|
-
clear(domain?: string): void;
|
|
1238
|
+
clear(domain?: string, exact?: boolean): void;
|
|
1238
1239
|
/**
|
|
1239
1240
|
* 应用 header cookies
|
|
1240
1241
|
*
|
|
@@ -1256,16 +1257,9 @@ declare class CookieStore {
|
|
|
1256
1257
|
* @return request cookie header
|
|
1257
1258
|
*/
|
|
1258
1259
|
getHeader(options: CookieOptions): string;
|
|
1259
|
-
/**
|
|
1260
|
-
* 从 Storage 读取 cookies
|
|
1261
|
-
*/
|
|
1262
|
-
private init;
|
|
1263
|
-
/**
|
|
1264
|
-
* 将 cookies 保存到 Storage
|
|
1265
|
-
*/
|
|
1266
|
-
private save;
|
|
1267
1260
|
}
|
|
1268
1261
|
|
|
1262
|
+
declare const parseCookieHeader: (setCookieHeader: string, domain: string) => Cookie[];
|
|
1269
1263
|
type HeadersInit = [string, string][] | Record<string, string> | Headers;
|
|
1270
1264
|
declare class Headers {
|
|
1271
1265
|
private headers;
|
|
@@ -1777,4 +1771,4 @@ declare const getRichTextNodes: (content: string | AnyNode[], { appendClass, tra
|
|
|
1777
1771
|
|
|
1778
1772
|
declare const getText: (content: string | AnyNode[]) => string;
|
|
1779
1773
|
|
|
1780
|
-
export { $App, $Component, $Config, $Page, ALLOWED_TAGS, type AllowTag, type AppConfigCommonOptions, type AppConfigOptions, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, type Config, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, type ElementNode, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendedPageLifeCycles, type ExtendedPageMethods, type ExtendedPageProperties, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type InferFromType, type InferPropType, type InferPropTypes, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropItem, type PropOption, type PropType, type Props, type PropsOptions, Queue, type RefMap, type RequestBody, type RequestError, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type RichTextNode, type RouteCustomConfig, type RoutePathConfig, type SetCookieOptions, type StorageData, type Task, type TextNode, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, appState, check, checkAsync, createRequest, decode as decodeBase64, dirname, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig,
|
|
1774
|
+
export { $App, $Component, $Config, $Page, ALLOWED_TAGS, type AllowTag, type AppConfigCommonOptions, type AppConfigOptions, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, type Config, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, type ElementNode, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendedPageLifeCycles, type ExtendedPageMethods, type ExtendedPageProperties, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type InferFromType, type InferPropType, type InferPropTypes, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropItem, type PropOption, type PropType, type Props, type PropsOptions, Queue, type RefMap, type RequestBody, type RequestError, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type RichTextNode, type RouteCustomConfig, type RoutePathConfig, type SetCookieOptions, type StorageData, type Task, type TextNode, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, appState, check, checkAsync, createRequest, decode as decodeBase64, dirname, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, handleProperties, isDir, isFile, isFunction, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, request, requestCookieStore, rm, saveFile, saveOnlineFile, set, setAsync, setRef, storage, take, type, unzip, wrapFunction, writeFile, writeJSON };
|
package/lib/index.d.ts
CHANGED
|
@@ -1093,7 +1093,6 @@ interface CookieType {
|
|
|
1093
1093
|
sameSite?: boolean | "lax" | "strict" | "none" | undefined;
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
|
-
declare const getCookieScopeDomain: (domain?: string) => string[];
|
|
1097
1096
|
/**
|
|
1098
1097
|
* Cookie 类
|
|
1099
1098
|
*/
|
|
@@ -1131,18 +1130,19 @@ declare class Cookie {
|
|
|
1131
1130
|
* @see RFC 6265
|
|
1132
1131
|
*/
|
|
1133
1132
|
declare const normalizeDomain: (domain?: string) => string;
|
|
1133
|
+
declare const getDomain: (domainOrURL: string) => string;
|
|
1134
|
+
declare const getCookieScopeDomain: (domain?: string) => string[];
|
|
1134
1135
|
interface UrlInfo {
|
|
1135
1136
|
domain: string;
|
|
1136
1137
|
path: string;
|
|
1137
1138
|
}
|
|
1138
|
-
declare const getDomain: (domainOrURL: string) => string;
|
|
1139
1139
|
declare const parseUrl: (url: string) => UrlInfo;
|
|
1140
|
-
type
|
|
1140
|
+
type Url = string;
|
|
1141
|
+
type CookieOptions = Url | {
|
|
1141
1142
|
domain?: string;
|
|
1142
1143
|
path?: string;
|
|
1143
1144
|
};
|
|
1144
|
-
declare const
|
|
1145
|
-
declare const parseCookieHeader: (setCookieHeader: string, domain: string) => Cookie[];
|
|
1145
|
+
declare const getUrlInfo: (options: CookieOptions) => UrlInfo;
|
|
1146
1146
|
|
|
1147
1147
|
type CookieMap = Map<string, Cookie>;
|
|
1148
1148
|
type CookieStoreType = Map<string, CookieMap>;
|
|
@@ -1159,6 +1159,7 @@ interface SetCookieOptions {
|
|
|
1159
1159
|
* CookieStore 类
|
|
1160
1160
|
*/
|
|
1161
1161
|
declare class CookieStore {
|
|
1162
|
+
#private;
|
|
1162
1163
|
/** 存储键值 */
|
|
1163
1164
|
private key;
|
|
1164
1165
|
private store;
|
|
@@ -1234,7 +1235,7 @@ declare class CookieStore {
|
|
|
1234
1235
|
*
|
|
1235
1236
|
* @param domain 指定域名
|
|
1236
1237
|
*/
|
|
1237
|
-
clear(domain?: string): void;
|
|
1238
|
+
clear(domain?: string, exact?: boolean): void;
|
|
1238
1239
|
/**
|
|
1239
1240
|
* 应用 header cookies
|
|
1240
1241
|
*
|
|
@@ -1256,16 +1257,9 @@ declare class CookieStore {
|
|
|
1256
1257
|
* @return request cookie header
|
|
1257
1258
|
*/
|
|
1258
1259
|
getHeader(options: CookieOptions): string;
|
|
1259
|
-
/**
|
|
1260
|
-
* 从 Storage 读取 cookies
|
|
1261
|
-
*/
|
|
1262
|
-
private init;
|
|
1263
|
-
/**
|
|
1264
|
-
* 将 cookies 保存到 Storage
|
|
1265
|
-
*/
|
|
1266
|
-
private save;
|
|
1267
1260
|
}
|
|
1268
1261
|
|
|
1262
|
+
declare const parseCookieHeader: (setCookieHeader: string, domain: string) => Cookie[];
|
|
1269
1263
|
type HeadersInit = [string, string][] | Record<string, string> | Headers;
|
|
1270
1264
|
declare class Headers {
|
|
1271
1265
|
private headers;
|
|
@@ -1777,4 +1771,4 @@ declare const getRichTextNodes: (content: string | AnyNode[], { appendClass, tra
|
|
|
1777
1771
|
|
|
1778
1772
|
declare const getText: (content: string | AnyNode[]) => string;
|
|
1779
1773
|
|
|
1780
|
-
export { $App, $Component, $Config, $Page, ALLOWED_TAGS, type AllowTag, type AppConfigCommonOptions, type AppConfigOptions, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, type Config, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, type ElementNode, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendedPageLifeCycles, type ExtendedPageMethods, type ExtendedPageProperties, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type InferFromType, type InferPropType, type InferPropTypes, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropItem, type PropOption, type PropType, type Props, type PropsOptions, Queue, type RefMap, type RequestBody, type RequestError, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type RichTextNode, type RouteCustomConfig, type RoutePathConfig, type SetCookieOptions, type StorageData, type Task, type TextNode, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, appState, check, checkAsync, createRequest, decode as decodeBase64, dirname, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig,
|
|
1774
|
+
export { $App, $Component, $Config, $Page, ALLOWED_TAGS, type AllowTag, type AppConfigCommonOptions, type AppConfigOptions, type AppConstructor, type AppInstance, type AppOptions, type ComponentConstructor, type ComponentInstance, type ComponentLifetimes, type ComponentOptions, type Config, Cookie, type CookieMap, type CookieOptions, CookieStore, type CookieStoreType, type CookieType, type ElementNode, Emitter, type EmitterInstance, type EventHandlerList, type EventHandlerMap, type EventType, type ExtendedAppMethods, type ExtendedComponentMethods, type ExtendedComponentProperty, type ExtendedPageLifeCycles, type ExtendedPageMethods, type ExtendedPageProperties, type ExtendsAppOptions, type Handler, Headers, type HeadersInit, type InferFromType, type InferPropType, type InferPropTypes, type PageConstructor, type PageInstance, type PageOptions, type PageQuery, type PageState, type PropItem, type PropOption, type PropType, type Props, type PropsOptions, Queue, type RefMap, type RequestBody, type RequestError, type RequestFactory, type RequestInitOptions, type RequestOptions, type RequestResponse, type RequestType, type RichTextNode, type RouteCustomConfig, type RoutePathConfig, type SetCookieOptions, type StorageData, type Task, type TextNode, type TrivialComponentInstance, type TrivialComponentOptions, type TrivialPageInstance, type TrivialPageOptions, URLSearchParams, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, appState, check, checkAsync, createRequest, decode as decodeBase64, dirname, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, handleProperties, isDir, isFile, isFunction, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, request, requestCookieStore, rm, saveFile, saveOnlineFile, set, setAsync, setRef, storage, take, type, unzip, wrapFunction, writeFile, writeJSON };
|