@uni-helper/uni-env 0.1.1 → 0.1.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/dist/index.d.ts CHANGED
@@ -1,90 +1,449 @@
1
- declare const builtInPlatforms: readonly ["app", "app-plus", "h5", "mp-360", "mp-alipay", "mp-baidu", "mp-jd", "mp-kuaishou", "mp-lark", "mp-qq", "mp-toutiao", "mp-weixin", "quickapp-webview", "quickapp-webview-huawei", "quickapp-webview-union"];
2
-
3
- type BuiltInPlatForm = typeof builtInPlatforms[number];
4
- type UtsPlatform = BuiltInPlatForm | 'app-android' | 'app-ios' | 'web';
1
+ type OptionalBooleanString = 'true' | 'false' | undefined;
2
+ type OptionalString = string | undefined;
3
+ /**
4
+ * `process.env.UNI_PLATFORM`
5
+ *
6
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L9}
7
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-uni-app.d.ts#L24}
8
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-uni-app.d.ts#L192-L209}
9
+ */
10
+ type BuiltInPlatform = 'h5' | 'web' | 'app' | 'app-plus' | 'mp-360' | 'mp-alipay' | 'mp-baidu' | 'mp-qq' | 'mp-toutiao' | 'mp-weixin' | 'mp-kuaishou' | 'mp-lark' | 'mp-jd' | 'mp-xhs' | 'quickapp-webview' | 'quickapp-webview-huawei' | 'quickapp-webview-union';
11
+ declare const builtInPlatforms: BuiltInPlatform[];
12
+ /**
13
+ * `process.env.UNI_PLATFORM`
14
+ *
15
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L9}
16
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-uni-app.d.ts#L24}
17
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-uni-app.d.ts#L192-L209}
18
+ */
19
+ declare const platform: BuiltInPlatform;
20
+ /**
21
+ * `process.env.UNI_APP_PLATFORM`
22
+ *
23
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L10}
24
+ */
5
25
  type AppPlatform = 'android' | 'ios' | undefined;
6
- type SubPlatform = 'quickapp-webview-huawei' | 'quickapp-webview-union' | undefined;
7
-
8
- /** Value of `process.env.UNI_PLATFORM` */
9
- declare const platform: "app" | "app-plus" | "h5" | "mp-360" | "mp-alipay" | "mp-baidu" | "mp-jd" | "mp-kuaishou" | "mp-lark" | "mp-qq" | "mp-toutiao" | "mp-weixin" | "quickapp-webview" | "quickapp-webview-huawei" | "quickapp-webview-union";
10
- /** Value of `process.env.UNI_UTS_PLATFORM` */
11
- declare const utsPlatform: UtsPlatform;
12
- /** Value of `process.env.UNI_APP_PLATFORM` */
26
+ /**
27
+ * `process.env.UNI_APP_PLATFORM`
28
+ *
29
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L10}
30
+ */
13
31
  declare const appPlatform: AppPlatform;
14
- /** Value of `process.env.UNI_SUB_PLATFORM` */
32
+ /**
33
+ * `process.env.UNI_SUB_PLATFORM`
34
+ *
35
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L11}
36
+ */
37
+ type SubPlatform = 'quickapp-webview-huawei' | 'quickapp-webview-union' | undefined;
38
+ /**
39
+ * `process.env.UNI_SUB_PLATFORM`
40
+ *
41
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L11}
42
+ */
15
43
  declare const subPlatform: SubPlatform;
16
- /** Detect if `process.env.UNI_PLATFORM` is `H5` */
44
+ /**
45
+ * `process.env.UNI_UTS_PLATFORM`
46
+ *
47
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L12}
48
+ */
49
+ type UtsPlatform = BuiltInPlatform | 'app-android' | 'app-ios' | 'web';
50
+ /**
51
+ * `process.env.UNI_UTS_PLATFORM`
52
+ *
53
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L12}
54
+ */
55
+ declare const utsPlatform: UtsPlatform;
56
+ /** Detect if `process.env.UNI_PLATFORM` is `h5` */
17
57
  declare const isH5: boolean;
18
- /** Detect if `process.env.UNI_PLATFORM` is `APP` */
58
+ /** Detect if `process.env.UNI_PLATFORM` is `web` */
59
+ declare const isWeb: boolean;
60
+ /** Detect if `process.env.UNI_PLATFORM` is `app` */
19
61
  declare const isApp: boolean;
