@mptool/all 0.10.1 → 0.10.3

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 CHANGED
@@ -35,7 +35,7 @@ declare const savePhoto: (imgPath: string) => Promise<void>;
35
35
  * @param path 下载路径
36
36
  * @param mask 遮罩层
37
37
  */
38
- declare const downLoad: (url: string, mask?: boolean) => Promise<string>;
38
+ declare const download: (url: string, mask?: boolean) => Promise<string>;
39
39
 
40
40
  /** 网络状态汇报 */
41
41
  declare const reportNetworkStatus: () => void;
@@ -90,9 +90,10 @@ declare const updateApp: (onUpdateReady: (applyUpdate: () => void) => Promise<vo
90
90
  declare const encode: (arraybuffer: ArrayBuffer) => string;
91
91
  declare const decode: (base64: string) => ArrayBuffer;
92
92
 
93
- declare const isQQ: boolean;
94
- declare const isWx: boolean;
95
- declare const isMp: boolean;
93
+ /** 运行环境 */
94
+ type Env = "wx" | "qq" | "donut" | "js";
95
+ /** 运行环境 */
96
+ declare const env: Env;
96
97
 
97
98
  type EventType = string | symbol;
98
99
  type Handler<T = unknown> = (event: T) => void | Promise<void>;
@@ -1884,4 +1885,4 @@ declare const getRichTextNodes: (content: string | AnyNode[], { appendClass, tra
1884
1885
 
1885
1886
  declare const getText: (content: string | AnyNode[]) => string;
1886
1887
 
1887
- 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, MpError$1 as MpError, type MpErrorOptions$1 as MpErrorOptions, 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 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 UpdateInfo, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, addContact, appState, check, checkAsync, compareVersion, confirm, createRequest, decode as decodeBase64, dirname, downLoad, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getCurrentPage, getCurrentRoute, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, getWindowInfo, handleProperties, isDir, isFile, isFunction, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
1888
+ 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 Env, 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, MpError$1 as MpError, type MpErrorOptions$1 as MpErrorOptions, 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 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 UpdateInfo, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, addContact, appState, check, checkAsync, compareVersion, confirm, createRequest, decode as decodeBase64, dirname, download, userEmitter as emitter, encode as encodeBase64, env, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getCurrentPage, getCurrentRoute, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, getWindowInfo, handleProperties, isDir, isFile, isFunction, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
package/lib/index.d.ts CHANGED
@@ -35,7 +35,7 @@ declare const savePhoto: (imgPath: string) => Promise<void>;
35
35
  * @param path 下载路径
36
36
  * @param mask 遮罩层
37
37
  */
38
- declare const downLoad: (url: string, mask?: boolean) => Promise<string>;
38
+ declare const download: (url: string, mask?: boolean) => Promise<string>;
39
39
 
40
40
  /** 网络状态汇报 */
41
41
  declare const reportNetworkStatus: () => void;
@@ -90,9 +90,10 @@ declare const updateApp: (onUpdateReady: (applyUpdate: () => void) => Promise<vo
90
90
  declare const encode: (arraybuffer: ArrayBuffer) => string;
91
91
  declare const decode: (base64: string) => ArrayBuffer;
92
92
 
93
- declare const isQQ: boolean;
94
- declare const isWx: boolean;
95
- declare const isMp: boolean;
93
+ /** 运行环境 */
94
+ type Env = "wx" | "qq" | "donut" | "js";
95
+ /** 运行环境 */
96
+ declare const env: Env;
96
97
 
97
98
  type EventType = string | symbol;
98
99
  type Handler<T = unknown> = (event: T) => void | Promise<void>;
@@ -1884,4 +1885,4 @@ declare const getRichTextNodes: (content: string | AnyNode[], { appendClass, tra
1884
1885
 
1885
1886
  declare const getText: (content: string | AnyNode[]) => string;
1886
1887
 
1887
- 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, MpError$1 as MpError, type MpErrorOptions$1 as MpErrorOptions, 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 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 UpdateInfo, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, addContact, appState, check, checkAsync, compareVersion, confirm, createRequest, decode as decodeBase64, dirname, downLoad, userEmitter as emitter, encode as encodeBase64, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getCurrentPage, getCurrentRoute, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, getWindowInfo, handleProperties, isDir, isFile, isFunction, isMp, isQQ, isWx, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
1888
+ 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 Env, 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, MpError$1 as MpError, type MpErrorOptions$1 as MpErrorOptions, 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 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 UpdateInfo, type UrlInfo, type WildCardEventHandlerList, type WildcardHandler, addContact, appState, check, checkAsync, compareVersion, confirm, createRequest, decode as decodeBase64, dirname, download, userEmitter as emitter, encode as encodeBase64, env, exists, funcQueue, get, getAsync, getConfig, getCookieScopeDomain, getCurrentPage, getCurrentRoute, getDomain, getRef, getRichTextNodes, getText, getUrlInfo, getWindowInfo, handleProperties, isDir, isFile, isFunction, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, readFile, readJSON, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };