@mptool/all 0.10.14 → 0.11.0

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/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as cheerio_slim from 'cheerio/slim';
2
+
1
3
  declare const writeClipboard: (data?: string) => Promise<void>;
2
4
 
3
5
  /**
@@ -150,7 +152,13 @@ declare const logger_filter: typeof filter;
150
152
  declare const logger_info: typeof info;
151
153
  declare const logger_warn: typeof warn;
152
154
  declare namespace logger {
153
- export { logger_debug as debug, logger_error as error, logger_filter as filter, logger_info as info, logger_warn as warn };
155
+ export {
156
+ logger_debug as debug,
157
+ logger_error as error,
158
+ logger_filter as filter,
159
+ logger_info as info,
160
+ logger_warn as warn,
161
+ };
154
162
  }
155
163
 
156
164
  /**
@@ -187,7 +195,11 @@ declare const query_join: typeof join;
187
195
  declare const query_parse: typeof parse;
188
196
  declare const query_stringify: typeof stringify;
189
197
  declare namespace query {
190
- export { query_join as join, query_parse as parse, query_stringify as stringify };
198
+ export {
199
+ query_join as join,
200
+ query_parse as parse,
201
+ query_stringify as stringify,
202
+ };
191
203
  }
192
204
 
193
205
  /**
@@ -991,7 +1003,7 @@ declare const $Config: (config: AppConfigOptions) => void;
991
1003
  declare const getConfig: () => Config;
992
1004
 
993
1005
  /** 文件编码 */
994
- type FileEncoding = "utf-8" | "ascii" | "base64" | "binary" | "hex" | "ucs2" | "ucs-2" | "utf16le" | "utf-16le" | "utf8" | "latin1";
1006
+ type FileEncoding = "ascii" | "base64" | "binary" | "hex" | "latin1" | "ucs2" | "ucs-2" | "utf8" | "utf-8" | "utf16le" | "utf-16le";
995
1007
  declare const dirname: (path: string) => string;
996
1008
  /** 判断文件或文件夹是否存在 */
997
1009
  declare const exists: (path: string) => boolean;