20
- /** Detect if `process.env.UNI_APP_PLATFORM` is `android` or if `process.env.UNI_UTS_PLATFORM` is "app-android" */
62
+ /** Detect if `process.env.UNI_PLATFORM` is `app-plus` */
63
+ declare const isAppPlus: boolean;
64
+ /** Detect if `process.env.UNI_APP_PLATFORM` is `android` or if `process.env.UNI_UTS_PLATFORM` is `app-android` */
21
65
  declare const isAppAndroid: boolean;
22
- /** Detect if `process.env.UNI_APP_PLATFORM` is `ios` or if `process.env.UNI_UTS_PLATFORM` is "app-ios" */
66
+ /** Detect if `process.env.UNI_APP_PLATFORM` is `ios` or if `process.env.UNI_UTS_PLATFORM` is `app-ios` */
23
67
  declare const isAppIOS: boolean;
24
- /** Detect if `process.env.UNI_PLATFORM` is `小程序` */
68
+ /** Detect if `process.env.UNI_PLATFORM` is `mp-*` */
25
69
  declare const isMp: boolean;
26
- /** Detect if `process.env.UNI_PLATFORM` is `微信小程序` */
70
+ /** Detect if `process.env.UNI_PLATFORM` is `mp-weixin` */
27
71
  declare const isMpWeixin: boolean;
28
- /** Detect if `process.env.UNI_PLATFORM` is `支付宝小程序` */
72
+ /** Detect if `process.env.UNI_PLATFORM` is `mp-alipay` */
29
73
  declare const isMpAlipay: boolean;
30
- /** Detect if `process.env.UNI_PLATFORM` is `百度小程序` */
74
+ /** Detect if `process.env.UNI_PLATFORM` is `mp-baidu` */
31
75
  declare const isMpBaidu: boolean;
32
- /** Detect if `process.env.UNI_PLATFORM` is `快手小程序` */
76
+ /** Detect if `process.env.UNI_PLATFORM` is `mp-kuaishou` */
33
77
  declare const isMpKuaishou: boolean;
34
- /** Detect if `process.env.UNI_PLATFORM` is `QQ小程序` */
78
+ /** Detect if `process.env.UNI_PLATFORM` is `mp-qq` */
35
79
  declare const isMpQQ: boolean;
36
- /** Detect if `process.env.UNI_PLATFORM` is `头条小程序` */
80
+ /** Detect if `process.env.UNI_PLATFORM` is `mp-toutiao` */
37
81
  declare const isMpToutiao: boolean;
38
- /** Detect if `process.env.UNI_PLATFORM` is `快应用` */
82
+ /** Detect if `process.env.UNI_PLATFORM` is `quickapp-webview*` */
39
83
  declare const isQuickapp: boolean;
40
- /** Detect if `process.env.UNI_PLATFORM` is `快应用联盟` */
84
+ /** Detect if `process.env.UNI_PLATFORM` is `quickapp-webview-union` */
41
85
  declare const isQuickappUnion: boolean;
42
- /** Detect if `process.env.UNI_PLATFORM` is `快应用华为` */
86
+ /** Detect if `process.env.UNI_PLATFORM` is `quickapp-webview-huawei` */
43
87
  declare const isQuickappHuawei: boolean;
