minidev 1.0.5 → 1.1.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/index.d.ts CHANGED
@@ -36,6 +36,8 @@ declare module 'minidev' {
36
36
 
37
37
  export function setSpinnerEnabled(enabled: boolean): void;
38
38
 
39
+ export function setLogLevelVerboseEnabled(enabled: boolean): void;
40
+
39
41
  export type MaybePromise<T = void> = T | Promise<T>;
40
42
 
41
43
  export interface IMinidevPlugin {
@@ -85,10 +87,10 @@ declare module 'minidev' {
85
87
  * 需要在运行 dev 之后运行
86
88
  * @param opts
87
89
  */
88
- devPreview(opts: IDevPreviewArgs): Promise<IGenerateDebugQRCodeResult>;
90
+ devPreview(opts: IDevPreviewArgs, build?: IDevServerCompileBuild): Promise<IGenerateDebugQRCodeResult>;
89
91
 
90
92
 
91
- devWebSimulator(opts:IDevWebSimulatorArgs): Promise<IWebSimulatorLauncher>
93
+ devWebSimulator(opts:IDevWebSimulatorArgs, build?: IDevServerCompileBuild): Promise<IWebSimulatorLauncher>
92
94
 
93
95
 
94
96
  /**
@@ -96,7 +98,7 @@ declare module 'minidev' {
96
98
  * 需要在运行 dev 之后运行
97
99
  * @param opts
98
100
  */
99
- devRemoteDebug(opts: IDevRemoteDebugArgs): Promise<IRemoteDebugReturn>
101
+ devRemoteDebug(opts: IDevRemoteDebugArgs, build?: IDevServerCompileBuild): Promise<IRemoteDebugReturn>
100
102
 
101
103
 
102
104
  /**
@@ -104,7 +106,7 @@ declare module 'minidev' {
104
106
  * 需要在运行 dev 之后运行
105
107
  * @param opts
106
108
  */
107
- startIdeForDevServer(opts: IDevIDEOptions): Promise<void>;
109
+ startIdeForDevServer(opts: IDevIDEOptions, build?: IDevServerCompileBuild): Promise<void>;
108
110
 
109
111
  /**
110
112
  * 进行工具授权
@@ -115,8 +117,9 @@ declare module 'minidev' {
115
117
  /**
116
118
  * 上传发布小程序
117
119
  * @param opts
120
+ * @param @optional hooks
118
121
  */
119
- upload(opts: IUploadOptions): Promise<IPublishResult>;
122
+ upload(opts: IUploadOptions, hooks?: IPublishHooks): Promise<IPublishResult>;
120
123
 
121
124
 
122
125
  /**
@@ -167,6 +170,15 @@ declare module 'minidev' {
167
170
 
168
171
  }
169
172
 
173
+ export interface IPublishHooks {
174
+
175
+ onLog?:(data: string) => void;
176
+
177
+ onTaskCreated?: (taskId: string) => void;
178
+
179
+ onVersionCreated?: (version: string) => void;
180
+ }
181
+
170
182
  export interface IMinidevConfig {
171
183
 
172
184
  get<T = any>(configName: string, opts?: IConfigOptions): Promise<T>;
@@ -528,7 +540,7 @@ declare module 'minidev' {
528
540
  once(event: 'hmr-done', listener: () => any): this;
529
541
  once(event: 'hmr-error', listener: (error: IDevError) => any): this;
530
542
  once(event: 'project-config-change', listener: () => any): this;
531
- once(event: 'log', listener: () => any): this;
543
+ once(event: 'log', listener: (data: string) => any): this;
532
544
 
533
545
  restart(options?: {appId?: string}): Promise<void>;
534
546
 
@@ -553,6 +565,7 @@ declare module 'minidev' {
553
565
  export interface IDevDone {
554
566
  success: boolean;
555
567
  }
568
+
556
569
 
557
570
  export interface IDevIDEOptions extends IOptionalAppIdArgs, IIDECommandOptions {
558
571
 
@@ -594,7 +607,12 @@ declare module 'minidev' {
594
607
  }
595
608
 
596
609
  export interface IDevRemoteDebugArgs extends IGenerateQrCodeArgs, IAppIdArgs {
597
-
610
+
611
+ /**
612
+ * 是否自动打开 devtool,cli 模式默认自动打开, jsApi 调用默认不打开
613
+ */
614
+ autoOpenDevtool?: boolean;
615
+
598
616
  }
599
617
 
600
618
  export interface IPublishResult {
@@ -622,6 +640,11 @@ declare module 'minidev' {
622
640
  * 上传成功后,自动设置为体验版本 (需要对应权限)
623
641
  */
624
642
  experience?: boolean;
643
+
644
+ /**
645
+ * 上传时删除指定版本号
646
+ */
647
+ deleteVersion?: string;
625
648
 
626
649
  }
627
650
 
@@ -718,7 +741,12 @@ declare module 'minidev' {
718
741
  /**
719
742
  * 小程序应用 id
720
743
  */
721
- appId: string;
744
+ appId: string;
745
+
746
+ /**
747
+ * 是否自动打开 devtool,cli 模式默认自动打开, jsApi 调用默认不打开
748
+ */
749
+ autoOpenDevtool?: boolean;
722
750
 
723
751
  }
724
752