vite-uni-dev-tool 0.0.12 → 0.0.14
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/const.d.ts +133 -0
- package/dist/const.d.ts.map +1 -0
- package/dist/const.js +36 -0
- package/dist/core.d.ts +52 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +80 -0
- package/dist/devConsole/index.d.ts +169 -0
- package/dist/devConsole/index.d.ts.map +1 -0
- package/dist/devConsole/index.js +270 -0
- package/dist/devEvent/index.d.ts +286 -0
- package/dist/devEvent/index.d.ts.map +1 -0
- package/dist/devEvent/index.js +435 -0
- package/dist/devEventBus/index.d.ts +42 -0
- package/dist/devEventBus/index.d.ts.map +1 -0
- package/dist/devEventBus/index.js +70 -0
- package/dist/devIntercept/index.d.ts +119 -0
- package/dist/devIntercept/index.d.ts.map +1 -0
- package/dist/devIntercept/index.js +582 -0
- package/dist/devRunJS/index.d.ts +67 -0
- package/dist/devRunJS/index.d.ts.map +1 -0
- package/dist/devStore/index.d.ts +178 -0
- package/dist/devStore/index.d.ts.map +1 -0
- package/dist/devStore/index.js +395 -0
- package/dist/devToolInfo/index.d.ts +17 -0
- package/dist/devToolInfo/index.d.ts.map +1 -0
- package/dist/devToolInfo/index.js +15 -0
- package/{dev → dist}/plugins/uniDevTool/uniDevTool.d.ts +7 -1
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -0
- package/dist/plugins/uniDevTool/uniDevTool.js +35 -0
- package/{dev → dist}/plugins/utils/index.d.ts +3 -0
- package/{dev → dist}/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +1 -0
- package/dist/type.d.ts +264 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/utils/array.d.ts +2 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +12 -0
- package/dist/utils/date.d.ts +19 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +40 -0
- package/dist/utils/file.d.ts +11 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +87 -0
- package/dist/utils/function.d.ts +28 -0
- package/dist/utils/function.d.ts.map +1 -0
- package/dist/utils/function.js +46 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +55 -0
- package/dist/utils/ip.d.ts +5 -0
- package/dist/utils/ip.d.ts.map +1 -0
- package/dist/utils/ip.js +21 -0
- package/dist/utils/language.d.ts +29 -0
- package/dist/utils/language.d.ts.map +1 -0
- package/dist/utils/language.js +50 -0
- package/dist/utils/object.d.ts +49 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/object.js +118 -0
- package/dist/utils/page.d.ts +7 -0
- package/dist/utils/page.d.ts.map +1 -0
- package/dist/utils/page.js +7 -0
- package/dist/utils/platform.d.ts +4 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +14 -0
- package/dist/utils/string.d.ts +45 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +88 -0
- package/dist/utils/utils.d.ts +16 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/v2/AppInfo/index.vue +41 -0
- package/dist/v2/AutoSizer/index.vue +189 -0
- package/dist/v2/AutoSizer/index1.vue +193 -0
- package/dist/v2/AutoSizer/utils.d.ts +5 -0
- package/dist/v2/AutoSizer/utils.d.ts.map +1 -0
- package/dist/v2/CaptureScreen/index.vue +78 -0
- package/dist/v2/CloseButton/index.vue +32 -0
- package/dist/v2/Connection/index.vue +94 -0
- package/dist/v2/ConsoleList/ConsoleItem.vue +235 -0
- package/dist/v2/ConsoleList/RunJSInput.vue +243 -0
- package/dist/v2/ConsoleList/index.vue +164 -0
- package/dist/v2/ConsoleList/staticTips.js +1144 -0
- package/dist/v2/DevTool/index.vue +162 -0
- package/dist/v2/DevToolButton/index.vue +228 -0
- package/dist/v2/DevToolTitle/index.vue +28 -0
- package/dist/v2/DevToolWindow/index.vue +1051 -0
- package/dist/v2/DeviceInfo/index.vue +48 -0
- package/dist/v2/Empty/index.vue +40 -0
- package/dist/v2/FilterInput/index.vue +100 -0
- package/dist/v2/JsonPretty/components/Brackets/index.vue +30 -0
- package/dist/v2/JsonPretty/components/Carets/index.vue +65 -0
- package/dist/v2/JsonPretty/components/CheckController/index.vue +127 -0
- package/dist/v2/JsonPretty/components/TreeNode/index.vue +417 -0
- package/dist/v2/JsonPretty/hooks/useClipboard.d.ts +4 -0
- package/dist/v2/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
- package/dist/v2/JsonPretty/hooks/useError.d.ts +8 -0
- package/dist/v2/JsonPretty/hooks/useError.d.ts.map +1 -0
- package/dist/v2/JsonPretty/index.vue +531 -0
- package/dist/v2/JsonPretty/type.d.ts +93 -0
- package/dist/v2/JsonPretty/type.d.ts.map +1 -0
- package/dist/v2/JsonPretty/utils/index.js +211 -0
- package/dist/v2/NetworkList/NetworkDetail.vue +215 -0
- package/dist/v2/NetworkList/NetworkItem.vue +135 -0
- package/dist/v2/NetworkList/index.vue +148 -0
- package/dist/v2/PiniaList/index.vue +79 -0
- package/dist/v2/RouteList/index.vue +137 -0
- package/dist/v2/SettingList/index.vue +318 -0
- package/dist/v2/SourceCode/index.vue +237 -0
- package/dist/v2/StorageList/index.vue +165 -0
- package/dist/v2/SystemInfo/index.vue +49 -0
- package/dist/v2/Tabs/index.vue +127 -0
- package/dist/v2/Tag/index.vue +91 -0
- package/dist/v2/UniEvent/UniEventItem.vue +157 -0
- package/dist/v2/UniEvent/index.vue +127 -0
- package/dist/v2/UploadList/UploadDetail.vue +204 -0
- package/dist/v2/UploadList/UploadItem.vue +134 -0
- package/dist/v2/UploadList/index.vue +143 -0
- package/dist/v2/VirtualList/index.vue +140 -0
- package/dist/v2/VirtualListPro/AutoSize.vue +50 -0
- package/dist/v2/VirtualListPro/index.vue +255 -0
- package/dist/v2/VuexList/index.vue +80 -0
- package/dist/v2/WebSocket/WebSocketItem.vue +129 -0
- package/dist/v2/WebSocket/WebSocketList.vue +183 -0
- package/dist/v2/WebSocket/index.vue +155 -0
- package/dist/v2/WindowInfo/index.vue +49 -0
- package/{dev/components → dist/v3}/AppInfo/index.vue +0 -1
- package/dist/v3/AutoSizer/utils.d.ts +5 -0
- package/dist/v3/AutoSizer/utils.d.ts.map +1 -0
- package/dist/v3/AutoSizer/utils.ts +49 -0
- package/{dev/components → dist/v3}/CloseButton/index.vue +5 -2
- package/{dev/components → dist/v3}/ConsoleList/ConsoleItem.vue +10 -9
- package/{dev/components → dist/v3}/ConsoleList/RunJSInput.vue +5 -2
- package/dist/v3/ConsoleList/staticTips.d.ts +13 -0
- package/dist/v3/ConsoleList/staticTips.d.ts.map +1 -0
- package/{dev/components → dist/v3}/DevTool/index.vue +33 -4
- package/{dev/components → dist/v3}/DevToolWindow/index.vue +67 -4
- package/dist/v3/Empty/empty.png +0 -0
- package/{dev/components → dist/v3}/FilterInput/index.vue +5 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +4 -0
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
- package/dist/v3/JsonPretty/hooks/useClipboard.ts +21 -0
- package/dist/v3/JsonPretty/hooks/useError.d.ts +8 -0
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +1 -0
- package/dist/v3/JsonPretty/hooks/useError.ts +21 -0
- package/{dev/components → dist/v3}/JsonPretty/index.vue +10 -10
- package/dist/v3/JsonPretty/type.d.ts +93 -0
- package/dist/v3/JsonPretty/type.d.ts.map +1 -0
- package/dist/v3/JsonPretty/type.ts +125 -0
- package/dist/v3/JsonPretty/utils/index.d.ts +10 -0
- package/dist/v3/JsonPretty/utils/index.d.ts.map +1 -0
- package/{dev/components → dist/v3}/NetworkList/NetworkDetail.vue +2 -2
- package/{dev/components → dist/v3}/NetworkList/NetworkItem.vue +2 -1
- package/dist/v3/RunJS/index.vue +128 -0
- package/{dev/components → dist/v3}/SettingList/index.vue +128 -37
- package/{dev/components → dist/v3}/SourceCode/index.vue +2 -2
- package/{dev/components → dist/v3}/Tag/index.vue +4 -4
- package/{dev/components → dist/v3}/UploadList/UploadDetail.vue +3 -15
- package/{dev/components → dist/v3}/UploadList/UploadItem.vue +1 -1
- package/dist/v3/VirtualListPro/readme.md +40 -0
- package/{dev/components → dist/v3}/WebSocket/WebSocketItem.vue +1 -1
- package/{dev/components → dist/v3}/WebSocket/WebSocketList.vue +3 -15
- package/package.json +5 -5
- package/dev/components/Button/index.vue +0 -34
- package/dev/components/Checkbox/index.vue +0 -40
- package/dev/components/Code/index.vue +0 -230
- package/dev/components/ConsoleList/Code.vue +0 -227
- package/dev/const.ts +0 -164
- package/dev/core.ts +0 -118
- package/dev/devConsole/index.ts +0 -350
- package/dev/devEvent/index.ts +0 -810
- package/dev/devEventBus/index.ts +0 -94
- package/dev/devIntercept/index.ts +0 -745
- package/dev/devRunJS/index.ts +0 -170
- package/dev/devStore/index.ts +0 -732
- package/dev/devToolInfo/index.ts +0 -26
- package/dev/plugins/uniDevTool/uniDevTool.d.ts.map +0 -1
- package/dev/plugins/uniDevTool/uniDevTool.js +0 -36
- package/dev/plugins/utils/index.js +0 -1
- package/dev/shims-uni.d.ts +0 -43
- package/dev/type.ts +0 -291
- package/dev/utils/array.ts +0 -15
- package/dev/utils/date.ts +0 -75
- package/dev/utils/file.ts +0 -121
- package/dev/utils/function.ts +0 -192
- package/dev/utils/index.d.ts +0 -6
- package/dev/utils/index.ts +0 -51
- package/dev/utils/ip.ts +0 -79
- package/dev/utils/language.ts +0 -77
- package/dev/utils/object.ts +0 -306
- package/dev/utils/page.ts +0 -13
- package/dev/utils/platform.ts +0 -14
- package/dev/utils/string.ts +0 -133
- package/dev/utils/utils.ts +0 -198
- /package/{dev → dist}/index.d.ts +0 -0
- /package/{dev → dist}/index.d.ts.map +0 -0
- /package/{dev → dist}/index.js +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.js +0 -0
- /package/{dev/components → dist/v2}/AutoSizer/utils.ts +0 -0
- /package/{dev/components → dist/v2}/Empty/empty.png +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/hooks/useClipboard.ts +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/hooks/useError.ts +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/type.ts +0 -0
- /package/{dev/components → dist/v2}/RunJS/index.vue +0 -0
- /package/{dev/components → dist/v2}/VirtualListPro/readme.md +0 -0
- /package/{dev/components → dist/v3}/AutoSizer/index.vue +0 -0
- /package/{dev/components → dist/v3}/AutoSizer/index1.vue +0 -0
- /package/{dev/components → dist/v3}/CaptureScreen/index.vue +0 -0
- /package/{dev/components → dist/v3}/Connection/index.vue +0 -0
- /package/{dev/components → dist/v3}/ConsoleList/index.vue +0 -0
- /package/{dev/components → dist/v3}/ConsoleList/staticTips.ts +0 -0
- /package/{dev/components → dist/v3}/DevToolButton/index.vue +0 -0
- /package/{dev/components → dist/v3}/DevToolTitle/index.vue +0 -0
- /package/{dev/components → dist/v3}/DeviceInfo/index.vue +0 -0
- /package/{dev/components → dist/v3}/Empty/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/Brackets/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/Carets/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/CheckController/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/TreeNode/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/utils/index.ts +0 -0
- /package/{dev/components → dist/v3}/NetworkList/index.vue +0 -0
- /package/{dev/components → dist/v3}/PiniaList/index.vue +0 -0
- /package/{dev/components → dist/v3}/RouteList/index.vue +0 -0
- /package/{dev/components → dist/v3}/StorageList/index.vue +0 -0
- /package/{dev/components → dist/v3}/SystemInfo/index.vue +0 -0
- /package/{dev/components → dist/v3}/Tabs/index.vue +0 -0
- /package/{dev/components → dist/v3}/UniEvent/UniEventItem.vue +0 -0
- /package/{dev/components → dist/v3}/UniEvent/index.vue +0 -0
- /package/{dev/components → dist/v3}/UploadList/index.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualList/index.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualListPro/AutoSize.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualListPro/index.vue +0 -0
- /package/{dev/components → dist/v3}/VuexList/index.vue +0 -0
- /package/{dev/components → dist/v3}/WebSocket/index.vue +0 -0
- /package/{dev/components → dist/v3}/WindowInfo/index.vue +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";const C=require("path"),T=require("fs"),o=require("../utils/index.js");function I(l){const v=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const u in l)if(u!=="default"){const d=Object.getOwnPropertyDescriptor(l,u);Object.defineProperty(v,u,d.get?d:{enumerable:!0,get:()=>l[u]})}}return v.default=l,Object.freeze(v)}const y=I(C),w=I(T),_=/<script[^>]*>([\s\S]*?)<\/script>/,S={isReady:!1,urls:[]};function D({pages:l,sourceFileServers:v,importConsole:u,vueVersion:d=3,...$}){return{name:"vite-uni-dev-tool",enforce:"pre",configureServer(t){var a;t.middlewares.use((i,n,e)=>{const{originalUrl:r}=i;if($.useDevSource&&(r!=null&&r.includes("__dev_sourcefile__"))){const c=r.replace("/__dev_sourcefile__","");try{const p=t.config.root,f=y.join(p,c),s=w.readFileSync(f,"utf-8");n.setHeader("Content-Type",o.getContentType(f)),n.end(s)}catch{e()}}else e()}),(a=t.httpServer)==null||a.once("listening",()=>{var e;const i=(e=t.httpServer)==null?void 0:e.address(),n=o.getLocalIPs();if(i&&!Array.isArray(i)&&typeof i!="string"){const r=n.map(c=>`http://${c}:${i.port}/__dev_sourcefile__`);S.isReady=!0,S.urls=r,console.warn(`
|
|
2
|
+
⚡️ vite-uni-dev-tool source file server running at:
|
|
3
|
+
${n.map(c=>`➜ Source File Network: http://${c}:${i==null?void 0:i.port}/__dev_sourcefile__`).join(`
|
|
4
|
+
`)}
|
|
5
|
+
`)}})},transform(t,a){var i;if(a.endsWith("/src/main.ts")||a.endsWith("/src/main.js"))try{if(![2,3].includes(d))throw new Error("vite-uni-dev-tool: vueVersion 只支持 2 , 3");const n=t.split(`
|
|
6
|
+
`);let e=[...n];const r=o.findInsertionIndex(e,p=>p.trim().startsWith("import")||p.trim().startsWith("export"));r!==-1&&e.splice(r,0,`import DevTool from 'vite-uni-dev-tool/dist/v${d}/DevTool/index.vue';`);const c=o.findInsertionIndex(e,p=>p.includes(".mount(")||p.includes("createApp("));if(c!==-1&&e.splice(c+1,0," app.component('DevTool', DevTool);"),e.length!==n.length)return{code:e.join(`
|
|
7
|
+
`),map:null}}catch(n){return console.error("[DevTool] 转换 main 文件时出错:",n),{code:t,map:null}}if(a.endsWith("/src/App.vue")){const n=t.match(_);if(n&&n[1]){const e=n[1].trim(),r=o.hasImportCurrentInstance(e),c=o.hasImportOnLaunch(e),p=r?"":"import { getCurrentInstance } from 'vue'",f=c?"":"import { onLaunch } from '@dcloudio/uni-app'",s=`
|
|
8
|
+
import { initDevTool${u?", console":""} } from 'vite-uni-dev-tool/dist/core';
|
|
9
|
+
import pagesJson from './pages.json';
|
|
10
|
+
${e}
|
|
11
|
+
onLaunch(() => {
|
|
12
|
+
const vue3instance = getCurrentInstance();
|
|
13
|
+
initDevTool({
|
|
14
|
+
pagesJson,
|
|
15
|
+
vue3instance,
|
|
16
|
+
mode: import.meta.env.MODE,
|
|
17
|
+
sourceFileServers: [
|
|
18
|
+
${[...S.urls??[],...v??[]].map(g=>`'${g}'`)}
|
|
19
|
+
],
|
|
20
|
+
...${JSON.stringify($)},
|
|
21
|
+
});
|
|
22
|
+
});`;return{code:t.replace(_,`
|
|
23
|
+
<script lang="ts" setup>
|
|
24
|
+
${p}
|
|
25
|
+
${f}
|
|
26
|
+
${s}
|
|
27
|
+
<\/script>`),map:null}}return{code:t,map:null}}if(a.endsWith(".vue")){const n=t.includes("<template>"),e=l.pages.some(s=>a.includes(s.path)),r=(i=l.subPackages)==null?void 0:i.some(s=>s.pages.some(m=>a.includes(`${s.root}/${m.path}`))),c=["<DevTool />"],p=o.hasImportConsole(t),f=o.hasUseConsole(t);if(!p&&f&&!a.endsWith("/src/App.vue")){const s=t.match(_);if(s&&s[1]){const m=s[1],g=`
|
|
28
|
+
${u?"import { console } from 'vite-uni-dev-tool/dist/core';":""}
|
|
29
|
+
${m}
|
|
30
|
+
`;let h="<script>";o.hasLangTS(t)||o.hasSetup(t)?h='<script lang="ts" setup>':o.hasLangJS(t)||o.hasSetup(t)?h='<script lang="js" setup>':o.hasLangJS(t)?h='<script lang="js">':o.hasLangTS(t)?h='<script lang="ts">':o.hasSetup(t)&&(h="<script setup>"),t=t.replace(_,`
|
|
31
|
+
${h}
|
|
32
|
+
${g}
|
|
33
|
+
<\/script>`)}}if((e||r)&&n){const s=o.getTemplateContent(t);let m=t;if(s){const g=`<view>${s}
|
|
34
|
+
${c.join(`
|
|
35
|
+
`)}</view>`;m=t.replace(s,g)}return{code:m,map:null}}}return{code:t,map:null}}}}module.exports=D;
|
|
@@ -5,6 +5,9 @@ export declare function hasImportOnLaunch(str: string): boolean;
|
|
|
5
5
|
export declare function hasImportCurrentInstance(str: string): boolean;
|
|
6
6
|
export declare function hasImportConsole(str: string): boolean;
|
|
7
7
|
export declare function hasUseConsole(str: string): boolean;
|
|
8
|
+
export declare function hasLangTS(code: string): boolean;
|
|
9
|
+
export declare function hasLangJS(code: string): boolean;
|
|
10
|
+
export declare function hasSetup(code: string): boolean;
|
|
8
11
|
/**
|
|
9
12
|
* 解析栈信息
|
|
10
13
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../plugins/src/plugins/utils/index.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAChC,K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wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE7D;AAID,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAElD;AAID,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,WAarC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,WAWrC;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,WAYpC;AAID;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM;;;;;EAQvC;AAGD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,UAGtC;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,UAGvC;AAID;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,UAG5C;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,OA4BnD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,UAqD9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("path"),h=require("os");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const m=u(f),d=u(h);function x(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n+1;return-1}function I(t){const e=m.extname(t).toLowerCase();return{".html":"text/html",".js":"text/javascript",".css":"text/css",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".woff":"font/woff",".woff2":"font/woff2"}[e]||"text/plain"}function y(){const t=d.networkInterfaces(),e=[];return Object.keys(t).forEach(n=>{var s;t!=null&&t[n]&&Array.isArray(t==null?void 0:t[n])&&((s=t==null?void 0:t[n])==null||s.forEach(r=>{r.family==="IPv4"&&!r.internal&&e.push(r.address)}))}),e.push("localhost"),e}const S=/import\s*\{[^}]*onLaunch[^}]*\}\s*from\s+['"]@dcloudio\/uni-app['"];?/;function T(t){return S.test(t)}const L=/import\s*\{[^}]*getCurrentInstance[^}]*\}\s*from\s+['"]vue['"];?/;function j(t){return L.test(t)}const C=/import\s*\{[^}]*console[^}]*\}\s*from\s+['"]vite-uni-dev-tool['"];?/;function b(t){return C.test(t)}const w=/console\.\w+\(/;function v(t){return w.test(t)}const i=/<script[^>]*>/;function O(t){const e=t.match(i);if(!e)return!1;const n=e[0];return/lang=['"]ts['"]/.test(n)}function P(t){const e=t.match(i);if(!e)return!1;const n=e[0];return/lang=['"]js['"]/.test(n)}function R(t){const e=t.match(i);if(!e)return!1;const n=e[0];return/\ssetup(?=\s|>)/.test(n)}function M(t){let e=0,n=-1,s=-1,r="";const l=/<template(\s[^>]*)?>/g,p=/<\/template>/g,c=[];let a;for(;(a=l.exec(t))!==null;)c.push({index:a.index,type:"start",length:a[0].length});for(;(a=p.exec(t))!==null;)c.push({index:a.index,type:"end",length:a[0].length});c.sort((o,g)=>o.index-g.index);for(const o of c)if(o.type==="start")e===0&&(n=o.index+o.length),e++;else if(o.type==="end"&&(e--,e===0)){s=o.index,r=t.substring(n,s);break}return r.trim()}exports.findInsertionIndex=x;exports.getContentType=I;exports.getLocalIPs=y;exports.getTemplateContent=M;exports.hasImportConsole=b;exports.hasImportCurrentInstance=j;exports.hasImportOnLaunch=T;exports.hasLangJS=P;exports.hasLangTS=O;exports.hasSetup=R;exports.hasUseConsole=v;
|
package/dist/type.d.ts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { DevEvent } from './devEvent';
|
|
2
|
+
|
|
3
|
+
export declare namespace DevTool {
|
|
4
|
+
type Page = {
|
|
5
|
+
index?: number;
|
|
6
|
+
path: string;
|
|
7
|
+
sort?: number;
|
|
8
|
+
name?: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
style: {
|
|
11
|
+
navigationBarTitleText?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type Message = {
|
|
15
|
+
type: 'success' | 'error';
|
|
16
|
+
data: string;
|
|
17
|
+
time: number;
|
|
18
|
+
};
|
|
19
|
+
type WS = {
|
|
20
|
+
url: string;
|
|
21
|
+
/**
|
|
22
|
+
* -1: error
|
|
23
|
+
* 0:connecting
|
|
24
|
+
* 1:open
|
|
25
|
+
* 2:closing
|
|
26
|
+
* 3:closed
|
|
27
|
+
*/
|
|
28
|
+
readyState?: string;
|
|
29
|
+
headers?: {
|
|
30
|
+
key: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}[];
|
|
33
|
+
method?: string;
|
|
34
|
+
protocols?: string[];
|
|
35
|
+
message: Message[];
|
|
36
|
+
};
|
|
37
|
+
type Nav = {
|
|
38
|
+
pagePath: string;
|
|
39
|
+
text: string;
|
|
40
|
+
};
|
|
41
|
+
type PagesJSON = {
|
|
42
|
+
pages: Page[];
|
|
43
|
+
subPackages?: {
|
|
44
|
+
root: string;
|
|
45
|
+
pages: Page[];
|
|
46
|
+
}[];
|
|
47
|
+
tabBar: {
|
|
48
|
+
list: Nav[];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
type DevToolOptions = {
|
|
52
|
+
/** 是否拦截Promise.reject 最好不要拦截 默认禁用 */
|
|
53
|
+
enableInterceptPromiseReject?: boolean;
|
|
54
|
+
/** 打开窗口时隐藏按钮 */
|
|
55
|
+
openWindowHideButton?: boolean;
|
|
56
|
+
/** 最大的console条数 */
|
|
57
|
+
consoleMaxSize?: number;
|
|
58
|
+
/** 最大的网络请求条数 */
|
|
59
|
+
networkMaxSize?: number;
|
|
60
|
+
/** 最大的上传文件条数 */
|
|
61
|
+
uploadMaxSize?: number;
|
|
62
|
+
/** 最大的套接字消息条数 */
|
|
63
|
+
wsDataMaxSize?: number;
|
|
64
|
+
/** 最大的时间列表条数 */
|
|
65
|
+
eventListMaxSize?: number;
|
|
66
|
+
/** 最大截屏记录条数 */
|
|
67
|
+
captureScreenMaxSize?: number;
|
|
68
|
+
/** 最大占用缓存空间 */
|
|
69
|
+
cacheMaxSize?: number;
|
|
70
|
+
/** 所有路由信息 */
|
|
71
|
+
pagesJson?: PagesJSON;
|
|
72
|
+
/** 源文件服务地址 */
|
|
73
|
+
sourceFileServers?: string[];
|
|
74
|
+
/** 用于区分生产环境和开发环境,开发环境下,为了获取 Android 异常栈源码会获取本地源码进行展示 */
|
|
75
|
+
mode: string;
|
|
76
|
+
/** 用于捕获 vue3 抛出的错误和警告 */
|
|
77
|
+
vue3instance?: any;
|
|
78
|
+
/**
|
|
79
|
+
* 该属性处于实验当中,谨慎使用
|
|
80
|
+
* 读取开发环境 source file,source map,默认 禁用
|
|
81
|
+
*/
|
|
82
|
+
useDevSource?: boolean;
|
|
83
|
+
/** 层级默认 1000 */
|
|
84
|
+
zIndex?: number;
|
|
85
|
+
} & ButtonOptions;
|
|
86
|
+
type ButtonOptions = Partial<{
|
|
87
|
+
/** 按钮大小 */
|
|
88
|
+
buttonSize: number;
|
|
89
|
+
/** 按钮文本 */
|
|
90
|
+
buttonText: string;
|
|
91
|
+
/** 按钮文本颜色 */
|
|
92
|
+
buttonColor: string;
|
|
93
|
+
/** 按钮字体大小 */
|
|
94
|
+
buttonFontSize: string;
|
|
95
|
+
/** 按钮背景颜色 */
|
|
96
|
+
buttonBackgroundColor: string;
|
|
97
|
+
/** 初始化时是否显示调试按钮,默认显示 */
|
|
98
|
+
initShowDevTool: boolean;
|
|
99
|
+
}>;
|
|
100
|
+
type NetworkItem = {
|
|
101
|
+
index: number;
|
|
102
|
+
url: string;
|
|
103
|
+
name: string;
|
|
104
|
+
method: string;
|
|
105
|
+
status: number | string;
|
|
106
|
+
time: string;
|
|
107
|
+
startTime: number;
|
|
108
|
+
endTime: number;
|
|
109
|
+
size: string;
|
|
110
|
+
headers: {
|
|
111
|
+
requestHeader: {
|
|
112
|
+
key: string;
|
|
113
|
+
value: any;
|
|
114
|
+
}[];
|
|
115
|
+
responseHeader: {
|
|
116
|
+
key: string;
|
|
117
|
+
value: any;
|
|
118
|
+
}[];
|
|
119
|
+
};
|
|
120
|
+
response: string;
|
|
121
|
+
payload: any;
|
|
122
|
+
};
|
|
123
|
+
type StorageItem = {
|
|
124
|
+
key: string;
|
|
125
|
+
_oldKey: string;
|
|
126
|
+
value: string;
|
|
127
|
+
};
|
|
128
|
+
/** 调试工具目前支持处理的console类型 */
|
|
129
|
+
type ConsoleType = 'log' | 'info' | 'warn' | 'error' | 'timeEnd' | 'time' | 'clear' | 'count';
|
|
130
|
+
/** 不支持处理的console类型 */
|
|
131
|
+
type OriginalConsoleType = 'assert' | 'count' | 'countReset' | 'debug' | 'dir' | 'dirxml' | 'group' | 'groupCollapsed' | 'groupEnd' | 'table' | 'trace' | 'profile' | 'profileEnd' | 'timeStamp';
|
|
132
|
+
type ValueType = 'number' | 'string' | 'boolean' | 'null' | 'undefined' | 'symbol' | 'array' | 'object';
|
|
133
|
+
type Arg = {
|
|
134
|
+
type: ValueType;
|
|
135
|
+
value: any;
|
|
136
|
+
};
|
|
137
|
+
type ConsoleItem = {
|
|
138
|
+
type: string;
|
|
139
|
+
args: Arg[];
|
|
140
|
+
position: string;
|
|
141
|
+
time: string;
|
|
142
|
+
stack?: string;
|
|
143
|
+
/**
|
|
144
|
+
* input 输入
|
|
145
|
+
* output 输出
|
|
146
|
+
*/
|
|
147
|
+
mode?: 'input' | 'output';
|
|
148
|
+
};
|
|
149
|
+
type UploadItem = {
|
|
150
|
+
index: number;
|
|
151
|
+
url?: string;
|
|
152
|
+
filePath?: string;
|
|
153
|
+
formData?: Record<string, any>;
|
|
154
|
+
method?: string;
|
|
155
|
+
headers?: {
|
|
156
|
+
requestHeader?: {
|
|
157
|
+
key: string;
|
|
158
|
+
value: unknown;
|
|
159
|
+
}[];
|
|
160
|
+
responseHeader?: {
|
|
161
|
+
key: string;
|
|
162
|
+
value: unknown;
|
|
163
|
+
}[];
|
|
164
|
+
};
|
|
165
|
+
response?: Record<string, any>;
|
|
166
|
+
files?: any[];
|
|
167
|
+
fileType?: string;
|
|
168
|
+
name?: string;
|
|
169
|
+
status: number | string;
|
|
170
|
+
timeout?: number;
|
|
171
|
+
startTime?: number;
|
|
172
|
+
endTime?: number;
|
|
173
|
+
/** 上传进度 */
|
|
174
|
+
progress?: number;
|
|
175
|
+
/** 已上传长度 */
|
|
176
|
+
totalBytesSent?: number;
|
|
177
|
+
/** 预计上传总长度 */
|
|
178
|
+
totalBytesExpectedToSend?: number;
|
|
179
|
+
};
|
|
180
|
+
type EventCount = {
|
|
181
|
+
on: number;
|
|
182
|
+
once: number;
|
|
183
|
+
emit: number;
|
|
184
|
+
off: number;
|
|
185
|
+
};
|
|
186
|
+
type EventCountKey = keyof EventCount;
|
|
187
|
+
type EventItem = {
|
|
188
|
+
/** 事件名称 */
|
|
189
|
+
eventName?: string;
|
|
190
|
+
/** 触发事件 */
|
|
191
|
+
timer?: string;
|
|
192
|
+
/** 调用位置 */
|
|
193
|
+
stack?: string;
|
|
194
|
+
/** 事件类型 */
|
|
195
|
+
type?: string;
|
|
196
|
+
};
|
|
197
|
+
type RunJSItem = {
|
|
198
|
+
/** 代码 */
|
|
199
|
+
code?: string;
|
|
200
|
+
/** 结果 */
|
|
201
|
+
result?: any;
|
|
202
|
+
/** 开始时间 */
|
|
203
|
+
timer?: string;
|
|
204
|
+
/** 执行用时 */
|
|
205
|
+
duration?: number;
|
|
206
|
+
/** 执行状态 */
|
|
207
|
+
type?: string;
|
|
208
|
+
mode?: 'input' | 'output';
|
|
209
|
+
};
|
|
210
|
+
type CaptureScreenItem = {
|
|
211
|
+
position: string;
|
|
212
|
+
timer: string;
|
|
213
|
+
};
|
|
214
|
+
type WindowData = {
|
|
215
|
+
devToolVisible?: boolean;
|
|
216
|
+
consoleList?: ConsoleItem[];
|
|
217
|
+
networkList?: NetworkItem[];
|
|
218
|
+
storageList?: StorageItem[];
|
|
219
|
+
routeList?: Page[];
|
|
220
|
+
vuexList?: Record<string, any>;
|
|
221
|
+
piniaList?: Record<string, any>;
|
|
222
|
+
systemInfo?: Record<string, any>;
|
|
223
|
+
deviceInfo?: Record<string, any>;
|
|
224
|
+
windowInfo?: Record<string, any>;
|
|
225
|
+
netWorkStatus?: Record<string, any>;
|
|
226
|
+
appInfo?: Record<string, any>;
|
|
227
|
+
wsList?: WS[];
|
|
228
|
+
size?: number;
|
|
229
|
+
sizeFormat?: string;
|
|
230
|
+
uploadList?: UploadItem[];
|
|
231
|
+
eventCount?: EventCount;
|
|
232
|
+
eventList?: EventItem[];
|
|
233
|
+
captureScreenList?: CaptureScreenItem[];
|
|
234
|
+
};
|
|
235
|
+
type DevInterceptOptions = {
|
|
236
|
+
event: DevEvent;
|
|
237
|
+
enableInterceptPromiseReject?: boolean;
|
|
238
|
+
};
|
|
239
|
+
type DevToolInfo = {
|
|
240
|
+
/** 是否销毁 */
|
|
241
|
+
devToolDestroy?: boolean;
|
|
242
|
+
/** 按钮状态 */
|
|
243
|
+
devToolButtonVisible?: boolean;
|
|
244
|
+
/** 窗口状态 */
|
|
245
|
+
devToolWindowVisible?: boolean;
|
|
246
|
+
/** 按钮位置 */
|
|
247
|
+
top?: string;
|
|
248
|
+
/** 按钮位置 */
|
|
249
|
+
left?: string;
|
|
250
|
+
/** 当前活动tab */
|
|
251
|
+
activeTab?: number;
|
|
252
|
+
/** 当前console类型 */
|
|
253
|
+
currentConsoleType?: string;
|
|
254
|
+
/** 当前network类型 */
|
|
255
|
+
currentNetworkType?: string;
|
|
256
|
+
/** 当前websocket类型 */
|
|
257
|
+
currentWebSocketType?: string;
|
|
258
|
+
/** table滚动位置 */
|
|
259
|
+
tabScrollLeft?: number;
|
|
260
|
+
/** 颜色主题 */
|
|
261
|
+
theme?: string;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../dev/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,KAAK,IAAI,GAAG;QACV,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,EAAE;YACL,sBAAsB,CAAC,EAAE,MAAM,CAAC;SACjC,CAAC;KACH,CAAC;IAEF,KAAK,OAAO,GAAG;QACb,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,KAAK,EAAE,GAAG;QACR,GAAG,EAAE,MAAM,CAAC;QACZ;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,CAAC;KACpB,CAAC;IAEF,KAAK,GAAG,GAAG;QACT,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,SAAS,GAAG;QACf,KAAK,EAAE,IAAI,EAAE,CAAC;QACd,WAAW,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,IAA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C;QACvB,WAAW;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../dev/utils/array.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,SAAI,GAAG,CAAC,EAAE,EAAE,CAcpD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function getCurrentDate(): string;
|
|
2
|
+
/**
|
|
3
|
+
* 格式化时间
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @param {(Date | string | number)} date
|
|
7
|
+
* @param {string} format
|
|
8
|
+
* @return {*} {string}
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatDate(date: Date | string | number, format: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* 休眠
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @param {number} ms
|
|
16
|
+
* @return {*}
|
|
17
|
+
*/
|
|
18
|
+
export declare function sleep(ms: number): Promise<unknown>;
|
|
19
|
+
//# sourceMappingURL=date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../dev/utils/date.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,WAa7B;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,EAC5B,MAAM,EAAE,MAAM,GACb,MAAM,CAqCR;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,oBAE/B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function s() {
|
|
2
|
+
const e = /* @__PURE__ */ new Date(), r = e.getFullYear(), t = e.getMonth() + 1, n = e.getDate(), a = e.getHours(), g = e.getMinutes(), o = e.getSeconds();
|
|
3
|
+
return `${r}-${t.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")} ${a.toString().padStart(2, "0")}:${g.toString().padStart(2, "0")}:${o == null ? void 0 : o.toString().padStart(2, "0")}`;
|
|
4
|
+
}
|
|
5
|
+
function S(e, r) {
|
|
6
|
+
let t;
|
|
7
|
+
if (e instanceof Date ? t = e : t = new Date(e), isNaN(t.getTime()))
|
|
8
|
+
throw new Error("Invalid date");
|
|
9
|
+
const n = {
|
|
10
|
+
YYYY: t.getFullYear(),
|
|
11
|
+
MM: String(t.getMonth() + 1).padStart(2, "0"),
|
|
12
|
+
M: t.getMonth() + 1,
|
|
13
|
+
DD: String(t.getDate()).padStart(2, "0"),
|
|
14
|
+
D: t.getDate(),
|
|
15
|
+
HH: String(t.getHours()).padStart(2, "0"),
|
|
16
|
+
H: t.getHours(),
|
|
17
|
+
hh: String(t.getHours() % 12 || 12).padStart(2, "0"),
|
|
18
|
+
h: t.getHours() % 12 || 12,
|
|
19
|
+
mm: String(t.getMinutes()).padStart(2, "0"),
|
|
20
|
+
m: t.getMinutes(),
|
|
21
|
+
ss: String(t.getSeconds()).padStart(2, "0"),
|
|
22
|
+
s: t.getSeconds(),
|
|
23
|
+
SS: String(t.getMilliseconds()).padStart(3, "0"),
|
|
24
|
+
S: t.getMilliseconds(),
|
|
25
|
+
A: t.getHours() >= 12 ? "PM" : "AM",
|
|
26
|
+
a: t.getHours() >= 12 ? "pm" : "am"
|
|
27
|
+
};
|
|
28
|
+
return r.replace(
|
|
29
|
+
/YYYY|MM|DD|HH|hh|mm|ss|SS|A|a|M|D|H|h|m|s|S/g,
|
|
30
|
+
(a) => n[a].toString()
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function i(e) {
|
|
34
|
+
return new Promise((r) => setTimeout(r, e));
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
S as formatDate,
|
|
38
|
+
s as getCurrentDate,
|
|
39
|
+
i as sleep
|
|
40
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取文件路径
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
* @return {*}
|
|
6
|
+
*/
|
|
7
|
+
export declare function getFilePath(): Promise<unknown>;
|
|
8
|
+
export declare function saveTxtFileApp(data: string, fileName: string): Promise<void>;
|
|
9
|
+
export declare function saveTextFileH5(data: string, fileName: string): Promise<void>;
|
|
10
|
+
export declare function saveTextFileMicro(data: string, fileName: string): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../dev/utils/file.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,WAAW,qBAU1B;AAsDD,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAOlE;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAclE;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAyBrE"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
function c() {
|
|
2
|
+
return new Promise((n, t) => {
|
|
3
|
+
plus ? plus.io.resolveLocalFileSystemURL("_downloads", function(o) {
|
|
4
|
+
n(o.fullPath);
|
|
5
|
+
}) : t();
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
function a(n, t) {
|
|
9
|
+
plus.io.requestFileSystem(
|
|
10
|
+
plus.io.PUBLIC_DOCUMENTS,
|
|
11
|
+
function(o) {
|
|
12
|
+
var i;
|
|
13
|
+
(i = o.root) == null || i.getFile(
|
|
14
|
+
n,
|
|
15
|
+
{ create: !0 },
|
|
16
|
+
function(e) {
|
|
17
|
+
e.createWriter(function(l) {
|
|
18
|
+
l.onwriteend = function() {
|
|
19
|
+
console.log("[DevTool] 写入文件成功" + n), uni.showToast({
|
|
20
|
+
icon: "none",
|
|
21
|
+
title: "写入文件成功" + n,
|
|
22
|
+
duration: 10 * 1e3
|
|
23
|
+
});
|
|
24
|
+
}, l.onerror = function(s) {
|
|
25
|
+
console.log("[DevTool] 写入文件失败" + JSON.stringify(s)), uni.showToast({
|
|
26
|
+
icon: "none",
|
|
27
|
+
title: "写入文件失败"
|
|
28
|
+
});
|
|
29
|
+
}, l.write(t);
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
function(e) {
|
|
33
|
+
uni.showToast({
|
|
34
|
+
icon: "none",
|
|
35
|
+
title: "获取文件失败"
|
|
36
|
+
}), console.log("[DevTool] 获取文件失败" + JSON.stringify(e));
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
function(o) {
|
|
41
|
+
uni.showToast({
|
|
42
|
+
icon: "none",
|
|
43
|
+
title: "获取文件系统失败"
|
|
44
|
+
}), console.log("[DevTool] 获取文件系统失败" + JSON.stringify(o));
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
async function u(n, t) {
|
|
49
|
+
try {
|
|
50
|
+
const o = await c() + `${Date.now()}_${t}.txt`;
|
|
51
|
+
a(o, n);
|
|
52
|
+
} catch (o) {
|
|
53
|
+
console.log("[DevTool] " + JSON.stringify(o));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function r(n, t) {
|
|
57
|
+
const o = new Blob([n], { type: "text/plain" }), i = URL.createObjectURL(o), e = document.createElement("a");
|
|
58
|
+
e.href = i, e.download = t, e.click();
|
|
59
|
+
}
|
|
60
|
+
async function f(n, t) {
|
|
61
|
+
var l;
|
|
62
|
+
const o = uni.getFileSystemManager(), i = `${t}_${Date.now()}.txt`, e = `${((l = uni == null ? void 0 : uni.env) == null ? void 0 : l.USER_DATA_PATH) ?? "Download"}/${i}`;
|
|
63
|
+
o.writeFile({
|
|
64
|
+
data: n,
|
|
65
|
+
filePath: e,
|
|
66
|
+
success: (s) => {
|
|
67
|
+
console.log("[DevTool] 写入文件成功" + e), console.log(
|
|
68
|
+
`[DevTool] 文件位置:内部存储/Android/data/comm.tencent.mm/MicroMsg/wxanewfiles/手动查找最新文件夹/${i}`
|
|
69
|
+
), uni.showToast({
|
|
70
|
+
title: "写入文件成功" + e,
|
|
71
|
+
icon: "none"
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
fail: (s) => {
|
|
75
|
+
console.log("[DevTool] 写入文件失败" + JSON.stringify(s)), uni.showToast({
|
|
76
|
+
title: "写入文件失败" + JSON.stringify(s),
|
|
77
|
+
icon: "none"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
c as getFilePath,
|
|
84
|
+
r as saveTextFileH5,
|
|
85
|
+
f as saveTextFileMicro,
|
|
86
|
+
u as saveTxtFileApp
|
|
87
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type ThrottleOptions = {
|
|
2
|
+
leading?: boolean;
|
|
3
|
+
trailing?: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* 创建一个节流函数,在指定时间间隔内只执行一次原函数
|
|
7
|
+
* @param func 需要节流的函数
|
|
8
|
+
* @param wait 等待时间(毫秒)
|
|
9
|
+
* @param options 配置选项
|
|
10
|
+
* @param options.leading 是否在开始时立即执行
|
|
11
|
+
* @param options.trailing 是否在延迟结束后执行最后一次调用
|
|
12
|
+
* @returns 节流后的函数
|
|
13
|
+
*/
|
|
14
|
+
export declare function throttle<T extends (...args: any[]) => any>(func: T, wait: number, options?: ThrottleOptions): (...args: Parameters<T>) => ReturnType<T> | undefined;
|
|
15
|
+
type DebouncedFunction<T extends (...args: any[]) => any> = ((...args: Parameters<T>) => ReturnType<T> | undefined) & {
|
|
16
|
+
cancel: () => void;
|
|
17
|
+
flush: () => ReturnType<T> | undefined;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 创建一个防抖函数,该函数在最后一次调用后等待指定时间才执行。
|
|
21
|
+
* @param func 需要防抖的函数
|
|
22
|
+
* @param wait 等待时间(毫秒)
|
|
23
|
+
* @param immediate 是否在第一次调用时立即执行
|
|
24
|
+
* @returns 防抖后的函数
|
|
25
|
+
*/
|
|
26
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number, immediate?: boolean): DebouncedFunction<T>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../dev/utils/function.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAoB,GAC5B,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAmFvD;AAED,KAAK,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,CAC3D,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KACnB,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG;IAChC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,OAAe,GACzB,iBAAiB,CAAC,CAAC,CAAC,CAqEtB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function C(c, s, a = {}) {
|
|
2
|
+
let l = null, n = null, e = null, r, u = null;
|
|
3
|
+
const { leading: m = !0, trailing: f = !0 } = a, i = (t) => {
|
|
4
|
+
const o = n, T = e;
|
|
5
|
+
return n = e = null, u = t, r = c.apply(T, o), r;
|
|
6
|
+
}, g = (t) => (u = t, l = null, m ? i(t) : void 0), v = (t) => (l = null, n && f ? i(t) : (n = e = null, r)), y = (t) => {
|
|
7
|
+
if (u === null)
|
|
8
|
+
return s;
|
|
9
|
+
const o = t - u;
|
|
10
|
+
return s - o;
|
|
11
|
+
}, d = (t) => {
|
|
12
|
+
if (u === null)
|
|
13
|
+
return !0;
|
|
14
|
+
const o = t - u;
|
|
15
|
+
return o >= s || o < 0;
|
|
16
|
+
}, h = () => {
|
|
17
|
+
const t = Date.now();
|
|
18
|
+
if (d(t))
|
|
19
|
+
return v(t);
|
|
20
|
+
l = setTimeout(h, y(t));
|
|
21
|
+
}, p = function(...t) {
|
|
22
|
+
const o = Date.now(), T = d(o);
|
|
23
|
+
return n = t, e = this, T && l === null ? g(o) : (l === null && (l = setTimeout(h, s)), r);
|
|
24
|
+
};
|
|
25
|
+
return p.cancel = () => {
|
|
26
|
+
l !== null && clearTimeout(l), u = null, l = n = e = null;
|
|
27
|
+
}, p;
|
|
28
|
+
}
|
|
29
|
+
function D(c, s, a = !1) {
|
|
30
|
+
let l = null, n = null, e = null, r, u = null;
|
|
31
|
+
const m = () => {
|
|
32
|
+
const i = u !== null ? Date.now() - u : 0;
|
|
33
|
+
i < s && i >= 0 ? l = setTimeout(m, s - i) : (l = null, a || n !== null && e !== null && (r = c.apply(e, n), n = e = null));
|
|
34
|
+
}, f = function(...i) {
|
|
35
|
+
n = i, e = this, u = Date.now();
|
|
36
|
+
const g = a && l === null;
|
|
37
|
+
return l || (l = setTimeout(m, s)), g && (r = c.apply(this, i), n = e = null), r;
|
|
38
|
+
};
|
|
39
|
+
return f.cancel = () => {
|
|
40
|
+
l !== null && (clearTimeout(l), l = null, n = e = null, u = null);
|
|
41
|
+
}, f.flush = () => (l !== null && (clearTimeout(l), l = null, a || n !== null && e !== null && (r = c.apply(e, n), n = e = null)), r), f;
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
D as debounce,
|
|
45
|
+
C as throttle
|
|
46
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { isNil, isBoolean, isNumber, isObject, isArray, isFunction, isString, isNull, isSymbol, isUndefined, getValueType, transformValueToView, } from './language';
|
|
2
|
+
export { setValueByPath, getValueByPath, calculateObjectSize, formatStorageSize, serializeCircular, parseValue, } from './object';
|
|
3
|
+
export { throttle, debounce } from './function';
|
|
4
|
+
export { getFilePath, saveTextFileH5, saveTextFileMicro, saveTxtFileApp, } from './file';
|
|
5
|
+
export { getCurrentPagePath } from './page';
|
|
6
|
+
export { getCurrentDate, formatDate, sleep } from './date';
|
|
7
|
+
export { hightLight, escapeHTML, extractUrl, extractRowAndCol, parseStock, isMockWX, uniqueId, } from './string';
|
|
8
|
+
export { getWifiIp, getDeviceMac, getLanIp, getMicroAppIp } from './ip';
|
|
9
|
+
export { isAndroid, isH5, isWX } from './platform';
|
|
10
|
+
export { chunk } from './array';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../dev/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,UAAU,EACV,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,GACX,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EACL,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,cAAc,GACf,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE3D,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,QAAQ,GACT,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|