44
-
45
- /** Detect if `VUE_APP_DARK_MODE` environment variable is set */
46
- declare const hasDarkMode: boolean;
47
- /** Detect if `SOURCEMAP` environment variable is set */
48
- declare const hasSourcemap: boolean;
49
- /** Detect if `UNI_MP_PLUGIN` environment variable is set */
88
+ /**
89
+ * `process.env.UNI_UTS_JS_CODE_FORMAT`
90
+ *
91
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L14}
92
+ */
93
+ type UtsJsCodeFormat = 'cjs' | 'es' | undefined;
94
+ /**
95
+ * `process.env.UNI_UTS_JS_CODE_FORMAT`
96
+ *
97
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L14}
98
+ */
99
+ declare const utsJsCodeFormat: UtsJsCodeFormat;
100
+ /**
101
+ * `process.env.UNI_UTS_MODULE_TYPE`
102
+ *
103
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L15}
104
+ */
105
+ type UtsModuleType = 'built-in' | '' | undefined;
106
+ /**
107
+ * `process.env.UNI_UTS_MODULE_TYPE`
108
+ *
109
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L15}
110
+ */
111
+ declare const utsModuleType: UtsModuleType;
112
+ /**
113
+ * `process.env.UNI_UTS_MODULE_PREFIX`
114
+ *
115
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L16}
116
+ */
117
+ declare const utsModulePrefix: OptionalString;
118
+ /**
119
+ * `process.env.UNI_UTS_TARGET_LANGUAGE`
120
+ *
121
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L17}
122
+ */
123
+ type UtsTargetLanguage = 'javascript' | 'kotlin' | 'swift' | undefined;
124
+ /**
125
+ * `process.env.UNI_UTS_TARGET_LANGUAGE`
126
+ *
127
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L17}
128
+ */
129
+ declare const utsTargetLanguage: UtsTargetLanguage;
130
+ /**
131
+ * `process.env.UNI_INPUT_DIR`
132
+ *
133
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L19}
134
+ */
135
+ declare const inputDir: OptionalString;
136
+ /**
137
+ * `process.env.UNI_OUTPUT_DIR`
138
+ *
139
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L20}
140
+ */
141
+ declare const outputDir: OptionalString;
142
+ /**
143
+ * `process.env.UNI_CLI_CONTEXT`
144
+ *
145
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L21}
146
+ */
147
+ declare const cliContext: OptionalString;
148
+ /**
149
+ * `process.env.UNI_SUBPACKAGE`
150
+ *
151
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L22}
152
+ */
153
+ declare const subpackage: OptionalString;
154
+ /**
155
+ * `process.env.UNI_MP_PLUGIN`
156
+ *
157
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L23}
158
+ */
159
+ declare const mpPlugin: OptionalBooleanString;
160
+ /** Detect if `process.env.UNI_MP_PLUGIN` is set */
50
161
  declare const isMpPlugin: boolean;
51
- /** Detect if `UNI_MINIMIZE` environment variable is set */
162
+ /**
163
+ * `process.env.UNI_COMPILER_VERSION`
164
+ *
165
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L24}
166
+ */
167
+ declare const compilerVersion: OptionalString;
168
+ /**
169
+ * `process.env.UNI_COMPILER_VERSION`
170
+ *
171
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L25}
172
+ */
173
+ type CompilerVersionType = 'a' | 'r' | undefined;
174
+ /**
175
+ * `process.env.UNI_COMPILER_VERSION`
176
+ *
177
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L25}
178
+ */
179
+ declare const compilerVersionType: CompilerVersionType;
180
+ /**
181
+ * `process.env.UNI_HBUILDERX_PLUGINS`
182
+ *
183
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L26}
184
+ */
185
+ declare const hbuilderxPlugins: OptionalString;
186
+ /**
187
+ * `process.env.UNI_RENDERER`
188
+ *
189
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L27}
190
+ */
191
+ type Renderer = 'native' | undefined;
192
+ /**
193
+ * `process.env.UNI_RENDERER`
194
+ *
195
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L27}
196
+ */
197
+ declare const renderer: Renderer;
198
+ /**
199
+ * `process.env.UNI_NVUE_COMPILER`
200
+ *
201
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L28}
202
+ */
203
+ type NVueCompiler = 'uni-app' | 'weex' | 'vue' | 'vite' | undefined;
204
+ /**
205
+ * `process.env.UNI_NVUE_COMPILER`
206
+ *
207
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L28}
208
+ */
209
+ declare const nvueCompiler: NVueCompiler;
210
+ /**
211
+ * `process.env.UNI_NVUE_STYLE_COMPILER`
212
+ *
213
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L29}
214
+ */
215
+ type NVueStyleCompiler = 'uni-app' | 'weex' | undefined;
216
+ /**
217
+ * `process.env.UNI_NVUE_STYLE_COMPILER`
218
+ *
219
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L29}
220
+ */
221
+ declare const nvueStyleCompiler: NVueStyleCompiler;
222
+ /**
223
+ * `process.env.UNI_APP_CODE_SPLITING`
224
+ *
225
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L30}
226
+ */
227
+ declare const appCodeSpliting: OptionalBooleanString;
228
+ /**
229
+ * `process.env.UNI_AUTOMATOR_WS_ENDPOINT`
230
+ *
231
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L31}
232
+ */
233
+ declare const automatorWsEndpoint: OptionalString;
234
+ /**
235
+ * `process.env.UNI_AUTOMATOR_APP_WEBVIEW`
236
+ *
237
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L32}
238
+ */
239
+ declare const automatorAppWebview: OptionalString;
240
+ /**
241
+ * `process.env.UNI_AUTOMATOR_APP_WEBVIEW_SRC`
242
+ *
243
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L33}
244
+ */
245
+ declare const automatorAppWebviewSrc: OptionalString;
246
+ /**
247
+ * `process.env.UNI_H5_BASE`
248
+ *
249
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L34}
250
+ */
251
+ declare const h5Base: OptionalString;
252
+ /**
253
+ * `process.env.UNI_H5_BROWSER`
254
+ *
255
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L35}
256
+ */
257
+ type H5Browser = 'builtin' | undefined;
258
+ /**
259
+ * `process.env.UNI_H5_BROWSER`
260
+ *
261
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L35}
262
+ */
263
+ declare const h5Browser: H5Browser;
264
+ /**
265
+ * `process.env.UNI_CUSTOM_SCRIPT`
266
+ *
267
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L36}
268
+ */
269
+ declare const customScript: OptionalString;
270
+ /**
271
+ * `process.env.UNI_CUSTOM_DEFINE`
272
+ *
273
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L37}
274
+ */
275
+ declare const customDefine: OptionalString;
276
+ /**
277
+ * `process.env.UNI_CUSTOM_CONTEXT`
278
+ *
279
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L38}
280
+ */
281
+ declare const customContext: OptionalString;
282
+ /**
283
+ * `process.env.UNI_MINIMIZE`
284
+ *
285
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L39}
286
+ */
287
+ declare const minimize: OptionalBooleanString;
288
+ /** Detect if `process.env.UNI_MINIMIZE` is set */
52
289
  declare const isMinimize: boolean;