@@ -1639,8 +1651,10 @@ interface RequestFactory {
1639
1651
  declare const createRequest: ({ cookieStore, server, requestHandler, responseHandler, errorHandler, ...defaultOptions }?: RequestInitOptions) => RequestFactory;
1640
1652
 
1641
1653
  type AllowTag = "a" | "abbr" | "address" | "article" | "aside" | "b" | "bdi" | "bdo" | "blockquote" | "br" | "caption" | "cite" | "code" | "col" | "colgroup" | "dd" | "del" | "div" | "dl" | "dt" | "em" | "fieldset" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hr" | "i" | "img" | "ins" | "label" | "legend" | "li" | "mark" | "nav" | "ol" | "p" | "pre" | "q" | "rt" | "ruby" | "s" | "section" | "small" | "span" | "strong" | "sub" | "sup" | "table" | "tbody" | "td" | "tfoot" | "th" | "thead" | "tr" | "tt" | "u" | "ul";
1654
+ type DeprecatedTag = "big" | "center" | "font";
1655
+ type ConvertedTag = "html" | "body" | "svg";
1642
1656
  declare const ALLOWED_TAGS: [
1643
- tag: AllowTag | "big" | "center" | "font",
1657
+ tag: AllowTag | DeprecatedTag | ConvertedTag,
1644
1658
  allowedAttrs?: string[]
1645
1659
  ][];
1646
1660
 
@@ -1867,6 +1881,7 @@ declare class Element extends NodeWithChildren {
1867
1881
  "x-attribsPrefix"?: Record<string, string>;
1868
1882
  }
1869
1883
 
1884
+ declare const $: cheerio_slim.CheerioAPI;
1870
1885
  declare const parseHTML: (content: string) => AnyNode[];
1871
1886
 
1872
1887
  interface ElementNode {
@@ -1897,6 +1912,10 @@ interface ParserOptions {
1897
1912
 
1898
1913
  declare const getRichTextNodes: (content: string | AnyNode[], { appendClass, transform }?: ParserOptions) => Promise<RichTextNode[]>;
1899
1914
 
1915
+ /** SVG 转换 */
1916
+ declare const convertSVGToDataURI: (content: string) => string;
1917
+
1900
1918
  declare const getText: (content: string | AnyNode[]) => string;
1901
1919
 
1902
- 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, go, handleProperties, isDir, isFile, isFunction, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, reLaunch, readFile, readJSON, redirect, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, switchTab, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
1920
+ export { $, $App, $Component, $Config, $Page, ALLOWED_TAGS, Cookie, CookieStore, Emitter, Headers, MpError$1 as MpError, Queue, URLSearchParams, addContact, appState, check, checkAsync, compareVersion, confirm, convertSVGToDataURI, 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, go, handleProperties, isDir, isFile, isFunction, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, reLaunch, readFile, readJSON, redirect, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, switchTab, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
1921
+ export type { AllowTag, AppConfigCommonOptions, AppConfigOptions, AppConstructor, AppInstance, AppOptions, ComponentConstructor, ComponentInstance, ComponentLifetimes, ComponentOptions, Config, ConvertedTag, CookieMap, CookieOptions, CookieStoreType, CookieType, DeprecatedTag, ElementNode, EmitterInstance, Env, EventHandlerList, EventHandlerMap, EventType, ExtendedAppMethods, ExtendedComponentMethods, ExtendedComponentProperty, ExtendedPageLifeCycles, ExtendedPageMethods, ExtendedPageProperties, ExtendsAppOptions, Handler, HeadersInit, InferFromType, InferPropType, InferPropTypes, MpErrorOptions$1 as MpErrorOptions, PageConstructor, PageInstance, PageOptions, PageQuery, PageState, PropItem, PropOption, PropType, Props, PropsOptions, RefMap, RequestBody, RequestFactory, RequestInitOptions, RequestOptions, RequestResponse, RequestType, RichTextNode, RouteCustomConfig, RoutePathConfig, SetCookieOptions, StorageData, Task, TextNode, TrivialComponentInstance, TrivialComponentOptions, TrivialPageInstance, TrivialPageOptions, UpdateInfo, UrlInfo, WildCardEventHandlerList, WildcardHandler };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as cheerio_slim from 'cheerio/slim';
2
+
1
3
  declare const writeClipboard: (data?: string) => Promise<void>;
2
4
 
3
5
  /**
@@ -150,7 +152,13 @@ declare const logger_filter: typeof filter;
150
152
  declare const logger_info: typeof info;
151
153
  declare const logger_warn: typeof warn;
152
154
  declare namespace logger {
153
- export { logger_debug as debug, logger_error as error, logger_filter as filter, logger_info as info, logger_warn as warn };
155
+ export {
156
+ logger_debug as debug,
157
+ logger_error as error,
158
+ logger_filter as filter,
159
+ logger_info as info,
160
+ logger_warn as warn,
161
+ };
154
162
  }
155
163
 
156
164
  /**
@@ -187,7 +195,11 @@ declare const query_join: typeof join;
187
195
  declare const query_parse: typeof parse;
188
196
  declare const query_stringify: typeof stringify;
189
197
  declare namespace query {
190
- export { query_join as join, query_parse as parse, query_stringify as stringify };
198
+ export {
199
+ query_join as join,
200
+ query_parse as parse,
201
+ query_stringify as stringify,
202
+ };
191
203
  }
192
204
 
193
205
  /**
@@ -991,7 +1003,7 @@ declare const $Config: (config: AppConfigOptions) => void;
991
1003
  declare const getConfig: () => Config;
992
1004
 
993
1005
  /** 文件编码 */
994
- type FileEncoding = "utf-8" | "ascii" | "base64" | "binary" | "hex" | "ucs2" | "ucs-2" | "utf16le" | "utf-16le" | "utf8" | "latin1";
1006
+ type FileEncoding = "ascii" | "base64" | "binary" | "hex" | "latin1" | "ucs2" | "ucs-2" | "utf8" | "utf-8" | "utf16le" | "utf-16le";
995
1007
  declare const dirname: (path: string) => string;
996
1008
  /** 判断文件或文件夹是否存在 */
997
1009
  declare const exists: (path: string) => boolean;
@@ -1639,8 +1651,10 @@ interface RequestFactory {
1639
1651
  declare const createRequest: ({ cookieStore, server, requestHandler, responseHandler, errorHandler, ...defaultOptions }?: RequestInitOptions) => RequestFactory;
1640
1652
 
1641
1653
  type AllowTag = "a" | "abbr" | "address" | "article" | "aside" | "b" | "bdi" | "bdo" | "blockquote" | "br" | "caption" | "cite" | "code" | "col" | "colgroup" | "dd" | "del" | "div" | "dl" | "dt" | "em" | "fieldset" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hr" | "i" | "img" | "ins" | "label" | "legend" | "li" | "mark" | "nav" | "ol" | "p" | "pre" | "q" | "rt" | "ruby" | "s" | "section" | "small" | "span" | "strong" | "sub" | "sup" | "table" | "tbody" | "td" | "tfoot" | "th" | "thead" | "tr" | "tt" | "u" | "ul";
1654
+ type DeprecatedTag = "big" | "center" | "font";
1655
+ type ConvertedTag = "html" | "body" | "svg";
1642
1656
  declare const ALLOWED_TAGS: [
1643
- tag: AllowTag | "big" | "center" | "font",
1657
+ tag: AllowTag | DeprecatedTag | ConvertedTag,
1644
1658
  allowedAttrs?: string[]
1645
1659
  ][];
1646
1660
 
@@ -1867,6 +1881,7 @@ declare class Element extends NodeWithChildren {
1867
1881
  "x-attribsPrefix"?: Record<string, string>;
1868
1882
  }
1869
1883
 
1884
+ declare const $: cheerio_slim.CheerioAPI;
1870
1885
  declare const parseHTML: (content: string) => AnyNode[];
1871
1886
 
1872
1887
  interface ElementNode {
@@ -1897,6 +1912,10 @@ interface ParserOptions {
1897
1912
 
1898
1913
  declare const getRichTextNodes: (content: string | AnyNode[], { appendClass, transform }?: ParserOptions) => Promise<RichTextNode[]>;
1899
1914
 
1915
+ /** SVG 转换 */
1916
+ declare const convertSVGToDataURI: (content: string) => string;
1917
+
1900
1918
  declare const getText: (content: string | AnyNode[]) => string;
1901
1919
 
1902
- 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, go, handleProperties, isDir, isFile, isFunction, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, reLaunch, readFile, readJSON, redirect, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, switchTab, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
1920
+ export { $, $App, $Component, $Config, $Page, ALLOWED_TAGS, Cookie, CookieStore, Emitter, Headers, MpError$1 as MpError, Queue, URLSearchParams, addContact, appState, check, checkAsync, compareVersion, confirm, convertSVGToDataURI, 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, go, handleProperties, isDir, isFile, isFunction, lock, logger, ls, mkdir, normalizeDomain, once, openDocument, parseCookieHeader, parseHTML, parseUrl, put, query, reLaunch, readFile, readJSON, redirect, remove, removeAsync, removeRef, reportNetworkStatus, request, requestCookieStore, retry, rm, saveDocument, saveFile, saveOnlineFile, savePhoto, set, setAsync, setRef, showModal, showToast, storage, switchTab, take, type, unzip, updateApp, wrapFunction, writeClipboard, writeFile, writeJSON };
1921
+ export type { AllowTag, AppConfigCommonOptions, AppConfigOptions, AppConstructor, AppInstance, AppOptions, ComponentConstructor, ComponentInstance, ComponentLifetimes, ComponentOptions, Config, ConvertedTag, CookieMap, CookieOptions, CookieStoreType, CookieType, DeprecatedTag, ElementNode, EmitterInstance, Env, EventHandlerList, EventHandlerMap, EventType, ExtendedAppMethods, ExtendedComponentMethods, ExtendedComponentProperty, ExtendedPageLifeCycles, ExtendedPageMethods, ExtendedPageProperties, ExtendsAppOptions, Handler, HeadersInit, InferFromType, InferPropType, InferPropTypes, MpErrorOptions$1 as MpErrorOptions, PageConstructor, PageInstance, PageOptions, PageQuery, PageState, PropItem, PropOption, PropType, Props, PropsOptions, RefMap, RequestBody, RequestFactory, RequestInitOptions, RequestOptions, RequestResponse, RequestType, RichTextNode, RouteCustomConfig, RoutePathConfig, SetCookieOptions, StorageData, Task, TextNode, TrivialComponentInstance, TrivialComponentOptions, TrivialPageInstance, TrivialPageOptions, UpdateInfo, UrlInfo, WildCardEventHandlerList, WildcardHandler };