@mptool/all 0.10.6 → 0.10.8
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 +10 -2
- package/lib/index.d.ts +10 -2
- 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 +4 -4
package/lib/index.d.mts
CHANGED
|
@@ -462,7 +462,11 @@ interface ExtendedComponentMethods extends InstanceEmitterMethods {
|
|
|
462
462
|
type ComponentInstance<Data extends WechatMiniprogram.Component.DataOption, Props extends PropsOptions, Method extends Partial<WechatMiniprogram.Component.MethodOption>, InstanceProps extends WechatMiniprogram.IAnyObject = Record<never, never>, IsPage extends boolean = false> = WechatMiniprogram.Component.InstanceProperties & WechatMiniprogram.Component.InstanceMethods<Data> & ExtendedComponentMethods & Method & (IsPage extends true ? WechatMiniprogram.Page.ILifetime : Record<never, never>) & InstanceProps & ExtendedComponentProperty & ExtendedPageMethods<Data & InferPropTypes<Props>, InstanceProps & Method & (IsPage extends true ? WechatMiniprogram.Page.ILifetime : Record<never, never>)> & {
|
|
463
463
|
/** 组件数据,**包括内部数据和属性值** */
|
|
464
464
|
data: Data & InferPropTypes<Props>;
|
|
465
|
-
/**
|
|
465
|
+
/**
|
|
466
|
+
* @deprecated 优先使用 `data`
|
|
467
|
+
*
|
|
468
|
+
* 组件数据,**包括内部数据和属性值**(与 `data` 一致)
|
|
469
|
+
*/
|
|
466
470
|
properties: Data & InferPropTypes<Props>;
|
|
467
471
|
};
|
|
468
472
|
type ComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends PropsOptions, Method extends WechatMiniprogram.Component.MethodOption, InstanceProps extends WechatMiniprogram.IAnyObject = Record<never, never>, IsPage extends boolean = false> = Partial<WechatMiniprogram.Component.Data<Data>> & Partial<{
|
|
@@ -1006,6 +1010,10 @@ declare const isDir: (path: string) => boolean;
|
|
|
1006
1010
|
declare const rm: (path: string, type?: "dir" | "file") => void;
|
|
1007
1011
|
/** 列出目录下内容 */
|
|
1008
1012
|
declare const ls: (path: string) => string[];
|
|
1013
|
+
interface ReadFile {
|
|
1014
|
+
(path: string): string | undefined;
|
|
1015
|
+
<T extends FileEncoding>(path: string, encoding: T): (T extends "binary" ? ArrayBuffer : string) | undefined;
|
|
1016
|
+
}
|
|
1009
1017
|
/**
|
|
1010
1018
|
* 文件管理器读取文件包装
|
|
1011
1019
|
*
|
|
@@ -1013,7 +1021,7 @@ declare const ls: (path: string) => string[];
|
|
|
1013
1021
|
* @param encoding 文件的编码格式,默认 `utf-8`
|
|
1014
1022
|
* @returns 文件内容
|
|
1015
1023
|
*/
|
|
1016
|
-
declare const readFile:
|
|
1024
|
+
declare const readFile: ReadFile;
|
|
1017
1025
|
/**
|
|
1018
1026
|
* 读取并解析 JSON 文件
|
|
1019
1027
|
*
|
package/lib/index.d.ts
CHANGED
|
@@ -462,7 +462,11 @@ interface ExtendedComponentMethods extends InstanceEmitterMethods {
|
|
|
462
462
|
type ComponentInstance<Data extends WechatMiniprogram.Component.DataOption, Props extends PropsOptions, Method extends Partial<WechatMiniprogram.Component.MethodOption>, InstanceProps extends WechatMiniprogram.IAnyObject = Record<never, never>, IsPage extends boolean = false> = WechatMiniprogram.Component.InstanceProperties & WechatMiniprogram.Component.InstanceMethods<Data> & ExtendedComponentMethods & Method & (IsPage extends true ? WechatMiniprogram.Page.ILifetime : Record<never, never>) & InstanceProps & ExtendedComponentProperty & ExtendedPageMethods<Data & InferPropTypes<Props>, InstanceProps & Method & (IsPage extends true ? WechatMiniprogram.Page.ILifetime : Record<never, never>)> & {
|
|
463
463
|
/** 组件数据,**包括内部数据和属性值** */
|
|
464
464
|
data: Data & InferPropTypes<Props>;
|
|
465
|
-
/**
|
|
465
|
+
/**
|
|
466
|
+
* @deprecated 优先使用 `data`
|
|
467
|
+
*
|
|
468
|
+
* 组件数据,**包括内部数据和属性值**(与 `data` 一致)
|
|
469
|
+
*/
|
|
466
470
|
properties: Data & InferPropTypes<Props>;
|
|
467
471
|
};
|
|
468
472
|
type ComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends PropsOptions, Method extends WechatMiniprogram.Component.MethodOption, InstanceProps extends WechatMiniprogram.IAnyObject = Record<never, never>, IsPage extends boolean = false> = Partial<WechatMiniprogram.Component.Data<Data>> & Partial<{
|
|
@@ -1006,6 +1010,10 @@ declare const isDir: (path: string) => boolean;
|
|
|
1006
1010
|
declare const rm: (path: string, type?: "dir" | "file") => void;
|
|
1007
1011
|
/** 列出目录下内容 */
|
|
1008
1012
|
declare const ls: (path: string) => string[];
|
|
1013
|
+
interface ReadFile {
|
|
1014
|
+
(path: string): string | undefined;
|
|
1015
|
+
<T extends FileEncoding>(path: string, encoding: T): (T extends "binary" ? ArrayBuffer : string) | undefined;
|
|
1016
|
+
}
|
|
1009
1017
|
/**
|
|
1010
1018
|
* 文件管理器读取文件包装
|
|
1011
1019
|
*
|
|
@@ -1013,7 +1021,7 @@ declare const ls: (path: string) => string[];
|
|
|
1013
1021
|
* @param encoding 文件的编码格式,默认 `utf-8`
|
|
1014
1022
|
* @returns 文件内容
|
|
1015
1023
|
*/
|
|
1016
|
-
declare const readFile:
|
|
1024
|
+
declare const readFile: ReadFile;
|
|
1017
1025
|
/**
|
|
1018
1026
|
* 读取并解析 JSON 文件
|
|
1019
1027
|
*
|