53
- /** Detect if `UNI_SSR_CLIENT` environment variable is set */
290
+ /**
291
+ * `process.env.UNI_UVUE`
292
+ *
293
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L40}
294
+ */
295
+ declare const uvue: OptionalBooleanString;
296
+ /** Detect if `process.env.UNI_UVUE` is set */
297
+ declare const isUVue: boolean;
298
+ /**
299
+ * `process.env.UNI_UVUE_TARGET_LANGUAGE`
300
+ *
301
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L41}
302
+ */
303
+ type UVueTargetLanguage = 'kotlin' | 'swift' | 'javascript' | undefined;
304
+ /**
305
+ * `process.env.UNI_UVUE_TARGET_LANGUAGE`
306
+ *
307
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L41}
308
+ */
309
+ declare const uvueTargetLanguage: UVueTargetLanguage;
310
+ /**
311
+ * `process.env.UNI_COMPILER`
312
+ *
313
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L42}
314
+ */
315
+ type Compiler = 'vue' | 'nvue' | undefined;
316
+ /**
317
+ * `process.env.UNI_COMPILER`
318
+ *
319
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L42}
320
+ */
321
+ declare const compiler: Compiler;
322
+ /**
323
+ * `process.env.UNI_RENDERER_NATIVE`
324
+ *
325
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L43}
326
+ */
327
+ type RendererNative = 'appService' | 'pages' | undefined;
328
+ /**
329
+ * `process.env.UNI_RENDERER_NATIVE`
330
+ *
331
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L43}
332
+ */
333
+ declare const rendererNative: RendererNative;
334
+ /**
335
+ * `process.env.UNI_NVUE_APP_STYLES`
336
+ *
337
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L44}
338
+ */
339
+ declare const nvueAppStyles: OptionalString;
340
+ /**
341
+ * `process.env.UNI_APP_CHANGED_FILES`
342
+ *
343
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L45}
344
+ */
345
+ declare const appChangedFiles: OptionalString;
346
+ /**
347
+ * `process.env.UNI_APP_CHANGED_PAGES`
348
+ *
349
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L46}
350
+ */
351
+ declare const appChangedPages: OptionalString;
352
+ /**
353
+ * `process.env.VUE_APP_DARK_MODE`
354
+ *
355
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L47}
356
+ */
357
+ declare const darkMode: OptionalBooleanString;
358
+ /** Detect if `process.env.VUE_APP_DARK_MODE` is set */
359
+ declare const hasDarkMode: boolean;
360
+ /**
361
+ * `process.env.HX_USE_BASE_TYPE`
362
+ *
363
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L48}
364
+ */
365
+ type HxUseBaseType = 'standard' | 'custom' | undefined;
366
+ /**
367
+ * `process.env.HX_USE_BASE_TYPE`
368
+ *
369
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L48}
370
+ */
371
+ declare const hxUseBaseType: HxUseBaseType;
372
+ /**
373
+ * `process.env.HX_DEPENDENCIES_DIR`
374
+ *
375
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L49}
376
+ */
377
+ declare const hxDependenciesDir: OptionalString;
378
+ /**
379
+ * `process.env.UNI_APP_X`
380
+ *
381
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L55}
382
+ */
383
+ declare const appX: OptionalBooleanString;
384
+ /** Detect if `process.env.UNI_APP_X` is set */
385
+ declare const isAppX: boolean;
386
+ /**
387
+ * `process.env.UNI_APP_X_CACHE_DIR`
388
+ *
389
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L56}
390
+ */
391
+ declare const appXCacheDir: OptionalString;
392
+ /**
393
+ * `process.env.HX_VERSION`
394
+ *
395
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L58}
396
+ */
397
+ declare const hxVersion: OptionalString;
398
+ /**
399
+ * `process.env.UNI_APP_X_PAGE_COUNT`
400
+ *
401
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L60}
402
+ */
403
+ declare const appXPageCount: OptionalString;
404
+ /**
405
+ * `process.env.UNI_APP_X_TSC`
406
+ *
407
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L61}
408
+ */
409
+ declare const appXTsc: OptionalString;
410
+ /**
411
+ * `process.env.UNI_APP_X_SINGLE_THREAD`
412
+ *
413
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L62}
414
+ */
415
+ declare const appXSingleThread: OptionalString;
416
+ /**
417
+ * `process.env.UNI_APP_X_SETUP`
418
+ *
419
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L63}
420
+ */
421
+ declare const appXSetup: OptionalString;
422
+ /**
423
+ * `process.env.UNI_APP_X_UVUE_SCRIPT_ENGINE`
424
+ *
425
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L64}
426
+ */
427
+ type AppXUVueScriptEngine = 'native' | 'js' | undefined;
428
+ /**
429
+ * `process.env.UNI_APP_X_UVUE_SCRIPT_ENGINE`
430
+ *
431
+ * @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L64}
432
+ */
433
+ declare const appXUVueScriptEngine: AppXUVueScriptEngine;
434
+ /** `process.env.STAT_TITLE_JSON` */
435
+ declare const statTitleJson: Record<string, string>;
436
+ /** `process.env.SOURCEMAP` */
437
+ declare const sourcemap: OptionalBooleanString;
438
+ /** Detect if `process.env.SOURCEMAP` is set */
439
+ declare const hasSourcemap: boolean;
440
+ /** `process.env.UNI_SSR_CLIENT` */
441
+ declare const ssrClient: OptionalBooleanString;
442
+ /** Detect if `process.env.UNI_SSR_CLIENT` is set */
54
443
  declare const isSSRClient: boolean;
55
- /** Detect if `UNI_SSR_SERVER` environment variable is set */
444
+ /** `process.env.UNI_SSR_SERVER` */
445
+ declare const ssrServer: OptionalBooleanString;
446
+ /** Detect if `process.env.UNI_SSR_SERVER` is set */
56
447
  declare const isSSRServer: boolean;
57
448
 
58
- /** Value of `process.env.UNI_COMPILER` */
59
- declare const compiler: "vue" | "nvue";
60
- /** Value of `process.env.UNI_NVUE_COMPILER` */
61
- declare const nvueCompiler: "vue" | "uni-app" | undefined;
62
- /** Value of `process.env.UNI_NVUE_STYLE_COMPILER` */
63
- declare const nvueStyleCompiler: "uni-app" | undefined;
64
- /** Value of `process.env.UNI_COMPILER_VERSION` */
65
- declare const compilerVersion: string;
66
- /** Value of `process.env.UNI_COMPILER_VERSION_TYPE` */
67
- declare const compilerVersionType: "a" | "r";
68
-
69
- /** Value of `process.env.UNI_CLI_CONTEXT` */
70
- declare const cliContext: string;
71
- /** Value of `process.env.UNI_INPUT_DIR` */
72
- declare const inputDir: string;
73
- /** Value of `process.env.UNI_OUTPUT_DIR` */
74
- declare const outputDir: string;
75
- /** Value of `process.env.STAT_TITLE_JSON` */
76
- declare const statTitleJson: Record<string, string>;
77
- /** Value of `process.env.UNI_CUSTOM_CONTEXT` */
78
- declare const customContext: string | undefined;
79
- /** Value of `process.env.UNI_CUSTOM_SCRIPT` */
80
- declare const customScript: string | undefined;
81
- /** Value of `process.env.UNI_CUSTOM_DEFINE` */
82
- declare const customDefine: string | undefined;
83
- /** Value of `process.env.UNI_SUBPACKAGE` */
84
- declare const subpackage: string | undefined;
85
- /** Value of `process.env.UNI_RENDERER` */
86
- declare const renderer: "native" | undefined;
87
- /** Value of `process.env.UNI_RENDERER_NATIVE` */
88
- declare const rendererNative: "appService" | "pages" | undefined;
89
-
90
- export { type AppPlatform, type BuiltInPlatForm, type SubPlatform, type UtsPlatform, appPlatform, builtInPlatforms, cliContext, compiler, compilerVersion, compilerVersionType, customContext, customDefine, customScript, hasDarkMode, hasSourcemap, inputDir, isApp, isAppAndroid, isAppIOS, isH5, isMinimize, isMp, isMpAlipay, isMpBaidu, isMpKuaishou, isMpPlugin, isMpQQ, isMpToutiao, isMpWeixin, isQuickapp, isQuickappHuawei, isQuickappUnion, isSSRClient, isSSRServer, nvueCompiler, nvueStyleCompiler, outputDir, platform, renderer, rendererNative, statTitleJson, subPlatform, subpackage, utsPlatform };
449
+ export { type AppPlatform, type AppXUVueScriptEngine, type BuiltInPlatform, type Compiler, type CompilerVersionType, type H5Browser, type HxUseBaseType, type NVueCompiler, type NVueStyleCompiler, type OptionalBooleanString, type OptionalString, type Renderer, type RendererNative, type SubPlatform, type UVueTargetLanguage, type UtsJsCodeFormat, type UtsModuleType, type UtsPlatform, type UtsTargetLanguage, appChangedFiles, appChangedPages, appCodeSpliting, appPlatform, appX, appXCacheDir, appXPageCount, appXSetup, appXSingleThread, appXTsc, appXUVueScriptEngine, automatorAppWebview, automatorAppWebviewSrc, automatorWsEndpoint, builtInPlatforms, cliContext, compiler, compilerVersion, compilerVersionType, customContext, customDefine, customScript, darkMode, h5Base, h5Browser, hasDarkMode, hasSourcemap, hbuilderxPlugins, hxDependenciesDir, hxUseBaseType, hxVersion, inputDir, isApp, isAppAndroid, isAppIOS, isAppPlus, isAppX, isH5, isMinimize, isMp, isMpAlipay, isMpBaidu, isMpKuaishou, isMpPlugin, isMpQQ, isMpToutiao, isMpWeixin, isQuickapp, isQuickappHuawei, isQuickappUnion, isSSRClient, isSSRServer, isUVue, isWeb, minimize, mpPlugin, nvueAppStyles, nvueCompiler, nvueStyleCompiler, outputDir, platform, renderer, rendererNative, sourcemap, ssrClient, ssrServer, statTitleJson, subPlatform, subpackage, utsJsCodeFormat, utsModulePrefix, utsModuleType, utsPlatform, utsTargetLanguage, uvue, uvueTargetLanguage };
package/dist/index.mjs CHANGED
@@ -1,29 +1,27 @@
1
1
  import { env } from 'std-env';
2
2
 
3
- const builtInPlatforms = [
4
- "app",
5
- "app-plus",
6
- "h5",
7
- "mp-360",
8
- "mp-alipay",
9
- "mp-baidu",
10
- "mp-jd",
11
- "mp-kuaishou",
12
- "mp-lark",
13
- "mp-qq",
14
- "mp-toutiao",
15
- "mp-weixin",
16
- "quickapp-webview",
17
- "quickapp-webview-huawei",
18
- "quickapp-webview-union"
19
- ];
3
+ function toBoolean(val) {
4
+ return val ? val !== "false" : false;
5
+ }
6
+ function parseJSON(val) {
7
+ let obj;
8
+ try {
9
+ obj = JSON.parse(val || "{}");
10
+ } catch (error) {
11
+ obj = {};
12
+ }
13
+ return obj;
14
+ }
20
15
 
16
+ const builtInPlatforms = ["h5", "web", "app", "app-plus", "mp-360", "mp-alipay", "mp-baidu", "mp-qq", "mp-toutiao", "mp-weixin", "mp-kuaishou", "mp-lark", "mp-jd", "mp-xhs", "quickapp-webview", "quickapp-webview-huawei", "quickapp-webview-union"];
21
17
  const platform = env.UNI_PLATFORM;
22
- const utsPlatform = env.UNI_UTS_PLATFORM;
23
18
  const appPlatform = env.UNI_APP_PLATFORM;
24
19
  const subPlatform = env.UNI_SUB_PLATFORM;
20
+ const utsPlatform = env.UNI_UTS_PLATFORM;
25
21
  const isH5 = platform === "h5";
22
+ const isWeb = platform === "web";
26
23
  const isApp = platform === "app";
24
+ const isAppPlus = platform === "app-plus";
27
25
  const isAppAndroid = appPlatform === "android" || utsPlatform === "app-android";
28
26
  const isAppIOS = appPlatform === "ios" || utsPlatform === "app-ios";
29
27
  const isMp = /^mp-/i.test(platform);
@@ -36,44 +34,60 @@ const isMpToutiao = platform === "mp-toutiao";
36
34
  const isQuickapp = /^quickapp-webview/i.test(platform);
37
35
  const isQuickappUnion = platform === "quickapp-webview-union";
38
36
  const isQuickappHuawei = platform === "quickapp-webview-huawei";
39
-
40
- function toBoolean(val) {
41
- return val ? val !== "false" : false;
42
- }
43
- function parseJSON(val) {
44
- let obj;
45
- try {
46
- obj = JSON.parse(val || "{}");
47
- } catch (error) {
48
- obj = {};
49
- }
50
- return obj;
51
- }
52
-
53
- const hasDarkMode = toBoolean(env.VUE_APP_DARK_MODE);
54
- const hasSourcemap = toBoolean(env.SOURCEMAP);
37
+ const utsJsCodeFormat = env.UNI_UTS_JS_CODE_FORMAT;
38
+ const utsModuleType = env.UNI_UTS_MODULE_TYPE;
39
+ const utsModulePrefix = env.UNI_UTS_MODULE_PREFIX;
40
+ const utsTargetLanguage = env.UNI_UTS_TARGET_LANGUAGE;
41
+ const inputDir = env.UNI_INPUT_DIR;
42
+ const outputDir = env.UNI_OUTPUT_DIR;
43
+ const cliContext = env.UNI_CLI_CONTEXT;
44
+ const subpackage = env.UNI_SUBPACKAGE;
45
+ const mpPlugin = env.UNI_MP_PLUGIN;
55
46
  const isMpPlugin = toBoolean(env.UNI_MP_PLUGIN);
56
- const isMinimize = toBoolean(env.UNI_MINIMIZE);
57
- const isSSRClient = toBoolean(env.UNI_SSR_CLIENT);
58
- const isSSRServer = toBoolean(env.UNI_SSR_SERVER);
59
-
60
- const compiler = env.UNI_COMPILER;
61
- const nvueCompiler = env.UNI_NVUE_COMPILER;
62
- const nvueStyleCompiler = env.UNI_NVUE_STYLE_COMPILER;
63
47
  const compilerVersion = env.UNI_COMPILER_VERSION;
64
48
  const compilerVersionType = env.UNI_COMPILER_VERSION_TYPE;
65
-
66
- const cliContext = env.UNI_CLI_CONTEXT;
67
- const inputDir = env.UNI_INPUT_DIR;
68
- const outputDir = env.UNI_OUTPUT_DIR;
69
- const statTitleJson = parseJSON(
70
- env.STAT_TITLE_JSON
71
- );
72
- const customContext = env.UNI_CUSTOM_CONTEXT;
49
+ const hbuilderxPlugins = env.UNI_HBUILDERX_PLUGINS;
50
+ const renderer = env.UNI_RENDERER;
51
+ const nvueCompiler = env.UNI_NVUE_COMPILER;
52
+ const nvueStyleCompiler = env.UNI_NVUE_STYLE_COMPILER;
53
+ const appCodeSpliting = env.UNI_APP_CODE_SPLITING;
54
+ const automatorWsEndpoint = env.UNI_AUTOMATOR_WS_ENDPOINT;
55
+ const automatorAppWebview = env.UNI_AUTOMATOR_APP_WEBVIEW;
56
+ const automatorAppWebviewSrc = env.UNI_AUTOMATOR_APP_WEBVIEW_SRC;
57
+ const h5Base = env.UNI_H5_BASE;
58
+ const h5Browser = env.UNI_H5_BROWSER;
73
59
  const customScript = env.UNI_CUSTOM_SCRIPT;
74
60
  const customDefine = env.UNI_CUSTOM_DEFINE;
75
- const subpackage = env.UNI_SUBPACKAGE;
76
- const renderer = env.UNI_RENDERER;
61
+ const customContext = env.UNI_CUSTOM_CONTEXT;
62
+ const minimize = env.UNI_MINIMIZE;
63
+ const isMinimize = toBoolean(env.UNI_MINIMIZE);
64
+ const uvue = env.UNI_UVUE;
65
+ const isUVue = toBoolean(env.UNI_MINIMIZE);
66
+ const uvueTargetLanguage = env.UNI_UVUE_TARGET_LANGUAGE;
67
+ const compiler = env.UNI_COMPILER;
77
68
  const rendererNative = env.UNI_RENDERER_NATIVE;
69
+ const nvueAppStyles = env.UNI_NVUE_APP_STYLES;
70
+ const appChangedFiles = env.UNI_APP_CHANGED_FILES;
71
+ const appChangedPages = env.UNI_APP_CHANGED_PAGES;
72
+ const darkMode = env.VUE_APP_DARK_MODE;
73
+ const hasDarkMode = toBoolean(env.VUE_APP_DARK_MODE);
74
+ const hxUseBaseType = env.HX_USE_BASE_TYPE;
75
+ const hxDependenciesDir = env.HX_DEPENDENCIES_DIR;
76
+ const appX = env.UNI_APP_X;
77
+ const isAppX = toBoolean(env.UNI_APP_X);
78
+ const appXCacheDir = env.UNI_APP_X_CACHE_DIR;
79
+ const hxVersion = env.HX_VERSION;
80
+ const appXPageCount = env.UNI_APP_X_PAGE_COUNT;
81
+ const appXTsc = env.UNI_APP_X_TSC;
82
+ const appXSingleThread = env.UNI_APP_X_SINGLE_THREAD;
83
+ const appXSetup = env.UNI_APP_X_SETUP;
84
+ const appXUVueScriptEngine = env.UNI_APP_X_UVUE_SCRIPT_ENGINE;
85
+ const statTitleJson = parseJSON(env.STAT_TITLE_JSON);
86
+ const sourcemap = env.SOURCEMAP;
87
+ const hasSourcemap = toBoolean(env.SOURCEMAP);
88
+ const ssrClient = env.UNI_SSR_CLIENT;
89
+ const isSSRClient = toBoolean(env.UNI_SSR_CLIENT);
90
+ const ssrServer = env.UNI_SSR_SERVER;
91
+ const isSSRServer = toBoolean(env.UNI_SSR_SERVER);
78
92
 
79
- export { appPlatform, builtInPlatforms, cliContext, compiler, compilerVersion, compilerVersionType, customContext, customDefine, customScript, hasDarkMode, hasSourcemap, inputDir, isApp, isAppAndroid, isAppIOS, isH5, isMinimize, isMp, isMpAlipay, isMpBaidu, isMpKuaishou, isMpPlugin, isMpQQ, isMpToutiao, isMpWeixin, isQuickapp, isQuickappHuawei, isQuickappUnion, isSSRClient, isSSRServer, nvueCompiler, nvueStyleCompiler, outputDir, platform, renderer, rendererNative, statTitleJson, subPlatform, subpackage, utsPlatform };
93
+ export { appChangedFiles, appChangedPages, appCodeSpliting, appPlatform, appX, appXCacheDir, appXPageCount, appXSetup, appXSingleThread, appXTsc, appXUVueScriptEngine, automatorAppWebview, automatorAppWebviewSrc, automatorWsEndpoint, builtInPlatforms, cliContext, compiler, compilerVersion, compilerVersionType, customContext, customDefine, customScript, darkMode, h5Base, h5Browser, hasDarkMode, hasSourcemap, hbuilderxPlugins, hxDependenciesDir, hxUseBaseType, hxVersion, inputDir, isApp, isAppAndroid, isAppIOS, isAppPlus, isAppX, isH5, isMinimize, isMp, isMpAlipay, isMpBaidu, isMpKuaishou, isMpPlugin, isMpQQ, isMpToutiao, isMpWeixin, isQuickapp, isQuickappHuawei, isQuickappUnion, isSSRClient, isSSRServer, isUVue, isWeb, minimize, mpPlugin, nvueAppStyles, nvueCompiler, nvueStyleCompiler, outputDir, platform, renderer, rendererNative, sourcemap, ssrClient, ssrServer, statTitleJson, subPlatform, subpackage, utsJsCodeFormat, utsModulePrefix, utsModuleType, utsPlatform, utsTargetLanguage, uvue, uvueTargetLanguage };