111111111
This commit is contained in:
parent
5a70e6f2bd
commit
b06fdc9259
20
uniapp04/.hbuilderx/launch.json
Normal file
20
uniapp04/.hbuilderx/launch.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-alipay" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1 +1,6 @@
|
|||
export const apiImageUrl = 'http://39.101.78.35:6271' // 测试服务器
|
||||
//export const apiImageUrl = 'http://39.101.78.35:6271'
|
||||
//export const apiImageUrl = 'http://localhost:9999'
|
||||
//export const apiImageUrl = 'http://39.101.78.35:6448'
|
||||
|
||||
export const apiImageUrl = 'https://xiaokuaisong.shop:6448'
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
import App from './App'
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
|
||||
|
|
124
uniapp04/node_modules/.package-lock.json
generated
vendored
124
uniapp04/node_modules/.package-lock.json
generated
vendored
|
@ -3,6 +3,35 @@
|
|||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@dcloudio/types": {
|
||||
"version": "3.4.14",
|
||||
"resolved": "https://registry.npmmirror.com/@dcloudio/types/-/types-3.4.14.tgz",
|
||||
"integrity": "sha512-VolQeZfTh8pQFsr2IlfIVX93blfvGTuBoJuZUc7iWOqtHV8gDrq6fXLhzsVlgZyuhhRZLOxlo33rkEqnY+ucAw==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@dcloudio/uni-app": {
|
||||
"version": "2.0.2-4020420240722004",
|
||||
"resolved": "https://registry.npmmirror.com/@dcloudio/uni-app/-/uni-app-2.0.2-4020420240722004.tgz",
|
||||
"integrity": "sha512-WzHNoEbOWkMWSW98AzWtexsLfaJfi/ujOHw7e8ffgYZVZYIyob2RGa3mQ61tb3j7/lZyRn48NsT2TXCc/ZaUxg==",
|
||||
"peerDependencies": {
|
||||
"@dcloudio/types": "^3.0.15",
|
||||
"@vue/composition-api": "^1.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@socket.io/component-emitter": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz",
|
||||
"integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA=="
|
||||
},
|
||||
"node_modules/@vue/composition-api": {
|
||||
"version": "1.7.2",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/composition-api/-/composition-api-1.7.2.tgz",
|
||||
"integrity": "sha512-M8jm9J/laYrYT02665HkZ5l2fWTK4dcVg3BsDHm/pfz+MjDYwX+9FUaZyGwEyXEDonQYRCo0H7aLgdklcIELjw==",
|
||||
"peer": true,
|
||||
"peerDependencies": {
|
||||
"vue": ">= 2.5 < 2.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/devtools-api": {
|
||||
"version": "6.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.3.tgz",
|
||||
|
@ -38,6 +67,22 @@
|
|||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.7",
|
||||
"resolved": "https://registry.npmmirror.com/debug/-/debug-4.3.7.tgz",
|
||||
"integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
|
@ -47,6 +92,26 @@
|
|||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/engine.io-client": {
|
||||
"version": "6.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/engine.io-client/-/engine.io-client-6.6.2.tgz",
|
||||
"integrity": "sha512-TAr+NKeoVTjEVW8P3iHguO1LO6RlUz9O5Y8o7EY0fU+gY1NYqas7NN3slpFtbXEsLMHk0h90fJMfKjRkQ0qUIw==",
|
||||
"dependencies": {
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
"debug": "~4.3.1",
|
||||
"engine.io-parser": "~5.2.1",
|
||||
"ws": "~8.17.1",
|
||||
"xmlhttprequest-ssl": "~2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/engine.io-parser": {
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmmirror.com/engine.io-parser/-/engine.io-parser-5.2.3.tgz",
|
||||
"integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.6",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||
|
@ -102,6 +167,11 @@
|
|||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||
},
|
||||
"node_modules/pinia": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pinia/-/pinia-2.2.0.tgz",
|
||||
|
@ -134,6 +204,32 @@
|
|||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/socket.io-client": {
|
||||
"version": "4.8.1",
|
||||
"resolved": "https://registry.npmmirror.com/socket.io-client/-/socket.io-client-4.8.1.tgz",
|
||||
"integrity": "sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==",
|
||||
"dependencies": {
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
"debug": "~4.3.2",
|
||||
"engine.io-client": "~6.6.1",
|
||||
"socket.io-parser": "~4.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/socket.io-parser": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmmirror.com/socket.io-parser/-/socket.io-parser-4.2.4.tgz",
|
||||
"integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==",
|
||||
"dependencies": {
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
"debug": "~4.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vue": {
|
||||
"version": "2.6.14",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz",
|
||||
|
@ -167,6 +263,34 @@
|
|||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.17.1",
|
||||
"resolved": "https://registry.npmmirror.com/ws/-/ws-8.17.1.tgz",
|
||||
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": ">=5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/xmlhttprequest-ssl": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.1.2.tgz",
|
||||
"integrity": "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
13
uniapp04/node_modules/@dcloudio/types/.editorconfig
generated
vendored
Normal file
13
uniapp04/node_modules/@dcloudio/types/.editorconfig
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
10
uniapp04/node_modules/@dcloudio/types/README.md
generated
vendored
Normal file
10
uniapp04/node_modules/@dcloudio/types/README.md
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
# @dcloudio/types
|
||||
|
||||
uni-app 类型提示
|
||||
|
||||
## 操作流程
|
||||
|
||||
```shell
|
||||
npm run test
|
||||
npm run publish:patch
|
||||
```
|
247
uniapp04/node_modules/@dcloudio/types/hbuilder-x/HBuilderX.d.ts
generated
vendored
Normal file
247
uniapp04/node_modules/@dcloudio/types/hbuilder-x/HBuilderX.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,247 @@
|
|||
declare namespace string {
|
||||
/**
|
||||
* @description 元素上的属性
|
||||
* @module dom
|
||||
*/
|
||||
interface AttrString extends String {}
|
||||
|
||||
/**
|
||||
* @description 元素上某个属性的值
|
||||
* @module dom
|
||||
*/
|
||||
interface AttrValueString extends String {}
|
||||
|
||||
/**
|
||||
* @description 元素全局属性`class`的值
|
||||
* @module dom
|
||||
*/
|
||||
interface ClassString extends String {}
|
||||
|
||||
/**
|
||||
* @description 元素全局属性`id`的值
|
||||
* @module dom
|
||||
*/
|
||||
interface IDString extends String {}
|
||||
|
||||
/**
|
||||
* @description 元素上的事件
|
||||
* @module dom
|
||||
*/
|
||||
interface HTMLEventString extends String {}
|
||||
|
||||
/**
|
||||
* @description CSS颜色的值
|
||||
* @module dom
|
||||
*/
|
||||
interface ColorString extends String {}
|
||||
|
||||
/**
|
||||
* @description 提示common模块 以及js文件路径
|
||||
* @module vue
|
||||
*/
|
||||
interface RequireCommonString extends String {}
|
||||
|
||||
/**
|
||||
* @description 国际化翻译的key值
|
||||
* @module vue
|
||||
*/
|
||||
interface VueI18NKeyString extends String {}
|
||||
|
||||
/**
|
||||
* @description vue默认参数data中的属性名称
|
||||
* @module vue
|
||||
*/
|
||||
interface VueDataString extends String {}
|
||||
|
||||
/**
|
||||
* @description vue组件中ref属性的值
|
||||
* @module vue
|
||||
*/
|
||||
interface VueRefString extends String {}
|
||||
|
||||
/**
|
||||
* @description vuex 中 actions 的名称
|
||||
* @module vue
|
||||
*/
|
||||
interface VuexDispatchString extends String {}
|
||||
|
||||
/**
|
||||
* @description vuex 中 mutations 的名称
|
||||
* @module vue
|
||||
*/
|
||||
interface VuexCommitString extends String {}
|
||||
|
||||
/**
|
||||
* @description vue, nvue, uvue页面文件的文件路径(根据项目自动匹配)
|
||||
* @module vue
|
||||
*/
|
||||
interface PageURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description nvue页面文件的文件路径
|
||||
* @module vue
|
||||
*/
|
||||
interface NPageURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description uvue页面文件的文件路径, 仅在uniappx中生效
|
||||
* @module uniappx
|
||||
*/
|
||||
interface UPageURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description video 组件的 id, 仅在uniappx中生效
|
||||
* @module uniappx
|
||||
*/
|
||||
interface VideoIdString extends String {}
|
||||
|
||||
/**
|
||||
* @description web-view 组件的 id, 仅在uniappx中生效
|
||||
* @module uniappx
|
||||
*/
|
||||
interface WebviewIdString extends String {}
|
||||
|
||||
/**
|
||||
* @description uniCloud db schema中parentKey的值
|
||||
* @module uniCloud
|
||||
*/
|
||||
interface ParentFieldString extends String {}
|
||||
|
||||
/**
|
||||
* @description uniCloud db schema中required数组的值
|
||||
* @module uniCloud
|
||||
*/
|
||||
interface SchemaFieldString extends String {}
|
||||
|
||||
/**
|
||||
* @description uniCloud db schema中validateFunction的值
|
||||
* @module uniCloud
|
||||
*/
|
||||
interface ValidateFunctionString extends String {}
|
||||
|
||||
/**
|
||||
* @description uniCloud 云函数名
|
||||
* @module uniCloud
|
||||
*/
|
||||
interface CloudFunctionString extends String {}
|
||||
|
||||
/**
|
||||
* @description uniCloud 云对象名
|
||||
* @module uniCloud
|
||||
*/
|
||||
interface CloudObjectString extends String {}
|
||||
|
||||
/**
|
||||
* @description uniCloud 数据库集合的名称
|
||||
* @module uniCloud
|
||||
*/
|
||||
interface DBCollectionString extends String {}
|
||||
|
||||
/**
|
||||
* @description uniCloud 数据库字段名称
|
||||
* @module uniCloud
|
||||
*/
|
||||
interface DBFieldString extends String {}
|
||||
|
||||
/**
|
||||
* @description uniCloud 数据库要操作的集合, 要查询的字段
|
||||
* @module uniCloud
|
||||
*/
|
||||
interface JQLString extends String {}
|
||||
|
||||
/**
|
||||
* @description CSS属性的名称
|
||||
* @module jQuery
|
||||
*/
|
||||
interface cssPropertyString extends String {}
|
||||
|
||||
/**
|
||||
* @description CSS某个属性的值
|
||||
* @module jQuery
|
||||
*/
|
||||
interface cssPropertyValueString extends String {}
|
||||
|
||||
/**
|
||||
* @description CSS选择器的名称
|
||||
* @module jQuery
|
||||
*/
|
||||
interface cssSelectorString extends String {}
|
||||
|
||||
/**
|
||||
* @description 任意文件的文件路径
|
||||
* @module uri
|
||||
*/
|
||||
interface URIString extends String {}
|
||||
|
||||
/**
|
||||
* @description css文件的文件路径(后缀为`.css`的文件路径)
|
||||
* @module uri
|
||||
*/
|
||||
interface CSSURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description js文件的文件路径(后缀为`.js`的文件路径)
|
||||
* @module uri
|
||||
*/
|
||||
interface JSURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description html文件的文件路径(后缀为`.html`的文件路径)
|
||||
* @module uri
|
||||
*/
|
||||
interface HTMLURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description markdown文件的文件路径(后缀为`.md`的文件路径)
|
||||
* @module uri
|
||||
*/
|
||||
interface MarkdownURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description js, ts, uts引用文件或模块的文件路径(支持vue,nvue,uvue中script标签内容), 例: `import xxx from 'xxx'`
|
||||
* @module uri
|
||||
*/
|
||||
interface ScriptImportURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description css文件可以引用的文件的文件路径, 后缀为`[".css"]`的文件路径 例: `@import url('xxx.css')`
|
||||
* @module uri
|
||||
*/
|
||||
interface CssImportURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description scss文件可以引用的文件的文件路径, 后缀为`[".scss", ".css"]`的文件路径, 例: `@import 'xxx.scss'`
|
||||
* @module uri
|
||||
*/
|
||||
interface ScssImportURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description less文件可以引用的文件的文件路径, 后缀为`[".less", ".css"]`的文件路径, 例: `@import 'xxx.less'`
|
||||
* @module uri
|
||||
*/
|
||||
interface LessImportURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description 字体文件的文件路径
|
||||
* @module uri
|
||||
*/
|
||||
interface FontURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description 图片文件的文件路径
|
||||
* @module uri
|
||||
*/
|
||||
interface ImageURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description 音频文件的文件路径
|
||||
* @module uri
|
||||
*/
|
||||
interface AudioURIString extends String {}
|
||||
|
||||
/**
|
||||
* @description 视频文件的文件路径
|
||||
* @module uri
|
||||
*/
|
||||
interface VideoURIString extends String {}
|
||||
}
|
1
uniapp04/node_modules/@dcloudio/types/hbuilder-x/index.d.ts
generated
vendored
Normal file
1
uniapp04/node_modules/@dcloudio/types/hbuilder-x/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/// <reference path="./HBuilderX.d.ts" />
|
2
uniapp04/node_modules/@dcloudio/types/html5plus/index.d.ts
generated
vendored
Normal file
2
uniapp04/node_modules/@dcloudio/types/html5plus/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/// <reference path="../hbuilder-x/index.d.ts" />
|
||||
/// <reference path="./plus.d.ts" />
|
20746
uniapp04/node_modules/@dcloudio/types/html5plus/plus.d.ts
generated
vendored
Normal file
20746
uniapp04/node_modules/@dcloudio/types/html5plus/plus.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
uniapp04/node_modules/@dcloudio/types/index.d.ts
generated
vendored
Normal file
2
uniapp04/node_modules/@dcloudio/types/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/// <reference path="./uni-app/index.d.ts" />
|
||||
/// <reference path="./html5plus/plus.d.ts" />
|
30
uniapp04/node_modules/@dcloudio/types/package.json
generated
vendored
Normal file
30
uniapp04/node_modules/@dcloudio/types/package.json
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "@dcloudio/types",
|
||||
"version": "3.4.14",
|
||||
"description": "uni-app types",
|
||||
"typings": "index.d.ts",
|
||||
"scripts": {
|
||||
"tslint": "tslint --project ./ --fix",
|
||||
"dtslint": "dtslint ./",
|
||||
"test": "dtslint ./",
|
||||
"build:wx": "node ./scripts/build-wx.js",
|
||||
"build": "npm run build:wx && npm run build:promisify",
|
||||
"prepublishOnly": "npm run test",
|
||||
"build:promisify": "node ./scripts/build-promisify.js",
|
||||
"publish:patch": "npm version patch && npm publish",
|
||||
"publish:minor": "npm version minor && npm publish",
|
||||
"publish:major": "npm version major && npm publish",
|
||||
"postpublish": "npx cnpm sync @dcloudio/types"
|
||||
},
|
||||
"author": "fxy060608",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@definitelytyped/dtslint": "^0.0.115",
|
||||
"miniprogram-api-typings": "3.7.1",
|
||||
"ts-morph": "^17.0.1",
|
||||
"tslint": "^5.14.0",
|
||||
"typescript": "5.0.4",
|
||||
"vue": "2.6"
|
||||
},
|
||||
"packageManager": "pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
|
||||
}
|
220
uniapp04/node_modules/@dcloudio/types/uni-app/app.d.ts
generated
vendored
Normal file
220
uniapp04/node_modules/@dcloudio/types/uni-app/app.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,220 @@
|
|||
declare namespace App {
|
||||
interface ReferrerInfo {
|
||||
/**
|
||||
* 来源小程序或公众号或App的 appId
|
||||
*
|
||||
* 以下场景支持返回 referrerInfo.appId:
|
||||
* - 1020(公众号 profile 页相关小程序列表): appId
|
||||
* - 1035(公众号自定义菜单):来源公众号 appId
|
||||
* - 1036(App 分享消息卡片):来源应用 appId
|
||||
* - 1037(小程序打开小程序):来源小程序 appId
|
||||
* - 1038(从另一个小程序返回):来源小程序 appId
|
||||
* - 1043(公众号模板消息):来源公众号 appId
|
||||
*/
|
||||
appId: string;
|
||||
/**
|
||||
* 来源小程序传过来的数据,scene=1037或1038时支持
|
||||
*/
|
||||
extraData?: any;
|
||||
}
|
||||
|
||||
interface LaunchShowOption {
|
||||
/**
|
||||
* 打开小程序的路径
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* 打开小程序的query
|
||||
*/
|
||||
query: AnyObject;
|
||||
/**
|
||||
* 打开小程序的场景值
|
||||
* - 1001: 发现栏小程序主入口,「最近使用」列表(基础库2.2.4版本起包含「我的小程序」列表)
|
||||
* - 1005: 顶部搜索框的搜索结果页
|
||||
* - 1006: 发现栏小程序主入口搜索框的搜索结果页
|
||||
* - 1007: 单人聊天会话中的小程序消息卡片
|
||||
* - 1008: 群聊会话中的小程序消息卡片
|
||||
* - 1011: 扫描二维码
|
||||
* - 1012: 长按图片识别二维码
|
||||
* - 1013: 手机相册选取二维码
|
||||
* - 1014: 小程序模板消息
|
||||
* - 1017: 前往体验版的入口页
|
||||
* - 1019: 微信钱包
|
||||
* - 1020: 公众号 profile 页相关小程序列表
|
||||
* - 1022: 聊天顶部置顶小程序入口
|
||||
* - 1023: 安卓系统桌面图标
|
||||
* - 1024: 小程序 profile 页
|
||||
* - 1025: 扫描一维码
|
||||
* - 1026: 附近小程序列表
|
||||
* - 1027: 顶部搜索框搜索结果页「使用过的小程序」列表
|
||||
* - 1028: 我的卡包
|
||||
* - 1029: 卡券详情页
|
||||
* - 1030: 自动化测试下打开小程序
|
||||
* - 1031: 长按图片识别一维码
|
||||
* - 1032: 手机相册选取一维码
|
||||
* - 1034: 微信支付完成页
|
||||
* - 1035: 公众号自定义菜单
|
||||
* - 1036: App 分享消息卡片
|
||||
* - 1037: 小程序打开小程序
|
||||
* - 1038: 从另一个小程序返回
|
||||
* - 1039: 摇电视
|
||||
* - 1042: 添加好友搜索框的搜索结果页
|
||||
* - 1043: 公众号模板消息
|
||||
* - 1044: 带 shareTicket 的小程序消息卡片
|
||||
* - 1045: 朋友圈广告
|
||||
* - 1046: 朋友圈广告详情页
|
||||
* - 1047: 扫描小程序码
|
||||
* - 1048: 长按图片识别小程序码
|
||||
* - 1049: 手机相册选取小程序码
|
||||
* - 1052: 卡券的适用门店列表
|
||||
* - 1053: 搜一搜的结果页
|
||||
* - 1054: 顶部搜索框小程序快捷入口
|
||||
* - 1056: 音乐播放器菜单
|
||||
* - 1057: 钱包中的银行卡详情页
|
||||
* - 1058: 公众号文章
|
||||
* - 1059: 体验版小程序绑定邀请页
|
||||
* - 1064: 微信连Wi-Fi状态栏
|
||||
* - 1067: 公众号文章广告
|
||||
* - 1068: 附近小程序列表广告
|
||||
* - 1069: 移动应用
|
||||
* - 1071: 钱包中的银行卡列表页
|
||||
* - 1072: 二维码收款页面
|
||||
* - 1073: 客服消息列表下发的小程序消息卡片
|
||||
* - 1074: 公众号会话下发的小程序消息卡片
|
||||
* - 1077: 摇周边
|
||||
* - 1078: 连Wi-Fi成功页
|
||||
* - 1079: 微信游戏中心
|
||||
* - 1081: 客服消息下发的文字链
|
||||
* - 1082: 公众号会话下发的文字链
|
||||
* - 1084: 朋友圈广告原生页
|
||||
* - 1089: 微信聊天主界面下拉,「最近使用」栏(基础库2.2.4版本起包含「我的小程序」栏)
|
||||
* - 1090: 长按小程序右上角菜单唤出最近使用历史
|
||||
* - 1091: 公众号文章商品卡片
|
||||
* - 1092: 城市服务入口
|
||||
* - 1095: 小程序广告组件
|
||||
* - 1096: 聊天记录
|
||||
* - 1097: 微信支付签约页
|
||||
* - 1099: 页面内嵌插件
|
||||
* - 1102: 公众号 profile 页服务预览
|
||||
* - 1103: 发现栏小程序主入口,「我的小程序」列表(基础库2.2.4版本起废弃)
|
||||
* - 1104: 微信聊天主界面下拉,「我的小程序」栏(基础库2.2.4版本起废弃)
|
||||
*/
|
||||
scene: number;
|
||||
/**
|
||||
* 打开小程序的场景值
|
||||
*/
|
||||
shareTicket: string;
|
||||
/**
|
||||
* 当场景为由从另一个小程序或公众号或App打开时,返回此字段
|
||||
*/
|
||||
referrerInfo?: ReferrerInfo;
|
||||
}
|
||||
|
||||
interface PageNotFoundOption {
|
||||
/**
|
||||
* 不存在页面的路径
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* 打开不存在页面的 query
|
||||
*/
|
||||
query: AnyObject;
|
||||
/**
|
||||
* 是否本次启动的首个页面(例如从分享等入口进来,首个页面是开发者配置的分享页面)
|
||||
*/
|
||||
isEntryPage: boolean;
|
||||
}
|
||||
|
||||
interface AppInstance<T extends AnyObject = {}> {
|
||||
/**
|
||||
* 全局对象
|
||||
* 文档:[https://uniapp.dcloud.io/collocation/App?id=globaldata](https://uniapp.dcloud.io/collocation/App?id=globaldata)
|
||||
*/
|
||||
globalData?: AnyObject;
|
||||
/**
|
||||
* 生命周期回调 监听应用初始化
|
||||
*
|
||||
* 应用初始化完成时触发,全局只触发一次。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
||||
*/
|
||||
onLaunch?(options?: LaunchShowOption): void;
|
||||
/**
|
||||
* 生命周期回调 监听应用显示
|
||||
*
|
||||
* 应用启动,或从后台进入前台显示时触发
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
||||
*/
|
||||
onShow?(options?: LaunchShowOption): void;
|
||||
/**
|
||||
* 生命周期回调 监听应用隐藏
|
||||
*
|
||||
* 应用从前台进入后台时触发
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
||||
*/
|
||||
onHide?(): void;
|
||||
/**
|
||||
* 错误监听函数
|
||||
* 小程序发生脚本错误或 API 调用报错时触发
|
||||
* @param error 错误信息,包含堆栈
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
||||
*/
|
||||
onError?(error: string): void;
|
||||
/**
|
||||
* 页面不存在监听函数
|
||||
*
|
||||
* 应用要打开的页面不存在时触发,会带上页面信息回调该函数
|
||||
*
|
||||
* **注意:**
|
||||
* 1. 如果开发者没有添加 `onPageNotFound` 监听,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。
|
||||
* 2. 如果 `onPageNotFound` 回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再回调 `onPageNotFound`。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
||||
*/
|
||||
onPageNotFound?(options: PageNotFoundOption): void;
|
||||
/**
|
||||
* 未处理的 Promise 拒绝事件监听函数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
||||
*/
|
||||
onUnhandledRejection?(
|
||||
options: UniNamespace.OnUnhandledRejectionCallbackResult
|
||||
): void;
|
||||
/**
|
||||
* 监听系统主题变化
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
||||
*/
|
||||
onThemeChange?(options: UniNamespace.OnThemeChangeCallbackResult): void;
|
||||
/**
|
||||
* 监听 nvue 页面消息
|
||||
*
|
||||
* nvue 页面使用 `uni.postMessage` 发送消息时触发
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
||||
*/
|
||||
onUniNViewMessage?(options: AnyObject): void;
|
||||
}
|
||||
|
||||
type AppConstructor = <T extends AnyObject & AppInstance>(
|
||||
options: AppInstance<T> & T,
|
||||
) => void;
|
||||
|
||||
interface GetAppOption {
|
||||
/**
|
||||
* 在 `App` 未定义时返回默认实现。当App被调用时,默认实现中定义的属性会被覆盖合并到App中。一般用于独立分包
|
||||
*/
|
||||
allowDefault: boolean;
|
||||
}
|
||||
|
||||
type GetApp = <T extends AnyObject>(opts?: GetAppOption) => AppInstance<T> & T;
|
||||
}
|
||||
|
||||
declare const getApp: App.GetApp;
|
||||
|
||||
declare const createApp: any;
|
||||
declare const createPage: any;
|
||||
declare const createComponent: any;
|
9
uniapp04/node_modules/@dcloudio/types/uni-app/cloud.d.ts
generated
vendored
Normal file
9
uniapp04/node_modules/@dcloudio/types/uni-app/cloud.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
/// <reference path="../hbuilder-x/index.d.ts" />
|
||||
/// <reference path="./uni-cloud-client/index.d.ts" />
|
||||
|
||||
/**
|
||||
* uniCloud 实例变量
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/uniCloud/](https://uniapp.dcloud.net.cn/uniCloud/)
|
||||
*/
|
||||
declare const uniCloud: UniCloudNamespace.UniCloud;
|
7
uniapp04/node_modules/@dcloudio/types/uni-app/common.d.ts
generated
vendored
Normal file
7
uniapp04/node_modules/@dcloudio/types/uni-app/common.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
interface AnyObject {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
type KVInfer<T> = { [K in keyof T]: T[K] };
|
||||
|
||||
type Void<T> = T | undefined | null;
|
11
uniapp04/node_modules/@dcloudio/types/uni-app/index.d.ts
generated
vendored
Normal file
11
uniapp04/node_modules/@dcloudio/types/uni-app/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
/// <reference path="../hbuilder-x/index.d.ts" />
|
||||
/// <reference path="../html5plus/plus.d.ts" />
|
||||
/// <reference path="./common.d.ts" />
|
||||
/// <reference path="./app.d.ts" />
|
||||
/// <reference path="./page.d.ts" />
|
||||
/// <reference path="./uni/index.d.ts" />
|
||||
/// <reference path="./uni-patches/index.d.ts" />
|
||||
/// <reference path="./cloud.d.ts" />
|
||||
|
||||
import UniApp = UniNamespace;
|
||||
import UniCloud = UniCloudNamespace;
|
496
uniapp04/node_modules/@dcloudio/types/uni-app/page.d.ts
generated
vendored
Normal file
496
uniapp04/node_modules/@dcloudio/types/uni-app/page.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,496 @@
|
|||
declare namespace Page {
|
||||
interface CustomShareContent {
|
||||
/**
|
||||
* 转发标题。默认值:当前应用名称
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* 转发路径,必须是以 / 开头的完整路径。默认值:当前页面 path
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* 自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径。支持PNG及JPG。显示图片长宽比是 5:4,默认值:使用默认截图
|
||||
*/
|
||||
imageUrl?: string;
|
||||
/**
|
||||
* 如果该参数存在,则以 resolve 结果为准,如果三秒内不 resolve,分享会使用上面传入的默认参数
|
||||
*/
|
||||
promise?: Promise<{
|
||||
/**
|
||||
* 转发标题。默认值:当前应用名称
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* 转发路径,必须是以 / 开头的完整路径。默认值:当前页面 path
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* 自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径。支持PNG及JPG。显示图片长宽比是 5:4,默认值:使用默认截图
|
||||
*/
|
||||
imageUrl?: string;
|
||||
}>;
|
||||
/**
|
||||
* 自定义分享描述
|
||||
*/
|
||||
desc?: string;
|
||||
/**
|
||||
* 自定义吱口令文案,最多 28 个字符
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* 自定义分享预览大图,建议尺寸 750x825,支持:网络图片路径、apFilePath 路径、相对路径,不支持:base64
|
||||
*/
|
||||
bgImgUrl?: string;
|
||||
/**
|
||||
* 自定义社交图片链接,作为分享到支付宝好友时的主体图片。建议尺寸 376x330
|
||||
*/
|
||||
scImgUrl?: string;
|
||||
/**
|
||||
* 生成分享截图的搜索引导,设置该参数后,会在分享图片中增加上支付宝搜“设置关键字”的内容,设置关键字不能超过 5 个字
|
||||
*/
|
||||
searchTip?: string;
|
||||
/**
|
||||
* 分享成功后回调
|
||||
*/
|
||||
success?: () => void;
|
||||
/**
|
||||
* 分享失败后回调
|
||||
*/
|
||||
fail?: () => void;
|
||||
/**
|
||||
* 开发者后台设置的分享素材模板 id
|
||||
*/
|
||||
templateId?: string;
|
||||
/**
|
||||
* PC端打开小程序加载的页面,不支持可传空字符串
|
||||
*/
|
||||
PCPath?: string;
|
||||
/**
|
||||
* PC端打开小程序加载的模式,若需要在PC端打开小程序,则必须传PCMode字段
|
||||
*/
|
||||
PCMode?: string;
|
||||
/**
|
||||
* PCQQ、低版本手机QQ无法执行小程序时打开的H5页面
|
||||
*/
|
||||
generalWebpageUrl?: string;
|
||||
/**
|
||||
* 监听用户点击页面内转发按钮的,只有带上该参数,才支持快速分享
|
||||
*/
|
||||
entryDataHash?: string;
|
||||
/**
|
||||
* 分享模板id,可以使用不同的分享模版,可选模版参考管理端分享模版一栏
|
||||
*/
|
||||
shareTemplateId?: string;
|
||||
/**
|
||||
* 分享模板的数据,不同的模板id需要不同的数据,数据的格式请参考管理端分享模版一栏
|
||||
*/
|
||||
shareTemplateData?: string;
|
||||
/**
|
||||
* 指定分享的类型
|
||||
*/
|
||||
shareType?: string;
|
||||
/**
|
||||
* 转发形式(1 - 京东小程序正式版;2 - 京东小程序体验版;京东App9.0.0开始不填或者其他值都会先判断是否有url参数,如果有打开分享后显示url对应页面,否则默认生成京东小程序官方的一个分享中间页面,点击可跳到京东app里面的对应小程序)
|
||||
*/
|
||||
type?: string;
|
||||
/**
|
||||
* 渠道(不写默认微信朋友,微信朋友圈),可用值有:Wxfriends,QQfriends,Wxmoments,QQzone,Sinaweibo
|
||||
*/
|
||||
channel?: string;
|
||||
/**
|
||||
* h5链接地址(h5分享填写,不填默认中间页)
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* 口令分享渠道,可用值有:Wxfriends,QQfriends,Wxmoments,QQzone,Sinaweibo,当需要口令分享时,需要配置此选项
|
||||
*/
|
||||
keyShareChannel?: string;
|
||||
/**
|
||||
* 海报分享,本地图片地址(海报图片由开发者生成后将图片地址传入jdfile开头的格式)
|
||||
*/
|
||||
localImageUrl?: string;
|
||||
/**
|
||||
* 海报分享,网络图片地址(海报图片由开发者生成后将图片地址传入),注意:localImageUrl、onlineImageUrl建议开发者使用时只传一个值 如果传入两个值 优先localImageUrl
|
||||
*/
|
||||
onlineImageUrl?: string;
|
||||
}
|
||||
|
||||
interface ShareTimelineContent {
|
||||
/**
|
||||
* 自定义标题,即朋友圈列表页上显示的标题。默认值:当前小程序名称
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* 自定义页面路径中携带的参数,如 path?a=1&b=2 的 “?” 后面部分。默认值:当前页面路径携带的参数
|
||||
*/
|
||||
query?: string;
|
||||
/**
|
||||
* 自定义图片路径,可以是本地文件或者网络图片。支持 PNG 及 JPG,显示图片长宽比是 1:1。默认值:小程序 Logo
|
||||
*/
|
||||
imageUrl?: string;
|
||||
}
|
||||
|
||||
interface PageScrollOption {
|
||||
/**
|
||||
* 页面在垂直方向已滚动的距离(单位 px)
|
||||
*/
|
||||
scrollTop: number;
|
||||
}
|
||||
|
||||
interface ResizeOption {
|
||||
/**
|
||||
* 页面在垂直方向已滚动的距离(单位 px)
|
||||
*/
|
||||
scrollTop: number;
|
||||
/**
|
||||
* 新的显示区域尺寸
|
||||
*/
|
||||
size?: {
|
||||
/**
|
||||
* 新的显示区域宽度
|
||||
*/
|
||||
windowWidth: number;
|
||||
/**
|
||||
* 新的显示区域高度
|
||||
*/
|
||||
windowHeight: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface ShareAppMessageOption {
|
||||
/**
|
||||
* 转发事件来源。
|
||||
* 可选值:
|
||||
* - `button`:页面内转发按钮;
|
||||
* - `menu`:右上角转发菜单。
|
||||
*/
|
||||
from: "button" | "menu";
|
||||
/**
|
||||
* 如果 `from` 值是 `button`,则 `target` 是触发这次转发事件的 `button`,否则为 `undefined`
|
||||
*/
|
||||
target: any;
|
||||
/**
|
||||
* 页面中包含 `<web-view>` 组件时,返回当前 `<web-view>` 的 url
|
||||
*/
|
||||
webViewUrl?: string;
|
||||
}
|
||||
|
||||
interface AddToFavoritesOption {
|
||||
/**
|
||||
* 转发事件来源。
|
||||
* 可选值:
|
||||
* - `button`:页面内转发按钮;
|
||||
* - `menu`:右上角转发菜单。
|
||||
*/
|
||||
from: "button" | "menu";
|
||||
/**
|
||||
* 页面中包含 `<web-view>` 组件时,返回当前 `<web-view>` 的 url
|
||||
*/
|
||||
webviewUrl: string;
|
||||
}
|
||||
|
||||
interface CustomFavoritesContent {
|
||||
/**
|
||||
* 自定义标题,默认值:页面标题或账号名称
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* 自定义 query 字段
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* 自定义图片,显示图片长宽比为 1:1
|
||||
*/
|
||||
imageUrl?: string;
|
||||
}
|
||||
|
||||
interface TabItemTapOption {
|
||||
/**
|
||||
* 被点击 tabItem 的序号,从0开始
|
||||
*/
|
||||
index: number;
|
||||
/**
|
||||
* 被点击 tabItem 的页面路径
|
||||
*/
|
||||
pagePath: string;
|
||||
/**
|
||||
* 被点击 tabItem 的按钮文字
|
||||
*/
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface NavigationBarButtonTapOption {
|
||||
/**
|
||||
* 原生标题栏按钮数组的下标
|
||||
*/
|
||||
index: number;
|
||||
}
|
||||
|
||||
interface BackPressOption {
|
||||
/**
|
||||
* - backbutton 顶部导航栏左边的返回按钮或 Android 实体返回键
|
||||
* - navigateBack 返回 API,即 uni.navigateBack()
|
||||
*/
|
||||
from: 'backbutton' | 'navigateBack';
|
||||
}
|
||||
|
||||
interface NavigationBarSearchInputEvent {
|
||||
/**
|
||||
* 搜索输入框输入内容
|
||||
*/
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface PageInstanceBaseProps<D extends AnyObject = any> {
|
||||
/**
|
||||
* 到当前页面的路径,类型为 `String`
|
||||
*/
|
||||
route?: string;
|
||||
/**
|
||||
* 获取当前页面的webview对象实例。仅 App 平台支持
|
||||
*/
|
||||
$getAppWebview?: () => PlusWebviewWebviewObject;
|
||||
/**
|
||||
* 当前页面的 Vue 实例
|
||||
*/
|
||||
$vm?: any;
|
||||
}
|
||||
|
||||
interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> extends PageInstanceBaseProps<D> {
|
||||
/**
|
||||
* 生命周期回调 监听页面初始化
|
||||
*
|
||||
* 页面初始化时触发。一个页面只会调用一次,可以在 onInit 的参数中获取打开当前页面路径中的参数。
|
||||
* @param query 打开当前页面路径中的参数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
* @uniPlatform {
|
||||
* "app": {
|
||||
* "android": {
|
||||
* "osVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "ios": {
|
||||
* "osVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* }
|
||||
* },
|
||||
* "mp": {
|
||||
* "weixin": {
|
||||
* "hostVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "alipay": {
|
||||
* "hostVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "baidu": {
|
||||
* "hostVer": ">=3.160.12",
|
||||
* "uniVer": ">=3.1.0",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "toutiao": {
|
||||
* "hostVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "lark": {
|
||||
* "hostVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "qq": {
|
||||
* "hostVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "kuaishou": {
|
||||
* "hostVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "jd": {
|
||||
* "hostVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "360": {
|
||||
* "hostVer": "x",
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* }
|
||||
* },
|
||||
* "quickapp": {
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* },
|
||||
* "web": {
|
||||
* "uniVer": "x",
|
||||
* "unixVer": "x"
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
onInit?(query?: AnyObject): void;
|
||||
/**
|
||||
* 生命周期回调 监听页面加载
|
||||
*
|
||||
* 页面加载时触发。一个页面只会调用一次,可以在 onLoad 的参数中获取打开当前页面路径中的参数。
|
||||
* @param query 打开当前页面路径中的参数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onLoad?(query?: AnyObject): void;
|
||||
/**
|
||||
* 生命周期回调 监听页面显示
|
||||
*
|
||||
* 页面显示/切入前台时触发。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onShow?(): void;
|
||||
/**
|
||||
* 生命周期回调 监听页面初次渲染完成
|
||||
*
|
||||
* 页面初次渲染完成时触发。一个页面只会调用一次,代表页面已经准备妥当,可以和视图层进行交互。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onReady?(): void;
|
||||
/**
|
||||
* 生命周期回调 监听页面隐藏
|
||||
*
|
||||
* 页面隐藏/切入后台时触发。 如 `navigateTo` 或底部 `tab` 切换到其他页面,应用切入后台等。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onHide?(): void;
|
||||
/**
|
||||
* 生命周期回调 监听页面卸载
|
||||
*
|
||||
* 页面卸载时触发。如 `redirectTo` 或 `navigateBack` 到其他页面时。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onUnload?(): void;
|
||||
/**
|
||||
* 监听用户下拉动作
|
||||
* - 需要在 `pages.json` 的页面配置中开启 `enablePullDownRefresh` 。
|
||||
* - 可以通过 `uni.startPullDownRefresh` 触发下拉刷新,调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。
|
||||
* - 当处理完数据刷新后,`uni.stopPullDownRefresh` 可以停止当前页面的下拉刷新。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onPullDownRefresh?(): void;
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
* - 可以在 `pages.json` 的页面配置中设置触发距离 `onReachBottomDistance` 。
|
||||
* - 在触发距离内滑动期间,本事件只会被触发一次。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onReachBottom?(): void;
|
||||
/**
|
||||
* 用户点击右上角转发
|
||||
*
|
||||
* 监听用户点击页面内转发按钮(`<button>` 组件 `open-type="share"`)或右上角菜单“转发”按钮的行为,并自定义转发内容。
|
||||
* @param options 分享发起来源参数
|
||||
* @return 转发内容
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onShareAppMessage?(options: ShareAppMessageOption): CustomShareContent | Promise<Omit<CustomShareContent, "promise">>;
|
||||
/**
|
||||
* 用户点击右上角转发到朋友圈
|
||||
*
|
||||
* 监听右上角菜单“分享到朋友圈”按钮的行为,并自定义发享内容。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onShareTimeline?(): ShareTimelineContent;
|
||||
/**
|
||||
* 用户点击右上角收藏
|
||||
*
|
||||
* 监听用户点击右上角菜单“收藏”按钮的行为,并自定义收藏内容。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onAddToFavorites?(options: AddToFavoritesOption): CustomFavoritesContent;
|
||||
/**
|
||||
* 页面滚动触发事件的处理函数
|
||||
*
|
||||
* 监听用户滑动页面事件。
|
||||
* @param options 页面滚动参数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onPageScroll?(options: PageScrollOption): void;
|
||||
/**
|
||||
* 页面尺寸改变时触发
|
||||
* @param options 页面滚动参数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
* @uniPlatform {
|
||||
* "App": {
|
||||
* "baidu": {
|
||||
* "hostVer": ">=3.160.12",
|
||||
* "uniVer": ">=3.1.0",
|
||||
* "unixVer": "x"
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
onResize?(options: ResizeOption): void;
|
||||
/**
|
||||
* 当前是 tab 页时,点击 tab 时触发
|
||||
* @param options tab 点击参数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onTabItemTap?(options: TabItemTapOption): void;
|
||||
/**
|
||||
* 监听原生标题栏按钮点击事件
|
||||
* @param options tab 点击参数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onNavigationBarButtonTap?(options: NavigationBarButtonTapOption): void;
|
||||
/**
|
||||
* 监听页面返回
|
||||
* @param options tab 点击参数
|
||||
* @return 返回 `true` 时阻止页面返回
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onBackPress?(options: BackPressOption): any;
|
||||
/**
|
||||
* 监听原生标题栏搜索输入框输入内容变化事件
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onNavigationBarSearchInputChanged?(event: NavigationBarSearchInputEvent): void;
|
||||
/**
|
||||
* 监听原生标题栏搜索输入框搜索事件,用户点击软键盘上的“搜索”按钮时触发。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onNavigationBarSearchInputConfirmed?(event: NavigationBarSearchInputEvent): void;
|
||||
/**
|
||||
* 监听原生标题栏搜索输入框点击事件
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
||||
*/
|
||||
onNavigationBarSearchInputClicked?(): void;
|
||||
}
|
||||
|
||||
type PageConstructor = <T extends AnyObject & PageInstance>(
|
||||
options: PageInstance<AnyObject, T> & T,
|
||||
) => void;
|
||||
|
||||
type GetCurrentPages = <T extends AnyObject = {}>() => Array<PageInstance<AnyObject, T> & T>;
|
||||
}
|
||||
|
||||
declare const getCurrentPages: Page.GetCurrentPages;
|
252
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/base.d.ts
generated
vendored
Normal file
252
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/base.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,252 @@
|
|||
declare namespace UniCloudNamespace {
|
||||
interface CurrentUserInfo {
|
||||
/**
|
||||
* 当前用户uid
|
||||
*/
|
||||
uid: string;
|
||||
/**
|
||||
* 当前用户角色列表
|
||||
*/
|
||||
role: any[];
|
||||
/**
|
||||
* 当前用户权限列表
|
||||
*/
|
||||
permission: any[];
|
||||
}
|
||||
|
||||
interface UniCloudOptions {
|
||||
/**
|
||||
* 选择服务供应商
|
||||
* - tencent: 选择腾讯云作为服务商
|
||||
* - aliyun: 选择阿里云作为服务商
|
||||
*/
|
||||
provider: 'tencent' | 'aliyun';
|
||||
/**
|
||||
* 服务空间ID
|
||||
*/
|
||||
spaceId: string;
|
||||
/**
|
||||
* 服务空间对应的clientSecret
|
||||
*/
|
||||
clientSecret?: string;
|
||||
/**
|
||||
* 服务空间地址
|
||||
*/
|
||||
endpoint?: string;
|
||||
}
|
||||
|
||||
interface UniError {
|
||||
/**
|
||||
* 错误模块名
|
||||
*/
|
||||
errSubject?: string;
|
||||
/**
|
||||
* 错误码
|
||||
*/
|
||||
errCode: number | string;
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
errMsg: string;
|
||||
/**
|
||||
* 请求id方便排错
|
||||
*/
|
||||
requestId?: string;
|
||||
/**
|
||||
* 错误详情
|
||||
*/
|
||||
detail?: any;
|
||||
/**
|
||||
* 上级错误
|
||||
*/
|
||||
cause?: UniError;
|
||||
}
|
||||
|
||||
interface CallFunctionResult {
|
||||
/**
|
||||
* 云函数执行结果
|
||||
*/
|
||||
result: any;
|
||||
/**
|
||||
* 请求序列号,用于错误排查
|
||||
*/
|
||||
requestId?: string;
|
||||
}
|
||||
|
||||
enum SECRET_TYPE {
|
||||
/**
|
||||
* 不加密
|
||||
*/
|
||||
none = 'none',
|
||||
/**
|
||||
* 仅请求参数加密
|
||||
*/
|
||||
request = 'request',
|
||||
/**
|
||||
* 仅响应结果加密
|
||||
*/
|
||||
response = 'response',
|
||||
/**
|
||||
* 请求响应均加密
|
||||
*/
|
||||
both = 'both'
|
||||
}
|
||||
interface CallFunctionOptions {
|
||||
/**
|
||||
* 云函数名
|
||||
*/
|
||||
name: string | string.CloudFunctionString;
|
||||
/**
|
||||
* 传递给云函数的参数
|
||||
*/
|
||||
data?: any;
|
||||
/**
|
||||
* 安全网络类型
|
||||
* - none:不加密
|
||||
* - request:仅请求参数加密
|
||||
* - response:仅响应结果加密
|
||||
* - both:请求响应均加密
|
||||
*/
|
||||
secretType?: keyof typeof SECRET_TYPE;
|
||||
/**
|
||||
* 成功返回的回调函数
|
||||
*/
|
||||
success?: (result: CallFunctionResult) => void;
|
||||
/**
|
||||
* 失败返回的回调函数
|
||||
*/
|
||||
fail?: (result: any) => void;
|
||||
/**
|
||||
* 结束的回调函数(调用成功、失败都会执行
|
||||
*/
|
||||
complete?: (result: CallFunctionResult) => void;
|
||||
}
|
||||
|
||||
interface ImportObjectLoadingOptions {
|
||||
/**
|
||||
* loading界面文字
|
||||
*/
|
||||
text?: string;
|
||||
/**
|
||||
* loading是否显示透明遮罩
|
||||
*/
|
||||
mask?: boolean;
|
||||
}
|
||||
|
||||
interface ImportObjectErrorOptions {
|
||||
/**
|
||||
* 错误提示类型,modal | toast
|
||||
*/
|
||||
type?: 'modal' | 'toast';
|
||||
/**
|
||||
* 是否显示重试按钮,type为modal时生效
|
||||
*/
|
||||
retry?: boolean;
|
||||
}
|
||||
|
||||
interface ParseSystemErrorOptions {
|
||||
/**
|
||||
* 云对象名
|
||||
*/
|
||||
objectName: string;
|
||||
/**
|
||||
* 调用的方法名
|
||||
*/
|
||||
methodName: string;
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
params: Array<any>;
|
||||
/**
|
||||
* 错误码
|
||||
*/
|
||||
errCode: string | number;
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
errMsg: string;
|
||||
}
|
||||
|
||||
interface ParsedSystemErrorResult {
|
||||
errMsg: string;
|
||||
}
|
||||
|
||||
interface ImportObjectOptions {
|
||||
/**
|
||||
* 是否移除自动展示的ui
|
||||
*/
|
||||
customUI?: boolean;
|
||||
/**
|
||||
* loading界面配置
|
||||
*/
|
||||
loadingOptions?: ImportObjectLoadingOptions;
|
||||
/**
|
||||
* 错误提示配置
|
||||
*/
|
||||
errorOptions?: ImportObjectErrorOptions;
|
||||
/**
|
||||
* 使用安全网络的方法及安全网络类型
|
||||
*/
|
||||
secretMethods?: Record<string, keyof typeof SECRET_TYPE>;
|
||||
/**
|
||||
* 转化云对象内未捕获的错误或客户端网络错误
|
||||
*/
|
||||
parseSystemError?: (options: ParseSystemErrorOptions) => Promise<ParsedSystemErrorResult> | ParsedSystemErrorResult;
|
||||
}
|
||||
|
||||
interface InitSecureNetworkByWeixinOptions {
|
||||
/**
|
||||
* 是否握手并自动调用uni-id-co的微信登录,默认仅调用uni-id-co的secureNetworkHandshakeByWeixin不调用微信登录
|
||||
*/
|
||||
callLoginByWeixin?: boolean;
|
||||
/**
|
||||
* 用户openid,传此参数时不会调用uni-id-co的任何方法
|
||||
*/
|
||||
openid?: string;
|
||||
}
|
||||
|
||||
interface InitSecureNetworkByWeixinResponse {
|
||||
code?: string;
|
||||
}
|
||||
|
||||
interface UniCloud {
|
||||
/** 用于快速开发datacom规范的组件 */
|
||||
mixinDatacom: any;
|
||||
/**
|
||||
* 服务空间初始化,返回uniCloud实例
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/init](https://uniapp.dcloud.io/uniCloud/init)
|
||||
*/
|
||||
init(options: UniCloudOptions): UniCloud;
|
||||
/**
|
||||
* 设置自定义clientInfo信息
|
||||
*
|
||||
* 文档: [https://doc.dcloud.net.cn/uniCloud/client-sdk.html#set-custom-client-info](https://doc.dcloud.net.cn/uniCloud/client-sdk.html#set-custom-client-info)
|
||||
*/
|
||||
setCustomClientInfo(options: object): void;
|
||||
/**
|
||||
* 调用云函数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/cf-functions?id=clientcallfunction](https://uniapp.dcloud.io/uniCloud/cf-functions?id=clientcallfunction)
|
||||
*/
|
||||
callFunction(options: CallFunctionOptions): Promise<any>;
|
||||
/**
|
||||
* 引用云对象
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/cloud-obj](https://uniapp.dcloud.io/uniCloud/cloud-obj)
|
||||
*/
|
||||
importObject(objectName: string | string.CloudObjectString, importObjectOptions?: ImportObjectOptions): any;
|
||||
/**
|
||||
* 获取当前用户缓存在token内的信息
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#client-getcurrentuserinfo](https://uniapp.dcloud.io/uniCloud/client-sdk.html#client-getcurrentuserinfo)
|
||||
*/
|
||||
getCurrentUserInfo(): CurrentUserInfo;
|
||||
/**
|
||||
* 微信小程序安全网络初始化
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#client-getcurrentuserinfo](https://uniapp.dcloud.io/uniCloud/client-sdk.html#init-secure-network-by-weixin)
|
||||
*/
|
||||
initSecureNetworkByWeixin(options?: InitSecureNetworkByWeixinOptions): Promise<InitSecureNetworkByWeixinResponse>;
|
||||
}
|
||||
}
|
54
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/custom-auth.d.ts
generated
vendored
Normal file
54
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/custom-auth.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
declare namespace UniCloudNamespace {
|
||||
interface UserInfo {
|
||||
/**
|
||||
* 用户在uniCloud的唯一ID
|
||||
*/
|
||||
uid: string;
|
||||
/**
|
||||
* 自定义登录的用户ID
|
||||
*/
|
||||
customUserId: string;
|
||||
}
|
||||
|
||||
interface Auth {
|
||||
/**
|
||||
* 任何方式登录成功后,可以调用 getUserInfo 获得用户的身份信息
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/authentication?id=authgetuserinfo](https://uniapp.dcloud.io/uniCloud/authentication?id=authgetuserinfo)
|
||||
*/
|
||||
getUserInfo(): UserInfo;
|
||||
/**
|
||||
* 开发者可以通过 getLoginState() 来获取当前的登录状态,调用 getLoginState() 后,SDK 会识别本地是否有登录状态,如果有,则会尝试刷新登录状态,若刷新登录状态成功,则会返回新的登录状态,否则返回 undefined
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/authentication?id=authgetloginstate](https://uniapp.dcloud.io/uniCloud/authentication?id=authgetloginstate)
|
||||
*/
|
||||
getLoginState(): void;
|
||||
/**
|
||||
* 进行匿名登录
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/authentication?id=authsigninanonymously](https://uniapp.dcloud.io/uniCloud/authentication?id=authsigninanonymously)
|
||||
*/
|
||||
signInAnonymously(): void;
|
||||
/**
|
||||
* 进行自定义登录
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/authentication?id=authsigninwithticket](https://uniapp.dcloud.io/uniCloud/authentication?id=authsigninwithticket)
|
||||
*/
|
||||
signInWithTicket(): void;
|
||||
/**
|
||||
* 进行自定义登录
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/authentication?id=authshouldrefreshaccesstoken](https://uniapp.dcloud.io/uniCloud/authentication?id=authshouldrefreshaccesstoken)
|
||||
*/
|
||||
shouldRefreshAccessToken(callback: (result: any) => void): void;
|
||||
}
|
||||
|
||||
interface UniCloud {
|
||||
/**
|
||||
* 获取登录对象
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/authentication?id=custom-auth](https://uniapp.dcloud.io/uniCloud/authentication?id=custom-auth)
|
||||
*/
|
||||
customAuth(): Auth;
|
||||
}
|
||||
}
|
1597
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/database.d.ts
generated
vendored
Normal file
1597
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/database.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
58
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/event.d.ts
generated
vendored
Normal file
58
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/event.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
declare namespace UniCloudNamespace {
|
||||
interface UniCloudResponseEvent {
|
||||
type: 'clientdb' | 'cloudobject' | 'cloudfunction';
|
||||
content: any;
|
||||
}
|
||||
|
||||
interface UniCloudNeedLoginEvent {
|
||||
errCode: string | number;
|
||||
errMsg: string;
|
||||
uniIdRedirectUrl: string;
|
||||
}
|
||||
|
||||
interface UniCloudRefreshTokenEvent {
|
||||
token: string;
|
||||
tokenExpired: number;
|
||||
}
|
||||
|
||||
interface UniCloud {
|
||||
/** 事件回调 */
|
||||
on(eventName: string, callback: (result: any) => void): void;
|
||||
/**
|
||||
* 监听云函数、云对象、clientDB的响应
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#on-response](https://uniapp.dcloud.io/uniCloud/client-sdk.html#on-response)
|
||||
*/
|
||||
onResponse(callback: (result?: UniCloudResponseEvent) => void): void;
|
||||
/**
|
||||
* 移除监听云函数、云对象、clientDB的响应
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#off-response](https://uniapp.dcloud.io/uniCloud/client-sdk.html#off-response)
|
||||
*/
|
||||
offResponse(callback: (result?: UniCloudResponseEvent) => void): void;
|
||||
/**
|
||||
* 监听需要登录事件
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#on-need-login](https://uniapp.dcloud.io/uniCloud/client-sdk.html#on-need-login)
|
||||
*/
|
||||
onNeedLogin(callback: (result?: UniCloudNeedLoginEvent) => void): void;
|
||||
/**
|
||||
* 移除监听需要登录事件
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#off-need-login](https://uniapp.dcloud.io/uniCloud/client-sdk.html#off-need-login)
|
||||
*/
|
||||
offNeedLogin(callback: (result?: UniCloudNeedLoginEvent) => void): void;
|
||||
/**
|
||||
* 监听token刷新事件
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#on-refresh-token](https://uniapp.dcloud.io/uniCloud/client-sdk.html#on-refresh-token)
|
||||
*/
|
||||
onRefreshToken(callback: (result?: UniCloudRefreshTokenEvent) => void): void;
|
||||
/**
|
||||
* 移除监听token刷新事件
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#off-refresh-token](https://uniapp.dcloud.io/uniCloud/client-sdk.html#off-refresh-token)
|
||||
*/
|
||||
offRefreshToken(callback: (result: UniCloudRefreshTokenEvent) => void): void;
|
||||
}
|
||||
}
|
7
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/index.d.ts
generated
vendored
Normal file
7
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
/// <reference path="custom-auth.d.ts" />
|
||||
/// <reference path="database.d.ts" />
|
||||
/// <reference path="event.d.ts" />
|
||||
/// <reference path="interceptor.d.ts" />
|
||||
/// <reference path="sse-channel.d.ts" />
|
||||
/// <reference path="storage.d.ts" />
|
||||
/// <reference path="websocket.d.ts" />
|
52
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/interceptor.d.ts
generated
vendored
Normal file
52
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/interceptor.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
declare namespace UniCloudNamespace {
|
||||
interface Interceptor {
|
||||
invoke?: (result: any) => void;
|
||||
success?: (result: any) => void;
|
||||
fail?: (result: any) => void;
|
||||
complete?: (result: any) => void;
|
||||
}
|
||||
|
||||
interface BaseObjectInterceptorArgs {
|
||||
objectName: string;
|
||||
methodName: string;
|
||||
params: string;
|
||||
}
|
||||
|
||||
interface SuccessObjectInterceptorArgs extends BaseObjectInterceptorArgs {
|
||||
result: any;
|
||||
}
|
||||
|
||||
interface FailObjectInterceptorArgs extends BaseObjectInterceptorArgs {
|
||||
error: UniError;
|
||||
}
|
||||
|
||||
type CompleteObjectInterceptorArgs = SuccessObjectInterceptorArgs | FailObjectInterceptorArgs;
|
||||
|
||||
interface ObjectInterceptor {
|
||||
invoke?: (result: BaseObjectInterceptorArgs) => void;
|
||||
success?: (result: SuccessObjectInterceptorArgs) => void;
|
||||
fail?: (result: FailObjectInterceptorArgs) => void;
|
||||
complete?: (result: CompleteObjectInterceptorArgs) => void;
|
||||
}
|
||||
|
||||
interface UniCloud {
|
||||
/**
|
||||
* 添加拦截器
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#add-interceptor](https://uniapp.dcloud.io/uniCloud/client-sdk.html#add-interceptor)
|
||||
*/
|
||||
addInterceptor(apiName: string, interceptor: Interceptor): void;
|
||||
/**
|
||||
* 移除拦截器
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#remove-interceptor](https://uniapp.dcloud.io/uniCloud/client-sdk.html#remove-interceptor)
|
||||
*/
|
||||
removeInterceptor(apiName: string, interceptor?: Interceptor): void;
|
||||
/**
|
||||
* 拦截云对象请求
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/client-sdk.html#intercept-object](https://uniapp.dcloud.io/uniCloud/client-sdk.html#intercept-object)
|
||||
*/
|
||||
interceptObject(interceptor: ObjectInterceptor): void;
|
||||
}
|
||||
}
|
110
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/sse-channel.d.ts
generated
vendored
Normal file
110
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/sse-channel.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,110 @@
|
|||
declare namespace UniCloudNamespace {
|
||||
class SSEChannel {
|
||||
constructor();
|
||||
/**
|
||||
* 开启消息通道
|
||||
*
|
||||
* 文档:[https://uniapp.dcloud.net.cn/uniCloud/sse-channel.html#channel-open](https://uniapp.dcloud.net.cn/uniCloud/sse-channel.html#channel-open)
|
||||
*/
|
||||
open: () => Promise<void>;
|
||||
/**
|
||||
* 关闭消息通道
|
||||
*
|
||||
* 文档:[https://uniapp.dcloud.net.cn/uniCloud/sse-channel.html#channel-close](https://uniapp.dcloud.net.cn/uniCloud/sse-channel.html#channel-close)
|
||||
*/
|
||||
close: () => void;
|
||||
/**
|
||||
* 添加通道开启事件监听器
|
||||
*/
|
||||
on(event: 'open', callback: () => any): void;
|
||||
/**
|
||||
* 添加消息接收事件监听器
|
||||
*/
|
||||
on(event: 'message', callback: (message?: any) => any): void;
|
||||
/**
|
||||
* 添加通道消息完毕事件监听器
|
||||
*/
|
||||
on(event: 'end', callback: (message?: any) => any): void;
|
||||
/**
|
||||
* 添加通道关闭事件监听器
|
||||
*/
|
||||
on(event: 'close', callback: () => any): void;
|
||||
/**
|
||||
* 添加通道错误事件监听器
|
||||
*/
|
||||
on(event: 'error', callback: (err?: any) => any): void;
|
||||
/**
|
||||
* 添加通道开启事件监听器
|
||||
*/
|
||||
addListener(event: 'open', callback: () => any): void;
|
||||
/**
|
||||
* 添加消息接收事件监听器
|
||||
*/
|
||||
addListener(event: 'message', callback: (message?: any) => any): void;
|
||||
/**
|
||||
* 添加通道消息完毕事件监听器
|
||||
*/
|
||||
addListener(event: 'end', callback: (message?: any) => any): void;
|
||||
/**
|
||||
* 添加通道关闭事件监听器
|
||||
*/
|
||||
addListener(event: 'close', callback: () => any): void;
|
||||
/**
|
||||
* 添加通道错误事件监听器
|
||||
*/
|
||||
addListener(event: 'error', callback: (err?: any) => any): void;
|
||||
/**
|
||||
* 移除通道开启事件监听器
|
||||
*/
|
||||
off(event: 'open', callback: () => any): void;
|
||||
/**
|
||||
* 移除消息接收事件监听器
|
||||
*/
|
||||
off(event: 'message', callback: (message?: any) => any): void;
|
||||
/**
|
||||
* 移除通道消息完毕事件监听器
|
||||
*/
|
||||
off(event: 'end', callback: (message?: any) => any): void;
|
||||
/**
|
||||
* 移除通道关闭事件监听器
|
||||
*/
|
||||
off(event: 'close', callback: () => any): void;
|
||||
/**
|
||||
* 移除通道错误事件监听器
|
||||
*/
|
||||
off(event: 'error', callback: (err?: any) => any): void;
|
||||
/**
|
||||
* 移除通道开启事件监听器
|
||||
*/
|
||||
removeListener(event: 'open', callback: () => any): void;
|
||||
/**
|
||||
* 移除消息接收事件监听器
|
||||
*/
|
||||
removeListener(event: 'message', callback: (message?: any) => any): void;
|
||||
/**
|
||||
* 移除通道消息完毕事件监听器
|
||||
*/
|
||||
removeListener(event: 'end', callback: (message?: any) => any): void;
|
||||
/**
|
||||
* 移除通道关闭事件监听器
|
||||
*/
|
||||
removeListener(event: 'close', callback: () => any): void;
|
||||
/**
|
||||
* 移除通道错误事件监听器
|
||||
*/
|
||||
removeListener(event: 'error', callback: (err?: any) => any): void;
|
||||
/**
|
||||
* 移除指定事件的所有监听器
|
||||
*/
|
||||
removeAllListener(event: 'open' | 'message' | 'end' | 'close' | 'error'): void;
|
||||
}
|
||||
|
||||
interface UniCloud {
|
||||
/**
|
||||
* 云函数请求中的中间状态通知通道类
|
||||
*
|
||||
* 文档:[https://uniapp.dcloud.net.cn/uniCloud/sse-channel.html#create-sse-channel](https://uniapp.dcloud.net.cn/uniCloud/sse-channel.html#create-sse-channel)
|
||||
*/
|
||||
SSEChannel: SSEChannel;
|
||||
}
|
||||
}
|
324
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/storage.d.ts
generated
vendored
Normal file
324
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/storage.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,324 @@
|
|||
declare namespace UniCloudNamespace {
|
||||
interface GeneralCallbackResult {
|
||||
/**
|
||||
* 状态码,操作成功则不返回
|
||||
*/
|
||||
errCode: string;
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
errMsg: string;
|
||||
}
|
||||
|
||||
interface OnUploadProgressResult {
|
||||
/**
|
||||
* 已上传大小
|
||||
*/
|
||||
loaded: number;
|
||||
/**
|
||||
* 上传文件总大小
|
||||
*/
|
||||
total: number;
|
||||
}
|
||||
|
||||
interface UploadFileResult {
|
||||
/**
|
||||
* 文件唯一 ID,用来访问文件,建议存储起来
|
||||
*/
|
||||
fileID: string;
|
||||
}
|
||||
|
||||
interface UploadFileOptions {
|
||||
/**
|
||||
* 文件的绝对路径,包含文件名。例如 foo/bar.jpg、foo/bar/baz.jpg 等
|
||||
*/
|
||||
cloudPath: string;
|
||||
/**
|
||||
* 要上传的文件对象
|
||||
*/
|
||||
filePath: string;
|
||||
/**
|
||||
* 阿里云是否以cloudPath作为实际存储路径,默认为false(否)
|
||||
*/
|
||||
cloudPathAsRealPath?: boolean;
|
||||
/**
|
||||
* 上传进度回调
|
||||
*/
|
||||
onUploadProgress?: (result: OnUploadProgressResult) => void;
|
||||
/**
|
||||
* 成功返回的回调函数
|
||||
*/
|
||||
success?: (result: UploadFileResult) => void;
|
||||
/**
|
||||
* 失败返回的回调函数
|
||||
*/
|
||||
fail?: (result: GeneralCallbackResult) => void;
|
||||
/**
|
||||
* 结束的回调函数(调用成功、失败都会执行
|
||||
*/
|
||||
complete?: (result: UploadFileResult) => void;
|
||||
}
|
||||
|
||||
interface DeleteFileItem {
|
||||
/**
|
||||
* 云端fileID
|
||||
*/
|
||||
fileID: string;
|
||||
/**
|
||||
* 状态码,操作成功则不返回
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
|
||||
interface DeleteFileResult {
|
||||
/**
|
||||
* 要删除的文件 ID 组成的数组
|
||||
*/
|
||||
fileList: DeleteFileItem[];
|
||||
}
|
||||
|
||||
interface DeleteFileOptions {
|
||||
/**
|
||||
* 文件ID组成的数组
|
||||
*/
|
||||
fileList: any[];
|
||||
/**
|
||||
* 成功返回的回调函数
|
||||
*/
|
||||
success?: (result: DeleteFileResult) => void;
|
||||
/**
|
||||
* 失败返回的回调函数
|
||||
*/
|
||||
fail?: (result: GeneralCallbackResult) => void;
|
||||
/**
|
||||
* 结束的回调函数(调用成功、失败都会执行
|
||||
*/
|
||||
complete?: (result: DeleteFileResult) => void;
|
||||
}
|
||||
|
||||
interface GetTempFileURLItem {
|
||||
/**
|
||||
* 文件 ID
|
||||
*/
|
||||
fileID: string;
|
||||
/**
|
||||
* 状态码,操作成功则为 SUCCESS
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* 文件访问链接
|
||||
*/
|
||||
tempFileURL: string;
|
||||
}
|
||||
|
||||
interface GetTempFileURLResult {
|
||||
/**
|
||||
* 存储下载链接的数组
|
||||
*/
|
||||
fileList: any[];
|
||||
}
|
||||
|
||||
interface GetTempFileURLOptions {
|
||||
/**
|
||||
* 文件ID组成的数组
|
||||
*/
|
||||
fileList: any[];
|
||||
/**
|
||||
* 成功返回的回调函数
|
||||
*/
|
||||
success?: (result: GetTempFileURLResult) => void;
|
||||
/**
|
||||
* 失败返回的回调函数
|
||||
*/
|
||||
fail?: (result: GeneralCallbackResult) => void;
|
||||
/**
|
||||
* 结束的回调函数(调用成功、失败都会执行
|
||||
*/
|
||||
complete?: (result: GetTempFileURLResult) => void;
|
||||
}
|
||||
|
||||
interface ChooseAndUploadFileSuccessCallbackResult {
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
errMsg: string;
|
||||
/**
|
||||
* 临时文件路径列表
|
||||
*/
|
||||
tempFilePaths: any[];
|
||||
/**
|
||||
* 文件列表,每一项是一个 File 对象
|
||||
*/
|
||||
tempFiles: any[];
|
||||
}
|
||||
|
||||
interface ChooseAndUploadFileOnUploadProgressCallbackResult {
|
||||
/**
|
||||
* 触发当前上传进度回调的文件序号
|
||||
*/
|
||||
index: number;
|
||||
/**
|
||||
* 已上传大小
|
||||
*/
|
||||
loaded: number;
|
||||
/**
|
||||
* 总大小
|
||||
*/
|
||||
total: number;
|
||||
/**
|
||||
* 临时文件路径
|
||||
*/
|
||||
tempFilePath: string;
|
||||
/**
|
||||
* 文件对象
|
||||
*/
|
||||
tempFile: any;
|
||||
}
|
||||
|
||||
interface ChooseAndUploadFileOnChooseFileCallbackResult {
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
errMsg: string;
|
||||
/**
|
||||
* 临时文件路径列表
|
||||
*/
|
||||
tempFilePaths: any[];
|
||||
/**
|
||||
* 文件列表,每一项是一个 File 对象
|
||||
*/
|
||||
tempFiles: any[];
|
||||
}
|
||||
|
||||
interface ChooseAndUploadFileOptions {
|
||||
/**
|
||||
* 文件类型
|
||||
* - image: 图片
|
||||
* - video: 视频
|
||||
* - all: 任意文件
|
||||
*/
|
||||
type: 'image' | 'video' | 'all';
|
||||
/**
|
||||
* 文件数量
|
||||
*/
|
||||
count?: number;
|
||||
/**
|
||||
* 允许的文件后缀数组
|
||||
*/
|
||||
extension?: any[];
|
||||
/**
|
||||
* original 原图,compressed 压缩图,默认二者都有
|
||||
*/
|
||||
sizeType?: string | string[];
|
||||
/**
|
||||
* album 从相册选图,camera 使用相机,默认二者都有
|
||||
*/
|
||||
sourceType?: string | string[];
|
||||
/**
|
||||
* 摄像切换
|
||||
* - front: 前置摄像头
|
||||
* - back: 后置摄像头
|
||||
*/
|
||||
camera?: 'front' | 'back';
|
||||
/**
|
||||
* 是否压缩所选的视频源文件,默认值为true,需要压缩
|
||||
*/
|
||||
compressed?: boolean;
|
||||
/**
|
||||
* 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒
|
||||
*/
|
||||
maxDuration?: number;
|
||||
/**
|
||||
* 选择文件后的回调
|
||||
*/
|
||||
onChooseFile?: (result: ChooseAndUploadFileOnChooseFileCallbackResult) => void;
|
||||
/**
|
||||
* 上传进度回调
|
||||
*/
|
||||
onUploadProgress?: (result: ChooseAndUploadFileOnUploadProgressCallbackResult) => void;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: (result: ChooseAndUploadFileSuccessCallbackResult) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: (result: any) => void;
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: (result: any) => void;
|
||||
}
|
||||
|
||||
interface GetFileInfoOptions {
|
||||
fileList: Array<string>;
|
||||
}
|
||||
|
||||
interface GetFileInfoResponseFileItem {
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
fileId: string;
|
||||
/**
|
||||
* 文件上传时间(秒)
|
||||
*/
|
||||
gmtCreate: number;
|
||||
/**
|
||||
* 文件最近更改时间(秒)
|
||||
*/
|
||||
gmtModified: number;
|
||||
/**
|
||||
* 文件原始名称
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 文件大小(Byte)
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* 文件CDN加速访问下载链接
|
||||
*/
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface GetFileInfoResponse {
|
||||
fileList: Array<GetFileInfoResponseFileItem>;
|
||||
}
|
||||
|
||||
interface UniCloud {
|
||||
/**
|
||||
* 上传文件到云端
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/storage?id=uploadfile](https://uniapp.dcloud.io/uniCloud/storage?id=uploadfile)
|
||||
*/
|
||||
uploadFile(options: UploadFileOptions): Promise<any>;
|
||||
/**
|
||||
* 选择并上传文件
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/storage?id=chooseanduploadfile](https://uniapp.dcloud.io/uniCloud/storage?id=chooseanduploadfile)
|
||||
*/
|
||||
chooseAndUploadFile(options: ChooseAndUploadFileOptions): Promise<any>;
|
||||
/**
|
||||
* 删除云端文件
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/storage?id=deletefile](https://uniapp.dcloud.io/uniCloud/storage?id=deletefile)
|
||||
*/
|
||||
deleteFile(options: DeleteFileOptions): Promise<any>;
|
||||
/**
|
||||
* 获取文件临时链接
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/storage?id=gettempfileurl](https://uniapp.dcloud.io/uniCloud/storage?id=gettempfileurl)
|
||||
*/
|
||||
getTempFileURL(options: GetTempFileURLOptions): Promise<any>;
|
||||
/**
|
||||
* 获取文件信息,阿里云专用
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.io/uniCloud/storage?id=get-file-info](https://uniapp.dcloud.io/uniCloud/storage?id=get-file-info)
|
||||
*/
|
||||
getFileInfo(options: GetFileInfoOptions): Promise<GetFileInfoResponse>;
|
||||
}
|
||||
}
|
21
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/websocket.d.ts
generated
vendored
Normal file
21
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/extension/websocket.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
declare namespace UniCloudNamespace {
|
||||
interface ConnectWebSocketOptions {
|
||||
/**
|
||||
* WebSocket云函数/云对象名称
|
||||
*/
|
||||
name: string | string.CloudFunctionString;
|
||||
/**
|
||||
* 建立连接时需要传递的参数, 仅在 connection 事件中接收到
|
||||
*/
|
||||
query?: Record<string, string>;
|
||||
}
|
||||
|
||||
interface UniCloud {
|
||||
/**
|
||||
* 快速连接 WebSocket 服务
|
||||
*
|
||||
* 文档: [uniCloud.connectWebSocket](https://doc.dcloud.net.cn/uniCloud/websocket.html#unicloud-connectwebsocket)
|
||||
*/
|
||||
connectWebSocket(options: ConnectWebSocketOptions): UniApp.SocketTask;
|
||||
}
|
||||
}
|
2
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/index.d.ts
generated
vendored
Normal file
2
uniapp04/node_modules/@dcloudio/types/uni-app/uni-cloud-client/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/// <reference path="./base.d.ts" />
|
||||
/// <reference path="./extension/index.d.ts" />
|
2
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/index.d.ts
generated
vendored
Normal file
2
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/// <reference path="./wx/index.d.ts" />
|
||||
/// <reference path="./promisify/index.d.ts" />
|
34
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/promisify/common.d.ts
generated
vendored
Normal file
34
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/promisify/common.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
declare namespace UniNamespace {
|
||||
type PromisifySuccessResult<
|
||||
P,
|
||||
T extends {
|
||||
success?: (...args: any[]) => void
|
||||
},
|
||||
R = void
|
||||
> = P extends {
|
||||
success: any
|
||||
}
|
||||
? R
|
||||
: P extends { fail: any }
|
||||
? R
|
||||
: P extends { complete: any }
|
||||
? R
|
||||
: Promise<Parameters<Exclude<T['success'], undefined>>[0]>;
|
||||
|
||||
type ErrorFirstArray<T> = [any, T];
|
||||
|
||||
type PromisifySuccessResultLegacy<
|
||||
P,
|
||||
T extends {
|
||||
success?: (...args: any[]) => void
|
||||
}
|
||||
> = P extends {
|
||||
success: any
|
||||
}
|
||||
? void
|
||||
: P extends { fail: any }
|
||||
? void
|
||||
: P extends { complete: any }
|
||||
? void
|
||||
: Promise<ErrorFirstArray<Parameters<Exclude<T['success'], undefined>>[0]>>;
|
||||
}
|
2
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/promisify/index.d.ts
generated
vendored
Normal file
2
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/promisify/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/// <reference path="./common.d.ts" />
|
||||
/// <reference path="./uni.d.ts" />
|
140
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/promisify/uni.d.ts
generated
vendored
Normal file
140
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/promisify/uni.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,140 @@
|
|||
interface Uni {
|
||||
startFacialRecognitionVerify<T extends UniNamespace.StartFacialRecognitionVerifyOption = UniNamespace.StartFacialRecognitionVerifyOption>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StartFacialRecognitionVerifyOption>;
|
||||
getBatteryInfo<T extends UniNamespace.GetBatteryInfoOption = UniNamespace.GetBatteryInfoOption>(option?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetBatteryInfoOption>;
|
||||
startWifi<T extends UniNamespace.StartWifiOption = UniNamespace.StartWifiOption>(option?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StartWifiOption>;
|
||||
stopWifi<T extends UniNamespace.StopWifiOption = UniNamespace.StopWifiOption>(option?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StopWifiOption>;
|
||||
connectWifi<T extends UniNamespace.ConnectWifiOption = UniNamespace.ConnectWifiOption>(option: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ConnectWifiOption>;
|
||||
getConnectedWifi<T extends UniNamespace.GetConnectedWifiOption = UniNamespace.GetConnectedWifiOption>(option?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetConnectedWifiOption>;
|
||||
getWifiList<T extends UniNamespace.GetWifiListOption = UniNamespace.GetWifiListOption>(option?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetWifiListOption>;
|
||||
configMTLS<T extends UniNamespace.ConfigMTLSOptions = UniNamespace.ConfigMTLSOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ConfigMTLSOptions>;
|
||||
sendSocketMessage<T extends UniNamespace.SendSocketMessageOptions = UniNamespace.SendSocketMessageOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SendSocketMessageOptions>;
|
||||
closeSocket<T extends UniNamespace.CloseSocketOptions = UniNamespace.CloseSocketOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CloseSocketOptions>;
|
||||
chooseImage<T extends UniNamespace.ChooseImageOptions = UniNamespace.ChooseImageOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ChooseImageOptions>;
|
||||
chooseFile<T extends UniNamespace.ChooseFileOptions = UniNamespace.ChooseFileOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ChooseFileOptions>;
|
||||
previewImage<T extends UniNamespace.PreviewImageOptions = UniNamespace.PreviewImageOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.PreviewImageOptions>;
|
||||
closePreviewImage<T extends UniNamespace.CallBackOptions = UniNamespace.CallBackOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CallBackOptions>;
|
||||
getImageInfo<T extends UniNamespace.GetImageInfoOptions = UniNamespace.GetImageInfoOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetImageInfoOptions>;
|
||||
saveImageToPhotosAlbum<T extends UniNamespace.SaveImageToPhotosAlbumOptions = UniNamespace.SaveImageToPhotosAlbumOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SaveImageToPhotosAlbumOptions>;
|
||||
compressImage<T extends UniNamespace.CompressImageOptions = UniNamespace.CompressImageOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CompressImageOptions>;
|
||||
chooseVideo<T extends UniNamespace.ChooseVideoOptions = UniNamespace.ChooseVideoOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ChooseVideoOptions>;
|
||||
compressVideo<T extends UniNamespace.CompressVideoOptions = UniNamespace.CompressVideoOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CompressVideoOptions>;
|
||||
getVideoInfo<T extends UniNamespace.GetVideoInfoOptions = UniNamespace.GetVideoInfoOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetVideoInfoOptions>;
|
||||
openVideoEditor<T extends UniNamespace.OpenVideoEditorOptions = UniNamespace.OpenVideoEditorOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.OpenVideoEditorOptions>;
|
||||
saveVideoToPhotosAlbum<T extends UniNamespace.SaveVideoToPhotosAlbumOptions = UniNamespace.SaveVideoToPhotosAlbumOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SaveVideoToPhotosAlbumOptions>;
|
||||
saveFile<T extends UniNamespace.SaveFileOptions = UniNamespace.SaveFileOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SaveFileOptions>;
|
||||
getFileInfo<T extends UniNamespace.GetFileInfoOptions = UniNamespace.GetFileInfoOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetFileInfoOptions>;
|
||||
getSavedFileList<T extends UniNamespace.GetSavedFileListOptions = UniNamespace.GetSavedFileListOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetSavedFileListOptions>;
|
||||
getSavedFileInfo<T extends UniNamespace.GetSavedFileInfoOptions = UniNamespace.GetSavedFileInfoOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetSavedFileInfoOptions>;
|
||||
removeSavedFile<T extends UniNamespace.RemoveSavedFileOptions = UniNamespace.RemoveSavedFileOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.RemoveSavedFileOptions>;
|
||||
openDocument<T extends UniNamespace.OpenDocumentOptions = UniNamespace.OpenDocumentOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.OpenDocumentOptions>;
|
||||
setStorage<T extends UniNamespace.SetStorageOptions = UniNamespace.SetStorageOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetStorageOptions>;
|
||||
getStorage<T = any, U extends UniNamespace.GetStorageOptions<T> = UniNamespace.GetStorageOptions<T>>(options: U): UniNamespace.PromisifySuccessResult<U, UniNamespace.GetStorageOptions<T>>;
|
||||
getStorageInfo<T extends UniNamespace.GetStorageInfoOptions = UniNamespace.GetStorageInfoOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetStorageInfoOptions>;
|
||||
removeStorage<T extends UniNamespace.RemoveStorageOptions = UniNamespace.RemoveStorageOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.RemoveStorageOptions>;
|
||||
getLocation<T extends UniNamespace.GetLocationOptions = UniNamespace.GetLocationOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetLocationOptions>;
|
||||
chooseLocation<T extends UniNamespace.ChooseLocationOptions = UniNamespace.ChooseLocationOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ChooseLocationOptions>;
|
||||
openLocation<T extends UniNamespace.OpenLocationOptions = UniNamespace.OpenLocationOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.OpenLocationOptions>;
|
||||
getSystemInfo<T extends UniNamespace.GetSystemInfoOptions = UniNamespace.GetSystemInfoOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetSystemInfoOptions>;
|
||||
getNetworkType<T extends UniNamespace.GetNetworkTypeOptions = UniNamespace.GetNetworkTypeOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetNetworkTypeOptions>;
|
||||
startAccelerometer<T extends UniNamespace.StartAccelerometerOptions = UniNamespace.StartAccelerometerOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StartAccelerometerOptions>;
|
||||
stopAccelerometer<T extends UniNamespace.StopAccelerometerOptions = UniNamespace.StopAccelerometerOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StopAccelerometerOptions>;
|
||||
startCompass<T extends UniNamespace.StartCompassOptions = UniNamespace.StartCompassOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StartCompassOptions>;
|
||||
stopCompass<T extends UniNamespace.StopCompassOptions = UniNamespace.StopCompassOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StopCompassOptions>;
|
||||
makePhoneCall<T extends UniNamespace.MakePhoneCallOptions = UniNamespace.MakePhoneCallOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.MakePhoneCallOptions>;
|
||||
scanCode<T extends UniNamespace.ScanCodeOptions = UniNamespace.ScanCodeOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ScanCodeOptions>;
|
||||
setClipboardData<T extends UniNamespace.SetClipboardDataOptions = UniNamespace.SetClipboardDataOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetClipboardDataOptions>;
|
||||
getClipboardData<T extends UniNamespace.GetClipboardDataOptions = UniNamespace.GetClipboardDataOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetClipboardDataOptions>;
|
||||
openAppAuthorizeSetting<T extends UniNamespace.CallBackOptions = UniNamespace.CallBackOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CallBackOptions>;
|
||||
getSelectedTextRange<T extends UniNamespace.GetSelectedTextRangeOptions = UniNamespace.GetSelectedTextRangeOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetSelectedTextRangeOptions>;
|
||||
setScreenBrightness<T extends UniNamespace.SetScreenBrightnessOptions = UniNamespace.SetScreenBrightnessOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetScreenBrightnessOptions>;
|
||||
getScreenBrightness<T extends UniNamespace.GetScreenBrightnessOptions = UniNamespace.GetScreenBrightnessOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetScreenBrightnessOptions>;
|
||||
setKeepScreenOn<T extends UniNamespace.SetKeepScreenOnOptions = UniNamespace.SetKeepScreenOnOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetKeepScreenOnOptions>;
|
||||
vibrate<T extends UniNamespace.VibrateOptions = UniNamespace.VibrateOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.VibrateOptions>;
|
||||
vibrateLong<T extends UniNamespace.VibrateLongOptions = UniNamespace.VibrateLongOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.VibrateLongOptions>;
|
||||
vibrateShort<T extends UniNamespace.VibrateShortOptions = UniNamespace.VibrateShortOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.VibrateShortOptions>;
|
||||
addPhoneContact<T extends UniNamespace.AddPhoneContactOptions = UniNamespace.AddPhoneContactOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.AddPhoneContactOptions>;
|
||||
getBeacons<T extends UniNamespace.GetBeaconsOptions = UniNamespace.GetBeaconsOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetBeaconsOptions>;
|
||||
startBeaconDiscovery<T extends UniNamespace.StartBeaconDiscoveryOptions = UniNamespace.StartBeaconDiscoveryOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StartBeaconDiscoveryOptions>;
|
||||
stopBeaconDiscovery<T extends UniNamespace.StopBeaconDiscoveryOptions = UniNamespace.StopBeaconDiscoveryOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StopBeaconDiscoveryOptions>;
|
||||
closeBluetoothAdapter<T extends UniNamespace.CloseBluetoothAdapterOptions = UniNamespace.CloseBluetoothAdapterOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CloseBluetoothAdapterOptions>;
|
||||
getBluetoothAdapterState<T extends UniNamespace.GetBluetoothAdapterStateOptions = UniNamespace.GetBluetoothAdapterStateOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetBluetoothAdapterStateOptions>;
|
||||
getBluetoothDevices<T extends UniNamespace.GetBluetoothDevicesOptions = UniNamespace.GetBluetoothDevicesOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetBluetoothDevicesOptions>;
|
||||
getConnectedBluetoothDevices<T extends UniNamespace.GetConnectedBluetoothDevicesOptions = UniNamespace.GetConnectedBluetoothDevicesOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetConnectedBluetoothDevicesOptions>;
|
||||
openBluetoothAdapter<T extends UniNamespace.OpenBluetoothAdapterOptions = UniNamespace.OpenBluetoothAdapterOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.OpenBluetoothAdapterOptions>;
|
||||
startBluetoothDevicesDiscovery<T extends UniNamespace.StartBluetoothDevicesDiscoveryOptions = UniNamespace.StartBluetoothDevicesDiscoveryOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StartBluetoothDevicesDiscoveryOptions>;
|
||||
stopBluetoothDevicesDiscovery<T extends UniNamespace.StopBluetoothDevicesDiscoveryOptions = UniNamespace.StopBluetoothDevicesDiscoveryOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StopBluetoothDevicesDiscoveryOptions>;
|
||||
closeBLEConnection<T extends UniNamespace.CloseBLEConnectionOptions = UniNamespace.CloseBLEConnectionOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CloseBLEConnectionOptions>;
|
||||
createBLEConnection<T extends UniNamespace.CreateBLEConnectionOptions = UniNamespace.CreateBLEConnectionOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CreateBLEConnectionOptions>;
|
||||
getBLEDeviceCharacteristics<T extends UniNamespace.GetBLEDeviceCharacteristicsOptions = UniNamespace.GetBLEDeviceCharacteristicsOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetBLEDeviceCharacteristicsOptions>;
|
||||
getBLEDeviceServices<T extends UniNamespace.GetBLEDeviceServicesOptions = UniNamespace.GetBLEDeviceServicesOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetBLEDeviceServicesOptions>;
|
||||
notifyBLECharacteristicValueChange<T extends UniNamespace.NotifyBLECharacteristicValueChangeOptions = UniNamespace.NotifyBLECharacteristicValueChangeOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.NotifyBLECharacteristicValueChangeOptions>;
|
||||
readBLECharacteristicValue<T extends UniNamespace.ReadBLECharacteristicValueOptions = UniNamespace.ReadBLECharacteristicValueOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ReadBLECharacteristicValueOptions>;
|
||||
writeBLECharacteristicValue<T extends UniNamespace.WriteBLECharacteristicValueOptions = UniNamespace.WriteBLECharacteristicValueOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.WriteBLECharacteristicValueOptions>;
|
||||
setBLEMTU<T extends UniNamespace.SetBLEMTUOptions = UniNamespace.SetBLEMTUOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetBLEMTUOptions>;
|
||||
getBLEDeviceRSSI<T extends UniNamespace.GetBLEDeviceRSSIOptions = UniNamespace.GetBLEDeviceRSSIOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetBLEDeviceRSSIOptions>;
|
||||
showToast<T extends UniNamespace.ShowToastOptions = UniNamespace.ShowToastOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ShowToastOptions>;
|
||||
showLoading<T extends UniNamespace.ShowLoadingOptions = UniNamespace.ShowLoadingOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ShowLoadingOptions>;
|
||||
showModal<T extends UniNamespace.ShowModalOptions = UniNamespace.ShowModalOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ShowModalOptions>;
|
||||
showActionSheet<T extends UniNamespace.ShowActionSheetOptions = UniNamespace.ShowActionSheetOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ShowActionSheetOptions>;
|
||||
setNavigationBarTitle<T extends UniNamespace.SetNavigationBarTitleOptions = UniNamespace.SetNavigationBarTitleOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetNavigationBarTitleOptions>;
|
||||
setNavigationBarColor<T extends UniNamespace.SetNavigationbarColorOptions = UniNamespace.SetNavigationbarColorOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetNavigationbarColorOptions>;
|
||||
setTabBarItem<T extends UniNamespace.SetTabBarItemOptions = UniNamespace.SetTabBarItemOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetTabBarItemOptions>;
|
||||
setTabBarStyle<T extends UniNamespace.SetTabBarStyleOptions = UniNamespace.SetTabBarStyleOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetTabBarStyleOptions>;
|
||||
hideTabBar<T extends UniNamespace.HideTabBarOptions = UniNamespace.HideTabBarOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.HideTabBarOptions>;
|
||||
showTabBar<T extends UniNamespace.ShowTabBarOptions = UniNamespace.ShowTabBarOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ShowTabBarOptions>;
|
||||
setTabBarBadge<T extends UniNamespace.SetTabBarBadgeOptions = UniNamespace.SetTabBarBadgeOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetTabBarBadgeOptions>;
|
||||
removeTabBarBadge<T extends UniNamespace.RemoveTabBarBadgeOptions = UniNamespace.RemoveTabBarBadgeOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.RemoveTabBarBadgeOptions>;
|
||||
showTabBarRedDot<T extends UniNamespace.ShowTabBarRedDotOptions = UniNamespace.ShowTabBarRedDotOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ShowTabBarRedDotOptions>;
|
||||
hideTabBarRedDot<T extends UniNamespace.HideTabBarRedDotOptions = UniNamespace.HideTabBarRedDotOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.HideTabBarRedDotOptions>;
|
||||
navigateTo<T extends UniNamespace.NavigateToOptions = UniNamespace.NavigateToOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.NavigateToOptions>;
|
||||
redirectTo<T extends UniNamespace.RedirectToOptions = UniNamespace.RedirectToOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.RedirectToOptions>;
|
||||
reLaunch<T extends UniNamespace.ReLaunchOptions = UniNamespace.ReLaunchOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ReLaunchOptions>;
|
||||
switchTab<T extends UniNamespace.SwitchTabOptions = UniNamespace.SwitchTabOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SwitchTabOptions>;
|
||||
navigateBack<T extends UniNamespace.NavigateBackOptions = UniNamespace.NavigateBackOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.NavigateBackOptions>;
|
||||
preloadPage<T extends UniNamespace.PreloadPageOptions = UniNamespace.PreloadPageOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.PreloadPageOptions>;
|
||||
pageScrollTo<T extends UniNamespace.PageScrollToOptions = UniNamespace.PageScrollToOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.PageScrollToOptions>;
|
||||
startPullDownRefresh<T extends UniNamespace.StartPullDownRefreshOptions = UniNamespace.StartPullDownRefreshOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StartPullDownRefreshOptions>;
|
||||
canvasToTempFilePath<T extends UniNamespace.CanvasToTempFilePathOptions = UniNamespace.CanvasToTempFilePathOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CanvasToTempFilePathOptions>;
|
||||
canvasGetImageData<T extends UniNamespace.CanvasGetImageDataOptions = UniNamespace.CanvasGetImageDataOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CanvasGetImageDataOptions>;
|
||||
canvasPutImageData<T extends UniNamespace.CanvasPutImageDataOptions = UniNamespace.CanvasPutImageDataOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CanvasPutImageDataOptions>;
|
||||
showTopWindow<T extends UniNamespace.CommonOptions = UniNamespace.CommonOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CommonOptions>;
|
||||
hideTopWindow<T extends UniNamespace.CommonOptions = UniNamespace.CommonOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CommonOptions>;
|
||||
showLeftWindow<T extends UniNamespace.CommonOptions = UniNamespace.CommonOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CommonOptions>;
|
||||
hideLeftWindow<T extends UniNamespace.CommonOptions = UniNamespace.CommonOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CommonOptions>;
|
||||
showRightWindow<T extends UniNamespace.CommonOptions = UniNamespace.CommonOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CommonOptions>;
|
||||
hideRightWindow<T extends UniNamespace.CommonOptions = UniNamespace.CommonOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CommonOptions>;
|
||||
getProvider<T extends UniNamespace.GetProviderOptions = UniNamespace.GetProviderOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetProviderOptions>;
|
||||
login<T extends UniNamespace.LoginOptions = UniNamespace.LoginOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.LoginOptions>;
|
||||
checkSession<T extends UniNamespace.CheckSessionOptions = UniNamespace.CheckSessionOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CheckSessionOptions>;
|
||||
getUserInfo<T extends UniNamespace.GetUserInfoOptions = UniNamespace.GetUserInfoOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetUserInfoOptions>;
|
||||
getUserProfile<T extends UniNamespace.GetUserProfileOptions = UniNamespace.GetUserProfileOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetUserProfileOptions>;
|
||||
preLogin<T extends UniNamespace.PreLoginOptions = UniNamespace.PreLoginOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.PreLoginOptions>;
|
||||
getCheckBoxState<T extends UniNamespace.GetCheckBoxStateOptions = UniNamespace.GetCheckBoxStateOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetCheckBoxStateOptions>;
|
||||
share<T extends UniNamespace.ShareOptions = UniNamespace.ShareOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ShareOptions>;
|
||||
shareWithSystem<T extends UniNamespace.ShareWithSystemOptions = UniNamespace.ShareWithSystemOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ShareWithSystemOptions>;
|
||||
getPushClientId<T extends UniNamespace.GetPushClientIdOptions = UniNamespace.GetPushClientIdOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetPushClientIdOptions>;
|
||||
requestPayment<T extends UniNamespace.RequestPaymentOptions = UniNamespace.RequestPaymentOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.RequestPaymentOptions>;
|
||||
authorize<T extends UniNamespace.AuthorizeOptions = UniNamespace.AuthorizeOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.AuthorizeOptions>;
|
||||
openSetting<T extends UniNamespace.OpenSettingOptions = UniNamespace.OpenSettingOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.OpenSettingOptions>;
|
||||
getSetting<T extends UniNamespace.GetSettingOptions = UniNamespace.GetSettingOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetSettingOptions>;
|
||||
chooseAddress<T extends UniNamespace.ChooseAddressOptions = UniNamespace.ChooseAddressOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ChooseAddressOptions>;
|
||||
chooseInvoiceTitle<T extends UniNamespace.ChooseInvoiceTitleOptions = UniNamespace.ChooseInvoiceTitleOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ChooseInvoiceTitleOptions>;
|
||||
navigateToMiniProgram<T extends UniNamespace.NavigateToMiniProgramOptions = UniNamespace.NavigateToMiniProgramOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.NavigateToMiniProgramOptions>;
|
||||
navigateBackMiniProgram<T extends UniNamespace.NavigateBackMiniProgramOptions = UniNamespace.NavigateBackMiniProgramOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.NavigateBackMiniProgramOptions>;
|
||||
setEnableDebug<T extends UniNamespace.SetEnableDebugOptions = UniNamespace.SetEnableDebugOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetEnableDebugOptions>;
|
||||
getExtConfig<T extends UniNamespace.GetExtConfigOptions = UniNamespace.GetExtConfigOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.GetExtConfigOptions>;
|
||||
showShareMenu<T extends UniNamespace.ShowShareMenuOptions = UniNamespace.ShowShareMenuOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ShowShareMenuOptions>;
|
||||
hideShareMenu<T extends UniNamespace.HideShareMenuOptions = UniNamespace.HideShareMenuOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.HideShareMenuOptions>;
|
||||
setBackgroundColor<T extends UniNamespace.SetBackgroundColorOptions = UniNamespace.SetBackgroundColorOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetBackgroundColorOptions>;
|
||||
setBackgroundTextStyle<T extends UniNamespace.SetBackgroundTextStyleOptions = UniNamespace.SetBackgroundTextStyleOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.SetBackgroundTextStyleOptions>;
|
||||
startGyroscope<T extends UniNamespace.StartGyroscopeOptions = UniNamespace.StartGyroscopeOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StartGyroscopeOptions>;
|
||||
stopGyroscope<T extends UniNamespace.StopGyroscopeOptions = UniNamespace.StopGyroscopeOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StopGyroscopeOptions>;
|
||||
loadFontFace<T extends UniNamespace.LoadFontFaceOptions = UniNamespace.LoadFontFaceOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.LoadFontFaceOptions>;
|
||||
startSoterAuthentication<T extends UniNamespace.StartSoterAuthenticationOptions = UniNamespace.StartSoterAuthenticationOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.StartSoterAuthenticationOptions>;
|
||||
checkIsSupportSoterAuthentication<T extends UniNamespace.CheckIsSupportSoterAuthenticationOptions = UniNamespace.CheckIsSupportSoterAuthenticationOptions>(options?: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CheckIsSupportSoterAuthenticationOptions>;
|
||||
checkIsSoterEnrolledInDevice<T extends UniNamespace.CheckIsSoterEnrolledInDeviceOptions = UniNamespace.CheckIsSoterEnrolledInDeviceOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.CheckIsSoterEnrolledInDeviceOptions>;
|
||||
connectSocket<T extends UniNamespace.ConnectSocketOption = UniNamespace.ConnectSocketOption>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.ConnectSocketOption, UniNamespace.SocketTask>;
|
||||
request<T extends UniNamespace.RequestOptions = UniNamespace.RequestOptions>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.RequestOptions, UniNamespace.RequestTask>;
|
||||
uploadFile<T extends UniNamespace.UploadFileOption = UniNamespace.UploadFileOption>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.UploadFileOption, UniNamespace.UploadTask>;
|
||||
downloadFile<T extends UniNamespace.DownloadFileOption = UniNamespace.DownloadFileOption>(options: T): UniNamespace.PromisifySuccessResult<T, UniNamespace.DownloadFileOption, UniNamespace.DownloadTask>;
|
||||
}
|
13896
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/wx/index.d.ts
generated
vendored
Normal file
13896
uniapp04/node_modules/@dcloudio/types/uni-app/uni-patches/wx/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
68
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/Error.d.ts
generated
vendored
Normal file
68
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/Error.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
declare namespace UniNamespace {
|
||||
interface GeneralCallbackResult {
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
errMsg: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序错误事件的监听函数
|
||||
*/
|
||||
type OnAppErrorCallback = (
|
||||
/** 错误信息,包含堆栈 */
|
||||
error: string
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* onError 传入的监听函数。不传此参数则移除所有监听函数。
|
||||
*/
|
||||
type OffAppErrorCallback = (res: GeneralCallbackResult) => void;
|
||||
|
||||
interface SourceError {
|
||||
subject?: string;
|
||||
code?: number;
|
||||
message?: string;
|
||||
cause?: SourceError | AggregateError;
|
||||
}
|
||||
|
||||
// 聚合源错误信息
|
||||
interface AggregateError extends SourceError {
|
||||
errors: Array<SourceError | AggregateError>;
|
||||
}
|
||||
|
||||
interface UniError {
|
||||
errSubject: string;
|
||||
errCode: number;
|
||||
errMsg: string;
|
||||
data?: object;
|
||||
cause?: SourceError | AggregateError;
|
||||
}
|
||||
}
|
||||
|
||||
interface Uni {
|
||||
/**
|
||||
*
|
||||
* 需要基础库: `2.1.2`
|
||||
*
|
||||
* 在插件中使用:不支持
|
||||
*
|
||||
* 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 [`App.onError`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onerrorstring-error) 的回调时机与参数一致。
|
||||
*
|
||||
* 文档: [https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html)
|
||||
*/
|
||||
onError(listener: UniNamespace.OnAppErrorCallback): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* 需要基础库: `2.1.2`
|
||||
*
|
||||
* 在插件中使用:不支持
|
||||
*
|
||||
* 移除小程序错误事件的监听函数
|
||||
*
|
||||
*
|
||||
* 文档: [https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offError.html](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offError.html)
|
||||
*/
|
||||
offError(listener?: UniNamespace.OffAppErrorCallback): void;
|
||||
}
|
402
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/MapContext.d.ts
generated
vendored
Normal file
402
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/MapContext.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,402 @@
|
|||
import { AsyncOptions } from './Utils';
|
||||
|
||||
declare global {
|
||||
namespace UniNamespace {
|
||||
interface MapContext {
|
||||
/**
|
||||
* 获取当前地图中心的经纬度,返回的是 gcj02 坐标系,可以用于 uni.openLocation
|
||||
*/
|
||||
getCenterLocation(options: MapContextGetCenterLocationOptions): void;
|
||||
/**
|
||||
* 将地图中心移动到当前定位点,需要配合map组件的show-location使用
|
||||
*/
|
||||
moveToLocation(options: MapContextMoveToLocationOptions): void;
|
||||
/**
|
||||
* 平移marker,带动画
|
||||
*/
|
||||
translateMarker(options: MapContextTranslateMarkerOptions): void;
|
||||
/**
|
||||
* 缩放视野展示所有经纬度
|
||||
*/
|
||||
includePoints(options: MapContextIncludePointsOptions): void;
|
||||
/**
|
||||
* 获取当前地图的视野范围
|
||||
*/
|
||||
getRegion(options: MapContextGetRegionOptions): void;
|
||||
/**
|
||||
* 获取当前地图的缩放级别
|
||||
*/
|
||||
getScale(options: MapContextGetScaleOptions): void;
|
||||
/**
|
||||
* 添加个性化图层
|
||||
*/
|
||||
addCustomLayer?: (options: MapContextAddCustomLayerOptions) => void;
|
||||
/**
|
||||
* 创建自定义图片图层,图片会随着地图缩放而缩放
|
||||
*/
|
||||
addGroundOverlay(options: MapContextAddGroundOverlayOptions): void;
|
||||
/**
|
||||
* 添加 marker
|
||||
*/
|
||||
addMarkers(options: MapContextAddMarkersOptions): void;
|
||||
/**
|
||||
* 获取屏幕上的点对应的经纬度,坐标原点为地图左上角
|
||||
*/
|
||||
fromScreenLocation?: (options: MapContextFromScreenLocationOptions) => void;
|
||||
/**
|
||||
* 初始化点聚合的配置,未调用时采用默认配置
|
||||
*/
|
||||
initMarkerCluster(options: MapContextInitMarkerClusterOptions): void;
|
||||
/**
|
||||
* 沿指定路径移动 marker,用于轨迹回放等场景。动画完成时触发回调事件,若动画进行中,对同一 marker 再次调用 moveAlong 方法,前一次的动画将被打断。
|
||||
*/
|
||||
moveAlong(options: MapContextMoveAlongOptions): void;
|
||||
/**
|
||||
* 拉起地图APP选择导航。
|
||||
*/
|
||||
openMapApp(options: MapContextOpenMapAppOptions): void;
|
||||
/**
|
||||
* 移除个性化图层
|
||||
*/
|
||||
removeCustomLayer(options: MapContextRemoveCustomLayerOptions): void;
|
||||
/**
|
||||
* 移除自定义图片图层
|
||||
*/
|
||||
removeGroundOverlay(options: MapContextRemoveGroundOverlayOptions): void;
|
||||
/**
|
||||
* 移除 marker
|
||||
*/
|
||||
removeMarkers(options: MapContextRemoveMarkersOptions): void;
|
||||
/**
|
||||
* 设置地图中心点偏移,向后向下为增长,屏幕比例范围(0.25~0.75),默认偏移为[0.5, 0.5]
|
||||
*/
|
||||
setCenterOffset?: (options: MapContextSetCenterOffsetOptions) => void;
|
||||
/**
|
||||
* 获取经纬度对应的屏幕坐标,坐标原点为地图左上角。
|
||||
*/
|
||||
toScreenLocation?: (options: MapContextToScreenLocationOptions) => void;
|
||||
/**
|
||||
* 更新自定义图片图层。
|
||||
*/
|
||||
updateGroundOverlay(options: MapContextUpdateGroundOverlayOptions): void;
|
||||
/**
|
||||
* 监听地图事件。
|
||||
*/
|
||||
on(event: 'markerClusterCreate' | 'markerClusterClick', callback: (...args: any[]) => any): void;
|
||||
/**
|
||||
* 获取原生地图对象 plus.maps.Map
|
||||
*/
|
||||
$getAppMap(): any;
|
||||
}
|
||||
|
||||
interface MapContextGetCenterLocationOptions extends AsyncOptions {
|
||||
/**
|
||||
* 接口调用成功的回调函数 ,res = { longitude: "经度", latitude: "纬度"}
|
||||
*/
|
||||
success?: (result: LocationObject) => void;
|
||||
}
|
||||
|
||||
interface MapContextMoveToLocationOptions extends AsyncOptions {
|
||||
/**
|
||||
* 纬度,浮点数,范围为-90~90,负数表示南纬
|
||||
*/
|
||||
latitude?: number;
|
||||
/**
|
||||
* 经度,范围为-180~180,负数表示西经
|
||||
*/
|
||||
longitude?: number;
|
||||
}
|
||||
|
||||
interface LocationObject {
|
||||
/**
|
||||
* 纬度,浮点数,范围为-90~90,负数表示南纬
|
||||
*/
|
||||
latitude: number;
|
||||
/**
|
||||
* 经度,范围为-180~180,负数表示西经
|
||||
*/
|
||||
longitude: number;
|
||||
}
|
||||
|
||||
interface MapContextTranslateMarkerOptions extends AsyncOptions {
|
||||
/**
|
||||
* 指定marker
|
||||
*/
|
||||
markerId: number;
|
||||
/**
|
||||
* 指定marker移动到的目标点
|
||||
*/
|
||||
destination: LocationObject;
|
||||
/**
|
||||
* 移动过程中是否自动旋转marker
|
||||
*/
|
||||
autoRotate: boolean;
|
||||
/**
|
||||
* marker的旋转角度
|
||||
*/
|
||||
rotate: number;
|
||||
/**
|
||||
* 平移和旋转同时进行,默认值false(仅微信小程序2.13.0支持)
|
||||
*/
|
||||
moveWithRotate?: boolean;
|
||||
/**
|
||||
* 动画持续时长,默认值1000ms,平移与旋转分别计算
|
||||
*/
|
||||
duration?: number;
|
||||
/**
|
||||
* 动画结束回调函数
|
||||
*/
|
||||
animationEnd?: (result: any) => void;
|
||||
}
|
||||
|
||||
interface MapContextIncludePointsOptions extends AsyncOptions {
|
||||
/**
|
||||
* 要显示在可视区域内的坐标点列表,[{latitude, longitude}]
|
||||
*/
|
||||
points: LocationObject[];
|
||||
/**
|
||||
* 坐标点形成的矩形边缘到地图边缘的距离,单位像素。格式为[上,右,下,左],安卓上只能识别数组第一项,上下左右的padding一致。开发者工具暂不支持padding参数。
|
||||
*/
|
||||
padding?: number[];
|
||||
}
|
||||
|
||||
interface MapContextGetRegionOptions extends AsyncOptions {
|
||||
/**
|
||||
* 接口调用成功的回调函数,res = {southwest, northeast},西南角与东北角的经纬度
|
||||
*/
|
||||
success?: (result: MapContextGetRegionResult) => void;
|
||||
}
|
||||
|
||||
interface MapContextGetRegionResult {
|
||||
/**
|
||||
* 西南角的经纬度
|
||||
*/
|
||||
southwest: LocationObject;
|
||||
/**
|
||||
* 东北角的经纬度
|
||||
*/
|
||||
northeast: LocationObject;
|
||||
}
|
||||
|
||||
interface MapContextGetScaleOptions extends AsyncOptions {
|
||||
/**
|
||||
* 接口调用成功的回调函数,res = {scale}
|
||||
*/
|
||||
success?: (result: MapContextGetScaleResult) => void;
|
||||
}
|
||||
|
||||
interface MapContextGetScaleResult {
|
||||
/**
|
||||
* 地图缩放级别
|
||||
*/
|
||||
scale: number;
|
||||
}
|
||||
|
||||
interface MapContextAddCustomLayerOptions extends AsyncOptions {
|
||||
/**
|
||||
* 个性化图层id
|
||||
*/
|
||||
layerId: string;
|
||||
}
|
||||
|
||||
interface MapContextAddGroundOverlayOptions extends AsyncOptions {
|
||||
/**
|
||||
* 图片图层 id
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* 图片路径,支持网络图片、临时路径、代码包路径
|
||||
*/
|
||||
src: string;
|
||||
/**
|
||||
* 图片覆盖的经纬度范围
|
||||
*/
|
||||
bounds: Bounds;
|
||||
/**
|
||||
* 是否可见
|
||||
*/
|
||||
visible?: boolean;
|
||||
/**
|
||||
* 图层绘制顺序
|
||||
*/
|
||||
zIndex?: number;
|
||||
/**
|
||||
* 图层透明度
|
||||
*/
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface Bounds {
|
||||
/**
|
||||
* 西南角的经纬度
|
||||
*/
|
||||
southwest: LocationObject;
|
||||
/**
|
||||
* 东北角的经纬度
|
||||
*/
|
||||
northeast: LocationObject;
|
||||
}
|
||||
|
||||
interface MapContextAddMarkersOptions extends AsyncOptions {
|
||||
/**
|
||||
* 同传入 map 组件的 marker 属性
|
||||
*/
|
||||
markers: any[];
|
||||
/**
|
||||
* 是否先清空地图上所有 marker
|
||||
*/
|
||||
clear: boolean;
|
||||
}
|
||||
|
||||
interface MapContextFromScreenLocationOptions extends AsyncOptions {
|
||||
/**
|
||||
* x 坐标值
|
||||
*/
|
||||
x: number;
|
||||
/**
|
||||
* y 坐标值
|
||||
*/
|
||||
y: number;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: (result: LocationObject) => void;
|
||||
}
|
||||
|
||||
interface MapContextInitMarkerClusterOptions extends AsyncOptions {
|
||||
/**
|
||||
* 启用默认的聚合样式
|
||||
*/
|
||||
enableDefaultStyle: boolean;
|
||||
/**
|
||||
* 点击已经聚合的标记点时是否实现聚合分离
|
||||
*/
|
||||
zoomOnClick: boolean;
|
||||
/**
|
||||
* 聚合算法的可聚合距离,即距离小于该值的点会聚合至一起,以像素为单位
|
||||
*/
|
||||
gridSize: number;
|
||||
}
|
||||
|
||||
interface MapContextMoveAlongOptions extends AsyncOptions {
|
||||
/**
|
||||
* 指定 marker
|
||||
*/
|
||||
markerId: number;
|
||||
/**
|
||||
* 移动路径的坐标串,坐标点格式 {longitude, latitude}
|
||||
*/
|
||||
path: LocationObject[];
|
||||
/**
|
||||
* 根据路径方向自动改变 marker 的旋转角度
|
||||
*/
|
||||
autoRotate?: boolean;
|
||||
/**
|
||||
* 平滑移动的时间
|
||||
*/
|
||||
duration: number;
|
||||
}
|
||||
|
||||
interface MapContextOpenMapAppOptions extends AsyncOptions {
|
||||
/**
|
||||
* 目的地名称
|
||||
*/
|
||||
destination: string;
|
||||
/**
|
||||
* 目的地纬度
|
||||
*/
|
||||
latitude: number;
|
||||
/**
|
||||
* 目的地经度
|
||||
*/
|
||||
longitude: number;
|
||||
}
|
||||
|
||||
interface MapContextRemoveCustomLayerOptions extends AsyncOptions {
|
||||
/**
|
||||
* 个性化图层id
|
||||
*/
|
||||
layerId: string;
|
||||
}
|
||||
|
||||
interface MapContextRemoveGroundOverlayOptions extends AsyncOptions {
|
||||
/**
|
||||
* 图片图层 id
|
||||
*/
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface MapContextRemoveMarkersOptions extends AsyncOptions {
|
||||
/**
|
||||
* 要被删除的marker的id属性组成的数组
|
||||
*/
|
||||
markerIds: any[];
|
||||
}
|
||||
|
||||
interface MapContextSetCenterOffsetOptions {
|
||||
/**
|
||||
* 偏移量,两位数组
|
||||
*/
|
||||
offset: number[];
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: (result: any) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: (result: any) => void;
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: (result: any) => void;
|
||||
}
|
||||
|
||||
interface MapContextToScreenLocationOptions extends AsyncOptions {
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
latitude: number;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
longitude: number;
|
||||
}
|
||||
|
||||
interface MapContextUpdateGroundOverlayOptions extends AsyncOptions {
|
||||
/**
|
||||
* 图片图层 id
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* 图片路径,支持网络图片、临时路径、代码包路径
|
||||
*/
|
||||
src: string;
|
||||
/**
|
||||
* 图片路径,支持网络图片、临时路径、代码包路径
|
||||
*/
|
||||
bounds: Bounds;
|
||||
/**
|
||||
* 是否可见
|
||||
*/
|
||||
visible?: boolean;
|
||||
/**
|
||||
* 图层绘制顺序
|
||||
*/
|
||||
zIndex?: number;
|
||||
/**
|
||||
* 图层透明度
|
||||
*/
|
||||
opacity?: number;
|
||||
}
|
||||
}
|
||||
|
||||
interface Uni {
|
||||
/**
|
||||
* 创建并返回 map 上下文 mapContext 对象
|
||||
*
|
||||
* 文档: [http://uniapp.dcloud.io/api/location/map?id=createmapcontext](http://uniapp.dcloud.io/api/location/map?id=createmapcontext)
|
||||
*/
|
||||
createMapContext(mapId: string, currentComponent?: any): UniNamespace.MapContext;
|
||||
}
|
||||
}
|
24
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/ThemeChange.d.ts
generated
vendored
Normal file
24
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/ThemeChange.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
declare namespace UniNamespace {
|
||||
interface OnThemeChangeCallbackResult {
|
||||
/**
|
||||
* 主题名称
|
||||
*/
|
||||
theme: 'dark' | 'light';
|
||||
}
|
||||
type OnThemeChangeCallback = (res: OnThemeChangeCallbackResult) => void;
|
||||
}
|
||||
|
||||
interface Uni {
|
||||
/**
|
||||
* 监听系统主题状态变化。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/theme.html#onthemechange](https://uniapp.dcloud.net.cn/api/system/theme.html#onthemechange)
|
||||
*/
|
||||
onThemeChange(callback: UniNamespace.OnThemeChangeCallback): void;
|
||||
/**
|
||||
* 取消监听系统主题状态变化。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/theme.html#offthemechange](https://uniapp.dcloud.net.cn/api/system/theme.html#offthemechange)
|
||||
*/
|
||||
offThemeChange(callback: UniNamespace.OnThemeChangeCallback): void;
|
||||
}
|
43
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/UnhandledRejectiond.d.ts
generated
vendored
Normal file
43
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/UnhandledRejectiond.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
declare namespace UniNamespace {
|
||||
interface OnUnhandledRejectionCallbackResult {
|
||||
/**
|
||||
* 被拒绝的 Promise 对象
|
||||
*/
|
||||
promise: Promise<any>;
|
||||
/**
|
||||
* 拒绝原因,一般是一个 Error 对象
|
||||
*/
|
||||
reason: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 未处理的 Promise 拒绝事件的回调函数
|
||||
*/
|
||||
type OnUnhandledRejectionCallback = (result: OnUnhandledRejectionCallbackResult) => void;
|
||||
}
|
||||
|
||||
interface Uni {
|
||||
/**
|
||||
* 监听未处理的 Promise 拒绝事件。该事件与 `App.onUnhandledRejection` 的回调时机与参数一致。
|
||||
*
|
||||
* **注意**
|
||||
*
|
||||
*
|
||||
* - 安卓平台暂时不支持该事件
|
||||
* - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。
|
||||
*
|
||||
* 最低基础库: `2.10.0`
|
||||
*
|
||||
* 文档: [https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html)
|
||||
*/
|
||||
onUnhandledRejection(callback: UniNamespace.OnUnhandledRejectionCallback): void;
|
||||
|
||||
/**
|
||||
* 取消监听未处理的 Promise 拒绝事件
|
||||
*
|
||||
* 最低基础库: `2.10.0`
|
||||
*
|
||||
* 文档: [https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html)
|
||||
*/
|
||||
offUnhandledRejection(callback: UniNamespace.OnUnhandledRejectionCallback): void;
|
||||
}
|
14
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/Utils.d.ts
generated
vendored
Normal file
14
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/Utils.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
export interface AsyncOptions {
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: (result: any) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: (result: any) => void;
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: (result: any) => void;
|
||||
}
|
5
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/index.d.ts
generated
vendored
Normal file
5
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
/// <reference path="./ThemeChange.d.ts" />
|
||||
/// <reference path="./UnhandledRejectiond.d.ts" />
|
||||
/// <reference path="./Error.d.ts" />
|
||||
/// <reference path="./MapContext.d.ts" />
|
||||
/// <reference path="./request.d.ts" />
|
200
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/request.d.ts
generated
vendored
Normal file
200
uniapp04/node_modules/@dcloudio/types/uni-app/uni/base/request.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,200 @@
|
|||
declare namespace UniNamespace {
|
||||
interface RequestOptions {
|
||||
/**
|
||||
* 资源url
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* 请求的参数
|
||||
*/
|
||||
data?: string | AnyObject | ArrayBuffer;
|
||||
/**
|
||||
* 设置请求的 header,header 中不能设置 Referer。
|
||||
*/
|
||||
header?: any;
|
||||
/**
|
||||
* 默认为 GET
|
||||
* 可以是:OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT
|
||||
*/
|
||||
method?: 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'CONNECT';
|
||||
/**
|
||||
* 超时时间
|
||||
*/
|
||||
timeout?: number;
|
||||
/**
|
||||
* 如果设为json,会尝试对返回的数据做一次 JSON.parse
|
||||
*/
|
||||
dataType?: string;
|
||||
/**
|
||||
* 设置响应的数据类型。合法值:text、arraybuffer
|
||||
*/
|
||||
responseType?: string;
|
||||
/**
|
||||
* 验证 ssl 证书
|
||||
*/
|
||||
sslVerify?: boolean;
|
||||
/**
|
||||
* 跨域请求时是否携带凭证
|
||||
*/
|
||||
withCredentials?: boolean;
|
||||
/**
|
||||
* DNS解析时优先使用 ipv4
|
||||
*/
|
||||
firstIpv4?: boolean;
|
||||
/**
|
||||
* 开启 http2
|
||||
*/
|
||||
enableHttp2?: boolean;
|
||||
/**
|
||||
* 开启 quic
|
||||
*/
|
||||
enableQuic?: boolean;
|
||||
/**
|
||||
* 开启 cache
|
||||
*/
|
||||
enableCache?: boolean;
|
||||
/**
|
||||
* 是否开启 HttpDNS 服务。如开启,需要同时填入 httpDNSServiceId 。 HttpDNS 用法详见 [移动解析HttpDNS](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html)
|
||||
*/
|
||||
enableHttpDNS?: boolean;
|
||||
/**
|
||||
* HttpDNS 服务商 Id。 HttpDNS 用法详见 [移动解析HttpDNS](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html)
|
||||
*/
|
||||
httpDNSServiceId?: boolean;
|
||||
/**
|
||||
* 开启 transfer-encoding chunked
|
||||
*/
|
||||
enableChunked?: boolean;
|
||||
/**
|
||||
* wifi下使用移动网络发送请求
|
||||
*/
|
||||
forceCellularNetwork?: boolean;
|
||||
/**
|
||||
* 默认 false,开启后可在headers中编辑cookie(支付宝小程序10.2.33版本开始支持)
|
||||
*/
|
||||
enableCookie?: boolean;
|
||||
/**
|
||||
* 是否开启云加速(详见[云加速服务](https://smartprogram.baidu.com/docs/develop/extended/component-codeless/cloud-speed/introduction/))
|
||||
*/
|
||||
cloudCache?: object | boolean;
|
||||
/**
|
||||
* 控制当前请求是否延时至首屏内容渲染后发送
|
||||
*/
|
||||
defer?: boolean;
|
||||
success?: (result: RequestSuccessCallbackResult) => void;
|
||||
/**
|
||||
* 失败的回调函数
|
||||
*/
|
||||
fail?: (result: GeneralCallbackResult) => void;
|
||||
/**
|
||||
* 结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: (result: GeneralCallbackResult) => void;
|
||||
}
|
||||
interface RequestSuccessCallbackResult {
|
||||
/**
|
||||
* 开发者服务器返回的数据
|
||||
*/
|
||||
data: string | AnyObject | ArrayBuffer;
|
||||
/**
|
||||
* 开发者服务器返回的 HTTP 状态码
|
||||
*/
|
||||
statusCode: number;
|
||||
/**
|
||||
* 开发者服务器返回的 HTTP Response Header
|
||||
*/
|
||||
header: any;
|
||||
/**
|
||||
* 开发者服务器返回的 cookies,格式为字符串数组
|
||||
*/
|
||||
cookies: string[];
|
||||
}
|
||||
|
||||
interface RequestTask {
|
||||
/**
|
||||
* 中断请求任务
|
||||
* @tutorial https://uniapp.dcloud.net.cn/api/request/request.html#request
|
||||
* @uniPlatform {
|
||||
* "app": {
|
||||
* "android": {
|
||||
* "osVer": "4.4",
|
||||
* "uniVer": "√",
|
||||
* "unixVer": "3.9.0"
|
||||
* },
|
||||
* "ios": {
|
||||
* "osVer": "9.0",
|
||||
* "uniVer": "√",
|
||||
* "unixVer": "3.9.0"
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* @example ```typescript
|
||||
* var requestTask = uni.request({
|
||||
* url: 'http://192.168.12.106:8080/postHalo', //仅为示例,并非真实接口地址。
|
||||
* complete: ()=> {}
|
||||
* });
|
||||
* requestTask.abort();
|
||||
* ```
|
||||
*/
|
||||
abort(): void;
|
||||
/**
|
||||
* 监听 HTTP Response Header 事件
|
||||
*/
|
||||
onHeadersReceived(callback: (result: any) => void): void;
|
||||
/**
|
||||
* 取消监听 HTTP Response Header 事件
|
||||
*/
|
||||
offHeadersReceived(callback: (result: any) => void): void;
|
||||
}
|
||||
}
|
||||
|
||||
interface Uni {
|
||||
/**
|
||||
* 发起网络请求
|
||||
*
|
||||
* 文档: [http://uniapp.dcloud.io/api/request/request?id=request](http://uniapp.dcloud.io/api/request/request?id=request)
|
||||
* @tutorial https://uniapp.dcloud.net.cn/api/request/request.html
|
||||
* @uniPlatform {
|
||||
* "app": {
|
||||
* "android": {
|
||||
* "osVer": "4.4",
|
||||
* "uniVer": "√",
|
||||
* "unixVer": "3.9.0"
|
||||
* },
|
||||
* "ios": {
|
||||
* "osVer": "9.0",
|
||||
* "uniVer": "√",
|
||||
* "unixVer": "3.9.0"
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* @example ```typescript
|
||||
* uni.request({
|
||||
* url: "http://192.168.12.106:8080/postHalo",
|
||||
* dataType: "json",
|
||||
* responseType: "json",
|
||||
* method: "POST",
|
||||
* data: {
|
||||
* platform: "ios",
|
||||
* },
|
||||
* // header: {
|
||||
* // "Content-Type": "application/json",
|
||||
* // },
|
||||
* timeout: 6000,
|
||||
* sslVerify: false,
|
||||
* withCredentials: false,
|
||||
* firstIpv4: false,
|
||||
* success(res) {
|
||||
* console.log("success :", res.data);
|
||||
* },
|
||||
* fail(e) {
|
||||
* console.log(e);
|
||||
* },
|
||||
* complete(res) {
|
||||
* console.log("complete :", res);
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
request(options: UniNamespace.RequestOptions): UniNamespace.RequestTask;
|
||||
}
|
61
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/FacialRecognition.d.ts
generated
vendored
Normal file
61
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/FacialRecognition.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
declare namespace UniNamespace {
|
||||
interface StartFacialRecognitionVerifyCallbackResult {
|
||||
/**
|
||||
* 错误码,成功时为0
|
||||
*/
|
||||
errCode: number;
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
errMsg: string;
|
||||
/**
|
||||
* 抛出错误的模块/主题名
|
||||
*/
|
||||
errSubject?: string;
|
||||
/**
|
||||
* 引起此错误的下层错误
|
||||
*/
|
||||
cause?: any;
|
||||
}
|
||||
interface StartFacialRecognitionVerifyOption {
|
||||
/**
|
||||
* 认证流水号,由服务端根据接入的业务模式调用对应的初始化接口获取
|
||||
*/
|
||||
certifyId: string;
|
||||
/**
|
||||
* 刷脸圈的颜色
|
||||
*/
|
||||
progressBarColor?: string;
|
||||
/**
|
||||
* 认证界面UI朝向。port 为竖屏,land 为横屏,默认为 port
|
||||
*/
|
||||
screenOrientation?: string;
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: (result: StartFacialRecognitionVerifyCallbackResult) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: (result: StartFacialRecognitionVerifyCallbackResult) => void;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: (result: StartFacialRecognitionVerifyCallbackResult) => void;
|
||||
}
|
||||
}
|
||||
|
||||
interface Uni {
|
||||
/**
|
||||
* 获取设备信息MetaInfo
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/uniCloud/frv/dev.html#get-meta-info](https://uniapp.dcloud.net.cn/uniCloud/frv/dev.html#get-meta-info)
|
||||
*/
|
||||
getFacialRecognitionMetaInfo(): string;
|
||||
/**
|
||||
* 调起实人认证界面
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/uniCloud/frv/dev.html#start-frv](https://uniapp.dcloud.net.cn/uniCloud/frv/dev.html#start-frv)
|
||||
*/
|
||||
startFacialRecognitionVerify(options: UniNamespace.StartFacialRecognitionVerifyOption): void;
|
||||
}
|
23
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/MemoryWarning.d.ts
generated
vendored
Normal file
23
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/MemoryWarning.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
declare namespace UniNamespace {
|
||||
interface OnMemoryWarningCallbackResult {
|
||||
/**
|
||||
* 仅 Android 有该字段,对应系统内存告警等级宏定义
|
||||
*/
|
||||
level: number;
|
||||
}
|
||||
type OnMemoryWarningCallback = (res: OnMemoryWarningCallbackResult) => void;
|
||||
}
|
||||
interface Uni {
|
||||
/**
|
||||
* 监听内存不足告警事件。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/memory.html#onmemorywarning](https://uniapp.dcloud.net.cn/api/system/memory.html#onmemorywarning)
|
||||
*/
|
||||
onMemoryWarning(callback: UniNamespace.OnMemoryWarningCallback): void;
|
||||
/**
|
||||
* 取消监听内存不足告警事件。不传入 callback 则取消所有监听。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/memory.html#offmemorywarning](https://uniapp.dcloud.net.cn/api/system/memory.html#offmemorywarning)
|
||||
*/
|
||||
offMemoryWarning(callback?: UniNamespace.OnMemoryWarningCallback): void;
|
||||
}
|
18
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/UserCaptureScreen.d.ts
generated
vendored
Normal file
18
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/UserCaptureScreen.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
declare namespace UniNamespace {
|
||||
type OnUserCaptureScreenCallback = (res?: { errMsg: string }) => void;
|
||||
}
|
||||
|
||||
interface Uni {
|
||||
/**
|
||||
* 监听用户主动截屏事件,用户使用系统截屏按键截屏时触发此事件。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen)
|
||||
*/
|
||||
onUserCaptureScreen(callback: UniNamespace.OnUserCaptureScreenCallback): void;
|
||||
/**
|
||||
* 用户主动截屏事件。取消事件监听。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen)
|
||||
*/
|
||||
offUserCaptureScreen(callback: UniNamespace.OnUserCaptureScreenCallback): void;
|
||||
}
|
386
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/Wifi.d.ts
generated
vendored
Normal file
386
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/Wifi.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,386 @@
|
|||
declare namespace UniNamespace {
|
||||
interface WifiError {
|
||||
/**
|
||||
* 错误信息
|
||||
*
|
||||
* | 错误码 | 错误信息 | 说明 |
|
||||
* | - | - | - |
|
||||
* | 0 | ok | 正常 |
|
||||
* | 12000 | not init | 未先调用 `startWifi` 接口 |
|
||||
* | 12001 | system not support | 当前系统不支持相关能力 |
|
||||
* | 12002 | password error Wi-Fi | 密码错误 |
|
||||
* | 12003 | connection timeout | 连接超时, 仅 Android 支持 |
|
||||
* | 12004 | duplicate request | 重复连接 Wi-Fi |
|
||||
* | 12005 | wifi not turned on | Android 特有,未打开 Wi-Fi 开关 |
|
||||
* | 12006 | gps not turned on | Android 特有,未打开 GPS 定位开关 |
|
||||
* | 12007 | user denied | 用户拒绝授权链接 Wi-Fi |
|
||||
* | 12008 | invalid SSID | 无效 SSID |
|
||||
* | 12009 | system config err | 系统运营商配置拒绝连接 Wi-Fi |
|
||||
* | 12010 | system internal error | 系统其他错误,需要在 errmsg 打印具体的错误原因 |
|
||||
* | 12011 | weapp in background | 应用在后台无法配置 Wi-Fi |
|
||||
* | 12013 | wifi config may be expired | 系统保存的 Wi-Fi 配置过期,建议忘记 Wi-Fi 后重试,仅 Android 支持 |
|
||||
* | 12014 | invalid WEP / WPA password | iOS 特有,无效的 WEP / WPA 密码 |
|
||||
*/
|
||||
errMsg: string;
|
||||
/**
|
||||
* 错误码
|
||||
*
|
||||
* | 错误码 | 错误信息 | 说明 |
|
||||
* | - | - | - |
|
||||
* | 0 | ok | 正常 |
|
||||
* | 12000 | not init | 未先调用 `startWifi` 接口 |
|
||||
* | 12001 | system not support | 当前系统不支持相关能力 |
|
||||
* | 12002 | password error Wi-Fi | 密码错误 |
|
||||
* | 12003 | connection timeout | 连接超时, 仅 Android 支持 |
|
||||
* | 12004 | duplicate request | 重复连接 Wi-Fi |
|
||||
* | 12005 | wifi not turned on | Android 特有,未打开 Wi-Fi 开关 |
|
||||
* | 12006 | gps not turned on | Android 特有,未打开 GPS 定位开关 |
|
||||
* | 12007 | user denied | 用户拒绝授权链接 Wi-Fi |
|
||||
* | 12008 | invalid SSID | 无效 SSID |
|
||||
* | 12009 | system config err | 系统运营商配置拒绝连接 Wi-Fi |
|
||||
* | 12010 | system internal error | 系统其他错误,需要在 errmsg 打印具体的错误原因 |
|
||||
* | 12011 | weapp in background | 应用在后台无法配置 Wi-Fi |
|
||||
* | 12013 | wifi config may be expired | 系统保存的 Wi-Fi 配置过期,建议忘记 Wi-Fi 后重试,仅 Android 支持 |
|
||||
* | 12014 | invalid WEP / WPA password | iOS 特有,无效的 WEP / WPA 密码 |
|
||||
*/
|
||||
errCode: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
type StartWifiCompleteCallback = (res: WifiError) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
type StartWifiFailCallback = (res: WifiError) => void;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
type StartWifiSuccessCallback = (res: WifiError) => void;
|
||||
|
||||
interface StartWifiOption {
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: StartWifiCompleteCallback;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: StartWifiFailCallback;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: StartWifiSuccessCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
type StopWifiCompleteCallback = (res: WifiError) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
type StopWifiFailCallback = (res: WifiError) => void;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
type StopWifiSuccessCallback = (res: WifiError) => void;
|
||||
|
||||
interface StopWifiOption {
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: StopWifiCompleteCallback;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: StopWifiFailCallback;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: StopWifiSuccessCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
type ConnectWifiCompleteCallback = (res: WifiError) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
type ConnectWifiFailCallback = (res: WifiError) => void;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
type ConnectWifiSuccessCallback = (res: WifiError) => void;
|
||||
|
||||
interface ConnectWifiOption {
|
||||
/**
|
||||
* Wi-Fi 设备 SSID
|
||||
*/
|
||||
SSID: string;
|
||||
/**
|
||||
* Wi-Fi 设备 BSSID
|
||||
*/
|
||||
BSSID?: string;
|
||||
/**
|
||||
* Wi-Fi 设备密码
|
||||
*/
|
||||
password: string;
|
||||
/**
|
||||
* 需要基础库: `2.12.0`
|
||||
*
|
||||
* 跳转到系统设置页进行连接
|
||||
*/
|
||||
maunal?: boolean;
|
||||
/**
|
||||
* 需要基础库: `2.22.0`
|
||||
*
|
||||
* 是否需要返回部分 Wi-Fi 信息,仅安卓生效
|
||||
*/
|
||||
partialInfo?: boolean;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: ConnectWifiSuccessCallback;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: ConnectWifiFailCallback;
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: ConnectWifiCompleteCallback;
|
||||
}
|
||||
|
||||
interface WifiInfo {
|
||||
/**
|
||||
* Wi-Fi 的 SSID
|
||||
*/
|
||||
SSID: string;
|
||||
/**
|
||||
* Wi-Fi 的 BSSID
|
||||
*/
|
||||
BSSID: string;
|
||||
/**
|
||||
* Wi-Fi 是否安全
|
||||
*/
|
||||
secure: boolean;
|
||||
/**
|
||||
* Wi-Fi 信号强度, 安卓取值 0 ~ 100 ,iOS 取值 0 ~ 1 ,值越大强度越大
|
||||
*/
|
||||
signalStrength: number;
|
||||
/**
|
||||
* Wi-Fi 频段单位 MHz
|
||||
*/
|
||||
frequency: number;
|
||||
}
|
||||
interface OnWifiConnectedListenerResult {
|
||||
/**
|
||||
* Wi-Fi 信息
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#WifiInfo](https://uniapp.dcloud.net.cn/api/system/wifi.html#WifiInfo)
|
||||
*/
|
||||
wifi: WifiInfo;
|
||||
}
|
||||
/**
|
||||
* 连接上 Wi-Fi 的事件的监听函数
|
||||
*/
|
||||
type OnWifiConnectedCallback = (
|
||||
result: OnWifiConnectedListenerResult
|
||||
) => void;
|
||||
/**
|
||||
* onWifiConnected 传入的监听函数。不传此参数则移除所有监听函数。
|
||||
*/
|
||||
type OffWifiConnectedCallback = (
|
||||
result: OnWifiConnectedListenerResult
|
||||
) => void;
|
||||
|
||||
interface OnWifiConnectedWithPartialInfoListenerResult {
|
||||
/**
|
||||
*
|
||||
* 只包含 SSID 属性的 WifiInfo 对象
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#WifiInfo](https://uniapp.dcloud.net.cn/api/system/wifi.html#WifiInfo)
|
||||
*/
|
||||
wifi: WifiInfo;
|
||||
}
|
||||
/**
|
||||
* 连接上 Wi-Fi 的事件的监听函数
|
||||
*/
|
||||
type OnWifiConnectedWithPartialInfoCallback = (
|
||||
result: OnWifiConnectedWithPartialInfoListenerResult
|
||||
) => void;
|
||||
|
||||
interface GetConnectedWifiSuccessCallbackResult {
|
||||
/**
|
||||
* Wi-Fi 信息
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#WifiInfo](https://uniapp.dcloud.net.cn/api/system/wifi.html#WifiInfo)
|
||||
*/
|
||||
wifi: WifiInfo;
|
||||
errMsg: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
type GetConnectedWifiSuccessCallback = (
|
||||
result: GetConnectedWifiSuccessCallbackResult
|
||||
) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
type GetConnectedWifiFailCallback = (res: WifiError) => void;
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
type GetConnectedWifiCompleteCallback = (res: WifiError) => void;
|
||||
interface GetConnectedWifiOption {
|
||||
/**
|
||||
* 是否需要返回部分 Wi-Fi 信息
|
||||
*/
|
||||
partialInfo?: boolean;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: GetConnectedWifiSuccessCallback;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: GetConnectedWifiFailCallback;
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: GetConnectedWifiCompleteCallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
type GetWifiListSuccessCallback = (res: WifiError) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
type GetWifiListFailCallback = (res: WifiError) => void;
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
type GetWifiListCompleteCallback = (res: WifiError) => void;
|
||||
interface GetWifiListOption {
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: GetWifiListSuccessCallback;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: GetWifiListFailCallback;
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: GetWifiListCompleteCallback;
|
||||
}
|
||||
|
||||
interface OnGetWifiListListenerResult {
|
||||
/**
|
||||
* Wi-Fi 列表数据
|
||||
*/
|
||||
wifiList: WifiInfo[];
|
||||
}
|
||||
/**
|
||||
* 获取到 Wi-Fi 列表数据事件的监听函数
|
||||
*/
|
||||
type OnGetWifiListCallback = (result: OnGetWifiListListenerResult) => void;
|
||||
/**
|
||||
* onGetWifiList 传入的监听函数。不传此参数则移除所有监听函数。
|
||||
*/
|
||||
type OffGetWifiListCallback = (result: OnGetWifiListListenerResult) => void;
|
||||
|
||||
/**
|
||||
* onWifiConnectedWithPartialInfo 传入的监听函数。不传此参数则移除所有监听函数。
|
||||
*/
|
||||
type OffWifiConnectedWithPartialInfoCallback = (
|
||||
result: OnWifiConnectedWithPartialInfoListenerResult
|
||||
) => void;
|
||||
}
|
||||
|
||||
interface Uni {
|
||||
/**
|
||||
* 初始化 Wi-Fi 模块
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#startwifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#startwifi)
|
||||
*/
|
||||
startWifi(option?: UniNamespace.StartWifiOption): void;
|
||||
|
||||
/**
|
||||
* 关闭 Wi-Fi 模块
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#stopwifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#stopwifi)
|
||||
*/
|
||||
stopWifi(option?: UniNamespace.StopWifiOption): void;
|
||||
|
||||
/**
|
||||
* 连接 Wi-Fi。若已知 Wi-Fi 信息,可以直接利用该接口连接。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#connectwifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#connectwifi)
|
||||
*/
|
||||
connectWifi(option: UniNamespace.ConnectWifiOption): void;
|
||||
|
||||
/**
|
||||
* 监听连接上 Wi-Fi 的事件。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#onwificonnected](https://uniapp.dcloud.net.cn/api/system/wifi.html#onwificonnected)
|
||||
*/
|
||||
onWifiConnected(listener: UniNamespace.OnWifiConnectedCallback): void;
|
||||
|
||||
/**
|
||||
* 移除连接上 Wi-Fi 的事件的监听函数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#offwificonnected](https://uniapp.dcloud.net.cn/api/system/wifi.html#offwificonnected)
|
||||
*/
|
||||
offWifiConnected(listener?: UniNamespace.OffWifiConnectedCallback): void;
|
||||
|
||||
/**
|
||||
* 获取已连接的 Wi-Fi 信息。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#getconnectedwifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#getconnectedwifi)
|
||||
*/
|
||||
getConnectedWifi(option: UniNamespace.GetConnectedWifiOption): void;
|
||||
|
||||
/**
|
||||
* 请求获取 Wi-Fi 列表。wifiList 数据会在 onGetWifiList 注册的回调中返回。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#getwifilist](https://uniapp.dcloud.net.cn/api/system/wifi.html#getwifilist)
|
||||
*/
|
||||
getWifiList(option?: UniNamespace.GetWifiListOption): void;
|
||||
|
||||
/**
|
||||
* 监听获取到 Wi-Fi 列表数据事件。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#ongetwifilist](https://uniapp.dcloud.net.cn/api/system/wifi.html#ongetwifilist)
|
||||
*/
|
||||
onGetWifiList(listener: UniNamespace.OnGetWifiListCallback): void;
|
||||
|
||||
/**
|
||||
* 移除获取到 Wi-Fi 列表数据事件的监听函数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#offgetwifilist](https://uniapp.dcloud.net.cn/api/system/wifi.html#offgetwifilist)
|
||||
*/
|
||||
offGetWifiList(listener?: UniNamespace.OffGetWifiListCallback): void;
|
||||
|
||||
/**
|
||||
* 监听连接上 Wi-Fi 的事件。
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#onwificonnectedwithpartialinfo](https://uniapp.dcloud.net.cn/api/system/wifi.html#onwificonnectedwithpartialinfo)
|
||||
*/
|
||||
onWifiConnectedWithPartialInfo(listener: UniNamespace.OnWifiConnectedWithPartialInfoCallback): void;
|
||||
|
||||
/**
|
||||
* 移除连接上 Wi-Fi 的事件的监听函数
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/wifi.html#offwificonnectedwithpartialinfo](https://uniapp.dcloud.net.cn/api/system/wifi.html#offwificonnectedwithpartialinfo)
|
||||
*/
|
||||
offWifiConnectedWithPartialInfo(listener?: UniNamespace.OffWifiConnectedWithPartialInfoCallback): void;
|
||||
}
|
37
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/getBatteryInfo.d.ts
generated
vendored
Normal file
37
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/getBatteryInfo.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
declare namespace UniNamespace {
|
||||
interface GetBatteryInfoSuccessCallbackResult {
|
||||
/**
|
||||
* 是否正在充电中
|
||||
*/
|
||||
isCharging: boolean;
|
||||
/**
|
||||
* 设备电量,范围 1 - 100
|
||||
*/
|
||||
level: number;
|
||||
errMsg: string;
|
||||
}
|
||||
|
||||
interface GetBatteryInfoOption {
|
||||
/**
|
||||
* 接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
*/
|
||||
complete?: (result: any) => void;
|
||||
/**
|
||||
* 接口调用失败的回调函数
|
||||
*/
|
||||
fail?: (result: any) => void;
|
||||
/**
|
||||
* 接口调用成功的回调函数
|
||||
*/
|
||||
success?: (result: GetBatteryInfoSuccessCallbackResult) => void;
|
||||
}
|
||||
}
|
||||
|
||||
interface Uni {
|
||||
/**
|
||||
* 获取设备电量
|
||||
*
|
||||
* 文档: [https://uniapp.dcloud.net.cn/api/system/batteryInfo.html](https://uniapp.dcloud.net.cn/api/system/batteryInfo.html)
|
||||
*/
|
||||
getBatteryInfo(option?: UniNamespace.GetBatteryInfoOption): void;
|
||||
}
|
5
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/index.d.ts
generated
vendored
Normal file
5
uniapp04/node_modules/@dcloudio/types/uni-app/uni/ext/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
/// <reference path="./getBatteryInfo.d.ts" />
|
||||
/// <reference path="./MemoryWarning.d.ts" />
|
||||
/// <reference path="./UserCaptureScreen.d.ts" />
|
||||
/// <reference path="./Wifi.d.ts" />
|
||||
/// <reference path="./FacialRecognition.d.ts" />
|
3
uniapp04/node_modules/@dcloudio/types/uni-app/uni/index.d.ts
generated
vendored
Normal file
3
uniapp04/node_modules/@dcloudio/types/uni-app/uni/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
/// <reference path="./legacy/uni.d.ts" />
|
||||
/// <reference path="./base/index.d.ts" />
|
||||
/// <reference path="./ext/index.d.ts" />
|
11844
uniapp04/node_modules/@dcloudio/types/uni-app/uni/legacy/uni.d.ts
generated
vendored
Normal file
11844
uniapp04/node_modules/@dcloudio/types/uni-app/uni/legacy/uni.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
202
uniapp04/node_modules/@dcloudio/uni-app/LICENSE
generated
vendored
Normal file
202
uniapp04/node_modules/@dcloudio/uni-app/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
1
uniapp04/node_modules/@dcloudio/uni-app/dist/app.d.ts
generated
vendored
Normal file
1
uniapp04/node_modules/@dcloudio/uni-app/dist/app.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare function init(): void;
|
28
uniapp04/node_modules/@dcloudio/uni-app/dist/app.js
generated
vendored
Normal file
28
uniapp04/node_modules/@dcloudio/uni-app/dist/app.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.init = void 0;
|
||||
var Vue = require("vue");
|
||||
function init() {
|
||||
var vueConstructor = (Vue.default ? Vue.default : Vue);
|
||||
var defaultMergeHook = vueConstructor.config.optionMergeStrategies.mounted;
|
||||
var onReadyFn;
|
||||
vueConstructor.config.optionMergeStrategies.mounted = function Le(parentVal, childVal) {
|
||||
var res = defaultMergeHook.call(this, parentVal, childVal);
|
||||
if (Array.isArray(res)) {
|
||||
var index = void 0;
|
||||
if (onReadyFn) {
|
||||
index = res.indexOf(onReadyFn);
|
||||
}
|
||||
else {
|
||||
index = res.findIndex(function (fn) { return fn.toString().includes('onReady'); });
|
||||
onReadyFn = res[index];
|
||||
}
|
||||
if (index !== -1) {
|
||||
res.splice(index, 1);
|
||||
res.push(onReadyFn);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
};
|
||||
}
|
||||
exports.init = init;
|
31
uniapp04/node_modules/@dcloudio/uni-app/dist/index.d.ts
generated
vendored
Normal file
31
uniapp04/node_modules/@dcloudio/uni-app/dist/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
/// <reference types="@dcloudio/types" />
|
||||
/// <reference types="@dcloudio/types" />
|
||||
/// <reference types="@dcloudio/types" />
|
||||
/// <reference types="@dcloudio/types" />
|
||||
import { ComponentInternalInstance } from '@vue/composition-api';
|
||||
export { initUtsProxyClass, initUtsProxyFunction, initUtsIndexClassName, initUtsClassName, initUtsPackageName, } from './uts';
|
||||
export declare const onShow: (callback: ((options?: App.LaunchShowOption) => void) | (() => void), target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onHide: (callback: (() => void) | (() => void), target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onLaunch: (callback: (options?: App.LaunchShowOption) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onError: (callback: (error: string) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onPageNotFound: (callback: (options: App.PageNotFoundOption) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onUnhandledRejection: (callback: (options: UniApp.OnUnhandledRejectionCallbackResult) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onThemeChange: (callback: (options: UniApp.OnThemeChangeCallbackResult) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onUniNViewMessage: (callback: (options: AnyObject) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onInit: (callback: (query?: AnyObject) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onLoad: (callback: (query?: AnyObject) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onReady: (callback: () => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onUnload: (callback: () => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onPullDownRefresh: (callback: () => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onReachBottom: (callback: () => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onShareAppMessage: (callback: (options: Page.ShareAppMessageOption) => Page.CustomShareContent, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onShareTimeline: (callback: () => Page.ShareTimelineContent, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onAddToFavorites: (callback: (options: Page.AddToFavoritesOption) => Page.CustomFavoritesContent, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onPageScroll: (callback: (options: Page.PageScrollOption) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onResize: (callback: (options: Page.PageScrollOption) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onTabItemTap: (callback: (options: Page.TabItemTapOption) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onNavigationBarButtonTap: (callback: (options: Page.NavigationBarButtonTapOption) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onBackPress: (callback: (options: Page.BackPressOption) => any, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onNavigationBarSearchInputChanged: (callback: (event: Page.NavigationBarSearchInputEvent) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onNavigationBarSearchInputConfirmed: (callback: (event: Page.NavigationBarSearchInputEvent) => void, target?: ComponentInternalInstance | null) => Function;
|
||||
export declare const onNavigationBarSearchInputClicked: (callback: () => void, target?: ComponentInternalInstance | null) => Function;
|
53
uniapp04/node_modules/@dcloudio/uni-app/dist/index.js
generated
vendored
Normal file
53
uniapp04/node_modules/@dcloudio/uni-app/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.onNavigationBarSearchInputClicked = exports.onNavigationBarSearchInputConfirmed = exports.onNavigationBarSearchInputChanged = exports.onBackPress = exports.onNavigationBarButtonTap = exports.onTabItemTap = exports.onResize = exports.onPageScroll = exports.onAddToFavorites = exports.onShareTimeline = exports.onShareAppMessage = exports.onReachBottom = exports.onPullDownRefresh = exports.onUnload = exports.onReady = exports.onLoad = exports.onInit = exports.onUniNViewMessage = exports.onThemeChange = exports.onUnhandledRejection = exports.onPageNotFound = exports.onError = exports.onLaunch = exports.onHide = exports.onShow = exports.initUtsPackageName = exports.initUtsClassName = exports.initUtsIndexClassName = exports.initUtsProxyFunction = exports.initUtsProxyClass = void 0;
|
||||
var composition_api_1 = require("@vue/composition-api");
|
||||
var app = require("./app");
|
||||
var mp = require("./mp");
|
||||
var uts_1 = require("./uts");
|
||||
Object.defineProperty(exports, "initUtsProxyClass", { enumerable: true, get: function () { return uts_1.initUtsProxyClass; } });
|
||||
Object.defineProperty(exports, "initUtsProxyFunction", { enumerable: true, get: function () { return uts_1.initUtsProxyFunction; } });
|
||||
Object.defineProperty(exports, "initUtsIndexClassName", { enumerable: true, get: function () { return uts_1.initUtsIndexClassName; } });
|
||||
Object.defineProperty(exports, "initUtsClassName", { enumerable: true, get: function () { return uts_1.initUtsClassName; } });
|
||||
Object.defineProperty(exports, "initUtsPackageName", { enumerable: true, get: function () { return uts_1.initUtsPackageName; } });
|
||||
var lifecycles = [];
|
||||
var createLifeCycle = function (lifecycle) {
|
||||
lifecycles.push(lifecycle);
|
||||
var fn = (0, composition_api_1.createLifeCycle)(lifecycle);
|
||||
return function (callback, target) {
|
||||
return fn(callback, target);
|
||||
};
|
||||
};
|
||||
if (typeof plus === 'object') {
|
||||
app.init();
|
||||
}
|
||||
else if (typeof window === 'object' && 'document' in window) {
|
||||
}
|
||||
else {
|
||||
mp.init(lifecycles);
|
||||
}
|
||||
exports.onShow = createLifeCycle('onShow');
|
||||
exports.onHide = createLifeCycle('onHide');
|
||||
exports.onLaunch = createLifeCycle('onLaunch');
|
||||
exports.onError = createLifeCycle('onError');
|
||||
exports.onPageNotFound = createLifeCycle('onPageNotFound');
|
||||
exports.onUnhandledRejection = createLifeCycle('onUnhandledRejection');
|
||||
exports.onThemeChange = createLifeCycle('onThemeChange');
|
||||
exports.onUniNViewMessage = createLifeCycle('onUniNViewMessage');
|
||||
exports.onInit = createLifeCycle('onInit');
|
||||
exports.onLoad = createLifeCycle('onLoad');
|
||||
exports.onReady = createLifeCycle('onReady');
|
||||
exports.onUnload = createLifeCycle('onUnload');
|
||||
exports.onPullDownRefresh = createLifeCycle('onPullDownRefresh');
|
||||
exports.onReachBottom = createLifeCycle('onReachBottom');
|
||||
exports.onShareAppMessage = createLifeCycle('onShareAppMessage');
|
||||
exports.onShareTimeline = createLifeCycle('onShareTimeline');
|
||||
exports.onAddToFavorites = createLifeCycle('onAddToFavorites');
|
||||
exports.onPageScroll = createLifeCycle('onPageScroll');
|
||||
exports.onResize = createLifeCycle('onResize');
|
||||
exports.onTabItemTap = createLifeCycle('onTabItemTap');
|
||||
exports.onNavigationBarButtonTap = createLifeCycle('onNavigationBarButtonTap');
|
||||
exports.onBackPress = createLifeCycle('onBackPress');
|
||||
exports.onNavigationBarSearchInputChanged = createLifeCycle('onNavigationBarSearchInputChanged');
|
||||
exports.onNavigationBarSearchInputConfirmed = createLifeCycle('onNavigationBarSearchInputConfirmed');
|
||||
exports.onNavigationBarSearchInputClicked = createLifeCycle('onNavigationBarSearchInputClicked');
|
1
uniapp04/node_modules/@dcloudio/uni-app/dist/mp.d.ts
generated
vendored
Normal file
1
uniapp04/node_modules/@dcloudio/uni-app/dist/mp.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare function init(lifecycles: string[]): void;
|
55
uniapp04/node_modules/@dcloudio/uni-app/dist/mp.js
generated
vendored
Normal file
55
uniapp04/node_modules/@dcloudio/uni-app/dist/mp.js
generated
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.init = void 0;
|
||||
var vue_1 = require("vue");
|
||||
function updateLifeCycle(lifecycles, setupLifecycles, fn) {
|
||||
if (fn) {
|
||||
if (fn.lifecycles) {
|
||||
fn.lifecycles.forEach(function (item) {
|
||||
if (!setupLifecycles.includes(item)) {
|
||||
setupLifecycles.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
var fnString_1 = fn.toString();
|
||||
lifecycles.forEach(function (item) {
|
||||
if (!setupLifecycles.includes(item) && (new RegExp("\\b(".concat(item, ")\\b"))).test(fnString_1)) {
|
||||
setupLifecycles.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
function init(lifecycles) {
|
||||
var setup = vue_1.default.config.optionMergeStrategies.setup;
|
||||
var extend = vue_1.default.extend;
|
||||
vue_1.default.extend = function () {
|
||||
var extendedVue = extend.apply(this, arguments);
|
||||
var newOptions = extendedVue.options;
|
||||
var setup = newOptions.setup;
|
||||
if (setup && setup.lifecycles) {
|
||||
setup.lifecycles.forEach(function (item) {
|
||||
newOptions[item] = newOptions[item] || [function noop() { }];
|
||||
});
|
||||
}
|
||||
return extendedVue;
|
||||
};
|
||||
Object.defineProperty(vue_1.default.config.optionMergeStrategies, 'setup', {
|
||||
set: function (fn) {
|
||||
setup = fn;
|
||||
},
|
||||
get: function () {
|
||||
return function (to, from) {
|
||||
if (typeof setup === 'function') {
|
||||
var newSetup = setup.apply(this, arguments);
|
||||
newSetup.lifecycles = newSetup.lifecycles || [];
|
||||
updateLifeCycle(lifecycles, newSetup.lifecycles, from);
|
||||
updateLifeCycle(lifecycles, newSetup.lifecycles, to);
|
||||
return newSetup;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.init = init;
|
9
uniapp04/node_modules/@dcloudio/uni-app/dist/utils.d.ts
generated
vendored
Normal file
9
uniapp04/node_modules/@dcloudio/uni-app/dist/utils.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
export declare const extend: {
|
||||
<T extends {}, U>(target: T, source: U): T & U;
|
||||
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
||||
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
||||
(target: object, ...sources: any[]): any;
|
||||
};
|
||||
export declare const hasOwn: (val: object, key: string | symbol) => key is never;
|
||||
export declare const isPlainObject: (val: unknown) => val is object;
|
||||
export declare const capitalize: (str: string) => string;
|
23
uniapp04/node_modules/@dcloudio/uni-app/dist/utils.js
generated
vendored
Normal file
23
uniapp04/node_modules/@dcloudio/uni-app/dist/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.capitalize = exports.isPlainObject = exports.hasOwn = exports.extend = void 0;
|
||||
exports.extend = Object.assign;
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var hasOwn = function (val, key) { return hasOwnProperty.call(val, key); };
|
||||
exports.hasOwn = hasOwn;
|
||||
var objectToString = Object.prototype.toString;
|
||||
var toTypeString = function (value) {
|
||||
return objectToString.call(value);
|
||||
};
|
||||
var isPlainObject = function (val) {
|
||||
return toTypeString(val) === '[object Object]';
|
||||
};
|
||||
exports.isPlainObject = isPlainObject;
|
||||
var cacheStringFunction = function (fn) {
|
||||
var cache = Object.create(null);
|
||||
return (function (str) {
|
||||
var hit = cache[str];
|
||||
return hit || (cache[str] = fn(str));
|
||||
});
|
||||
};
|
||||
exports.capitalize = cacheStringFunction(function (str) { return str.charAt(0).toUpperCase() + str.slice(1); });
|
42
uniapp04/node_modules/@dcloudio/uni-app/dist/uts.d.ts
generated
vendored
Normal file
42
uniapp04/node_modules/@dcloudio/uni-app/dist/uts.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
export declare function normalizeArg(arg: unknown): unknown;
|
||||
interface Parameter {
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
interface ProxyFunctionOptions {
|
||||
main?: boolean;
|
||||
package: string;
|
||||
class: string;
|
||||
name: string;
|
||||
method?: string;
|
||||
companion?: boolean;
|
||||
params: Parameter[];
|
||||
}
|
||||
interface ProxyClassOptions {
|
||||
package: string;
|
||||
class: string;
|
||||
constructor: {
|
||||
params: Parameter[];
|
||||
};
|
||||
props: string[];
|
||||
staticProps: string[];
|
||||
methods: {
|
||||
[name: string]: {
|
||||
async?: boolean;
|
||||
params: Parameter[];
|
||||
};
|
||||
};
|
||||
staticMethods: {
|
||||
[name: string]: {
|
||||
async?: boolean;
|
||||
params: Parameter[];
|
||||
};
|
||||
};
|
||||
}
|
||||
declare function initUtsStaticMethod(async: boolean, opts: ProxyFunctionOptions): (...args: unknown[]) => unknown;
|
||||
export declare const initUtsProxyFunction: typeof initUtsStaticMethod;
|
||||
export declare function initUtsProxyClass({ package: pkg, class: cls, constructor: { params: constructorParams }, methods, props, staticProps, staticMethods, }: ProxyClassOptions): any;
|
||||
export declare function initUtsPackageName(name: string, is_uni_modules: boolean): string;
|
||||
export declare function initUtsIndexClassName(moduleName: string, is_uni_modules: boolean): string;
|
||||
export declare function initUtsClassName(moduleName: string, className: string, is_uni_modules: boolean): string;
|
||||
export {};
|
208
uniapp04/node_modules/@dcloudio/uni-app/dist/uts.js
generated
vendored
Normal file
208
uniapp04/node_modules/@dcloudio/uni-app/dist/uts.js
generated
vendored
Normal file
|
@ -0,0 +1,208 @@
|
|||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.initUtsClassName = exports.initUtsIndexClassName = exports.initUtsPackageName = exports.initUtsProxyClass = exports.initUtsProxyFunction = exports.normalizeArg = void 0;
|
||||
var utils_1 = require("./utils");
|
||||
var callbackId = 1;
|
||||
var proxy;
|
||||
var callbacks = {};
|
||||
function normalizeArg(arg) {
|
||||
if (typeof arg === 'function') {
|
||||
// 查找该函数是否已缓存
|
||||
var oldId = Object.keys(callbacks).find(function (id) { return callbacks[id] === arg; });
|
||||
var id = oldId ? parseInt(oldId) : callbackId++;
|
||||
callbacks[id] = arg;
|
||||
return id;
|
||||
}
|
||||
else if ((0, utils_1.isPlainObject)(arg)) {
|
||||
Object.keys(arg).forEach(function (name) {
|
||||
;
|
||||
arg[name] = normalizeArg(arg[name]);
|
||||
});
|
||||
}
|
||||
return arg;
|
||||
}
|
||||
exports.normalizeArg = normalizeArg;
|
||||
function initUtsInstanceMethod(async, opts, instanceId) {
|
||||
return initProxyFunction(async, opts, instanceId);
|
||||
}
|
||||
function getProxy() {
|
||||
if (!proxy) {
|
||||
proxy = uni.requireNativePlugin('UTS-Proxy');
|
||||
}
|
||||
return proxy;
|
||||
}
|
||||
function resolveSyncResult(res) {
|
||||
if (res.errMsg) {
|
||||
throw new Error(res.errMsg);
|
||||
}
|
||||
return res.params;
|
||||
}
|
||||
function invokePropGetter(args) {
|
||||
if (args.errMsg) {
|
||||
throw new Error(args.errMsg);
|
||||
}
|
||||
delete args.errMsg;
|
||||
return resolveSyncResult(getProxy().invokeSync(args, function () { }));
|
||||
}
|
||||
function initProxyFunction(async, _a, instanceId) {
|
||||
var pkg = _a.package, cls = _a["class"], propOrMethod = _a.name, method = _a.method, companion = _a.companion, methodParams = _a.params, errMsg = _a.errMsg;
|
||||
var invokeCallback = function (_a) {
|
||||
var id = _a.id, name = _a.name, params = _a.params, keepAlive = _a.keepAlive;
|
||||
var callback = callbacks[id];
|
||||
if (callback) {
|
||||
callback.apply(void 0, params);
|
||||
if (!keepAlive) {
|
||||
delete callbacks[id];
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.error("".concat(pkg).concat(cls, ".").concat(propOrMethod, " ").concat(name, " is not found"));
|
||||
}
|
||||
};
|
||||
var baseArgs = instanceId
|
||||
? { id: instanceId, name: propOrMethod, method: methodParams }
|
||||
: {
|
||||
package: pkg,
|
||||
"class": cls,
|
||||
name: method || propOrMethod,
|
||||
companion: companion,
|
||||
method: methodParams
|
||||
};
|
||||
return function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
if (errMsg) {
|
||||
throw new Error(errMsg);
|
||||
}
|
||||
var invokeArgs = (0, utils_1.extend)({}, baseArgs, {
|
||||
params: args.map(function (arg) { return normalizeArg(arg); })
|
||||
});
|
||||
if (async) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
getProxy().invokeAsync(invokeArgs, function (res) {
|
||||
if (res.type !== 'return') {
|
||||
invokeCallback(res);
|
||||
}
|
||||
else {
|
||||
if (res.errMsg) {
|
||||
reject(res.errMsg);
|
||||
}
|
||||
else {
|
||||
resolve(res.params);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return resolveSyncResult(getProxy().invokeSync(invokeArgs, invokeCallback));
|
||||
};
|
||||
}
|
||||
function initUtsStaticMethod(async, opts) {
|
||||
if (opts.main && !opts.method) {
|
||||
if (typeof plus !== 'undefined' && plus.os.name === 'iOS') {
|
||||
opts.method = 's_' + opts.name;
|
||||
}
|
||||
}
|
||||
return initProxyFunction(async, opts, 0);
|
||||
}
|
||||
exports.initUtsProxyFunction = initUtsStaticMethod;
|
||||
function initUtsProxyClass(_a) {
|
||||
var pkg = _a.package, cls = _a["class"], constructorParams = _a.constructor.params, methods = _a.methods, props = _a.props, staticProps = _a.staticProps, staticMethods = _a.staticMethods, errMsg = _a.errMsg;
|
||||
var baseOptions = {
|
||||
package: pkg,
|
||||
"class": cls,
|
||||
errMsg: errMsg
|
||||
};
|
||||
var ProxyClass = /** @class */ (function () {
|
||||
function UtsClass() {
|
||||
var params = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
params[_i] = arguments[_i];
|
||||
}
|
||||
if (errMsg) {
|
||||
throw new Error(errMsg);
|
||||
}
|
||||
var target = {};
|
||||
// 初始化实例 ID
|
||||
var instanceId = initProxyFunction(false, (0, utils_1.extend)({ name: 'constructor', params: constructorParams }, baseOptions), 0).apply(null, params);
|
||||
if (!instanceId) {
|
||||
throw new Error("new ".concat(cls, " is failed"));
|
||||
}
|
||||
return new Proxy(this, {
|
||||
get: function (_, name) {
|
||||
if (!target[name]) {
|
||||
//实例方法
|
||||
if ((0, utils_1.hasOwn)(methods, name)) {
|
||||
var _a = methods[name], async = _a.async, params_1 = _a.params;
|
||||
target[name] = initUtsInstanceMethod(!!async, (0, utils_1.extend)({
|
||||
name: name,
|
||||
params: params_1
|
||||
}, baseOptions), instanceId);
|
||||
}
|
||||
else if (props.includes(name)) {
|
||||
// 实例属性
|
||||
return invokePropGetter({
|
||||
id: instanceId,
|
||||
name: name,
|
||||
errMsg: errMsg
|
||||
});
|
||||
}
|
||||
}
|
||||
return target[name];
|
||||
}
|
||||
});
|
||||
}
|
||||
return UtsClass;
|
||||
}());
|
||||
var staticMethodCache = {};
|
||||
return new Proxy(ProxyClass, {
|
||||
get: function (target, name, receiver) {
|
||||
if ((0, utils_1.hasOwn)(staticMethods, name)) {
|
||||
if (!staticMethodCache[name]) {
|
||||
var _a = staticMethods[name], async = _a.async, params = _a.params;
|
||||
// 静态方法
|
||||
staticMethodCache[name] = initUtsStaticMethod(!!async, (0, utils_1.extend)({ name: name, companion: true, params: params }, baseOptions));
|
||||
}
|
||||
return staticMethodCache[name];
|
||||
}
|
||||
if (staticProps.includes(name)) {
|
||||
// 静态属性
|
||||
return invokePropGetter((0, utils_1.extend)({ name: name, companion: true }, baseOptions));
|
||||
}
|
||||
return Reflect.get(target, name, receiver);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.initUtsProxyClass = initUtsProxyClass;
|
||||
function initUtsPackageName(name, is_uni_modules) {
|
||||
if (typeof plus !== 'undefined' && plus.os.name === 'Android') {
|
||||
return 'uts.sdk.' + (is_uni_modules ? 'modules.' : '') + name;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
exports.initUtsPackageName = initUtsPackageName;
|
||||
function initUtsIndexClassName(moduleName, is_uni_modules) {
|
||||
if (typeof plus === 'undefined') {
|
||||
return '';
|
||||
}
|
||||
return initUtsClassName(moduleName, plus.os.name === 'iOS' ? 'IndexSwift' : 'IndexKt', is_uni_modules);
|
||||
}
|
||||
exports.initUtsIndexClassName = initUtsIndexClassName;
|
||||
function initUtsClassName(moduleName, className, is_uni_modules) {
|
||||
if (typeof plus === 'undefined') {
|
||||
return '';
|
||||
}
|
||||
if (plus.os.name === 'Android') {
|
||||
return className;
|
||||
}
|
||||
if (plus.os.name === 'iOS') {
|
||||
return ('UTSSDK' +
|
||||
(is_uni_modules ? 'Modules' : '') +
|
||||
(0, utils_1.capitalize)(moduleName) +
|
||||
(0, utils_1.capitalize)(className));
|
||||
}
|
||||
return '';
|
||||
}
|
||||
exports.initUtsClassName = initUtsClassName;
|
25
uniapp04/node_modules/@dcloudio/uni-app/package.json
generated
vendored
Normal file
25
uniapp04/node_modules/@dcloudio/uni-app/package.json
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "@dcloudio/uni-app",
|
||||
"version": "2.0.2-4020420240722004",
|
||||
"description": "uni-app composition-api",
|
||||
"main": "dist/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/dcloudio/uni-app.git",
|
||||
"directory": "packages/uni-app"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc -p . "
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@dcloudio/types": "^3.0.15",
|
||||
"@vue/composition-api": "^1.7.0"
|
||||
},
|
||||
"author": "fxy060608",
|
||||
"license": "Apache-2.0",
|
||||
"gitHead": "2d3e029c00dc153d1f9b01b3cf4e697470e01087",
|
||||
"devDependencies": {
|
||||
"@dcloudio/types": "^3.0.15",
|
||||
"typescript": "^4.8.3"
|
||||
}
|
||||
}
|
24
uniapp04/node_modules/@socket.io/component-emitter/LICENSE
generated
vendored
Normal file
24
uniapp04/node_modules/@socket.io/component-emitter/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Component contributors <dev@component.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
79
uniapp04/node_modules/@socket.io/component-emitter/Readme.md
generated
vendored
Normal file
79
uniapp04/node_modules/@socket.io/component-emitter/Readme.md
generated
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
# `@socket.io/component-emitter`
|
||||
|
||||
Event emitter component.
|
||||
|
||||
This project is a fork of the [`component-emitter`](https://github.com/sindresorhus/component-emitter) project, with [Socket.IO](https://socket.io/)-specific TypeScript typings.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
$ npm i @socket.io/component-emitter
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Emitter(obj)
|
||||
|
||||
The `Emitter` may also be used as a mixin. For example
|
||||
a "plain" object may become an emitter, or you may
|
||||
extend an existing prototype.
|
||||
|
||||
As an `Emitter` instance:
|
||||
|
||||
```js
|
||||
import { Emitter } from '@socket.io/component-emitter';
|
||||
|
||||
var emitter = new Emitter;
|
||||
emitter.emit('something');
|
||||
```
|
||||
|
||||
As a mixin:
|
||||
|
||||
```js
|
||||
import { Emitter } from '@socket.io/component-emitter';
|
||||
|
||||
var user = { name: 'tobi' };
|
||||
Emitter(user);
|
||||
|
||||
user.emit('im a user');
|
||||
```
|
||||
|
||||
As a prototype mixin:
|
||||
|
||||
```js
|
||||
import { Emitter } from '@socket.io/component-emitter';
|
||||
|
||||
Emitter(User.prototype);
|
||||
```
|
||||
|
||||
### Emitter#on(event, fn)
|
||||
|
||||
Register an `event` handler `fn`.
|
||||
|
||||
### Emitter#once(event, fn)
|
||||
|
||||
Register a single-shot `event` handler `fn`,
|
||||
removed immediately after it is invoked the
|
||||
first time.
|
||||
|
||||
### Emitter#off(event, fn)
|
||||
|
||||
* Pass `event` and `fn` to remove a listener.
|
||||
* Pass `event` to remove all listeners on that event.
|
||||
* Pass nothing to remove all listeners on all events.
|
||||
|
||||
### Emitter#emit(event, ...)
|
||||
|
||||
Emit an `event` with variable option args.
|
||||
|
||||
### Emitter#listeners(event)
|
||||
|
||||
Return an array of callbacks, or an empty array.
|
||||
|
||||
### Emitter#hasListeners(event)
|
||||
|
||||
Check if this emitter has `event` handlers.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
179
uniapp04/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts
generated
vendored
Normal file
179
uniapp04/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,179 @@
|
|||
/**
|
||||
* An events map is an interface that maps event names to their value, which
|
||||
* represents the type of the `on` listener.
|
||||
*/
|
||||
export interface EventsMap {
|
||||
[event: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default events map, used if no EventsMap is given. Using this EventsMap
|
||||
* is equivalent to accepting all event names, and any data.
|
||||
*/
|
||||
export interface DefaultEventsMap {
|
||||
[event: string]: (...args: any[]) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a union type containing all the keys of an event map.
|
||||
*/
|
||||
export type EventNames<Map extends EventsMap> = keyof Map & (string | symbol);
|
||||
|
||||
/** The tuple type representing the parameters of an event listener */
|
||||
export type EventParams<
|
||||
Map extends EventsMap,
|
||||
Ev extends EventNames<Map>
|
||||
> = Parameters<Map[Ev]>;
|
||||
|
||||
/**
|
||||
* The event names that are either in ReservedEvents or in UserEvents
|
||||
*/
|
||||
export type ReservedOrUserEventNames<
|
||||
ReservedEventsMap extends EventsMap,
|
||||
UserEvents extends EventsMap
|
||||
> = EventNames<ReservedEventsMap> | EventNames<UserEvents>;
|
||||
|
||||
/**
|
||||
* Type of a listener of a user event or a reserved event. If `Ev` is in
|
||||
* `ReservedEvents`, the reserved event listener is returned.
|
||||
*/
|
||||
export type ReservedOrUserListener<
|
||||
ReservedEvents extends EventsMap,
|
||||
UserEvents extends EventsMap,
|
||||
Ev extends ReservedOrUserEventNames<ReservedEvents, UserEvents>
|
||||
> = FallbackToUntypedListener<
|
||||
Ev extends EventNames<ReservedEvents>
|
||||
? ReservedEvents[Ev]
|
||||
: Ev extends EventNames<UserEvents>
|
||||
? UserEvents[Ev]
|
||||
: never
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returns an untyped listener type if `T` is `never`; otherwise, returns `T`.
|
||||
*
|
||||
* This is a hack to mitigate https://github.com/socketio/socket.io/issues/3833.
|
||||
* Needed because of https://github.com/microsoft/TypeScript/issues/41778
|
||||
*/
|
||||
type FallbackToUntypedListener<T> = [T] extends [never]
|
||||
? (...args: any[]) => void | Promise<void>
|
||||
: T;
|
||||
|
||||
/**
|
||||
* Strictly typed version of an `EventEmitter`. A `TypedEventEmitter` takes type
|
||||
* parameters for mappings of event names to event data types, and strictly
|
||||
* types method calls to the `EventEmitter` according to these event maps.
|
||||
*
|
||||
* @typeParam ListenEvents - `EventsMap` of user-defined events that can be
|
||||
* listened to with `on` or `once`
|
||||
* @typeParam EmitEvents - `EventsMap` of user-defined events that can be
|
||||
* emitted with `emit`
|
||||
* @typeParam ReservedEvents - `EventsMap` of reserved events, that can be
|
||||
* emitted by socket.io with `emitReserved`, and can be listened to with
|
||||
* `listen`.
|
||||
*/
|
||||
export class Emitter<
|
||||
ListenEvents extends EventsMap,
|
||||
EmitEvents extends EventsMap,
|
||||
ReservedEvents extends EventsMap = {}
|
||||
> {
|
||||
/**
|
||||
* Adds the `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param listener Callback function
|
||||
*/
|
||||
on<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
||||
ev: Ev,
|
||||
listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Adds a one-time `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param listener Callback function
|
||||
*/
|
||||
once<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
||||
ev: Ev,
|
||||
listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Removes the `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param listener Callback function
|
||||
*/
|
||||
off<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
||||
ev?: Ev,
|
||||
listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Emits an event.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param args Values to send to listeners of this event
|
||||
*/
|
||||
emit<Ev extends EventNames<EmitEvents>>(
|
||||
ev: Ev,
|
||||
...args: EventParams<EmitEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Emits a reserved event.
|
||||
*
|
||||
* This method is `protected`, so that only a class extending
|
||||
* `StrictEventEmitter` can emit its own reserved events.
|
||||
*
|
||||
* @param ev Reserved event name
|
||||
* @param args Arguments to emit along with the event
|
||||
*/
|
||||
protected emitReserved<Ev extends EventNames<ReservedEvents>>(
|
||||
ev: Ev,
|
||||
...args: EventParams<ReservedEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Returns the listeners listening to an event.
|
||||
*
|
||||
* @param event Event name
|
||||
* @returns Array of listeners subscribed to `event`
|
||||
*/
|
||||
listeners<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
||||
event: Ev
|
||||
): ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>[];
|
||||
|
||||
/**
|
||||
* Returns true if there is a listener for this event.
|
||||
*
|
||||
* @param event Event name
|
||||
* @returns boolean
|
||||
*/
|
||||
hasListeners<
|
||||
Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
|
||||
>(event: Ev): boolean;
|
||||
|
||||
/**
|
||||
* Removes the `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param listener Callback function
|
||||
*/
|
||||
removeListener<
|
||||
Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
|
||||
>(
|
||||
ev?: Ev,
|
||||
listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Removes all `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
*/
|
||||
removeAllListeners<
|
||||
Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
|
||||
>(ev?: Ev): this;
|
||||
}
|
176
uniapp04/node_modules/@socket.io/component-emitter/lib/cjs/index.js
generated
vendored
Normal file
176
uniapp04/node_modules/@socket.io/component-emitter/lib/cjs/index.js
generated
vendored
Normal file
|
@ -0,0 +1,176 @@
|
|||
|
||||
/**
|
||||
* Expose `Emitter`.
|
||||
*/
|
||||
|
||||
exports.Emitter = Emitter;
|
||||
|
||||
/**
|
||||
* Initialize a new `Emitter`.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function Emitter(obj) {
|
||||
if (obj) return mixin(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mixin the emitter properties.
|
||||
*
|
||||
* @param {Object} obj
|
||||
* @return {Object}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function mixin(obj) {
|
||||
for (var key in Emitter.prototype) {
|
||||
obj[key] = Emitter.prototype[key];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen on the given `event` with `fn`.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.on =
|
||||
Emitter.prototype.addEventListener = function(event, fn){
|
||||
this._callbacks = this._callbacks || {};
|
||||
(this._callbacks['$' + event] = this._callbacks['$' + event] || [])
|
||||
.push(fn);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds an `event` listener that will be invoked a single
|
||||
* time then automatically removed.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.once = function(event, fn){
|
||||
function on() {
|
||||
this.off(event, on);
|
||||
fn.apply(this, arguments);
|
||||
}
|
||||
|
||||
on.fn = fn;
|
||||
this.on(event, on);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove the given callback for `event` or all
|
||||
* registered callbacks.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.off =
|
||||
Emitter.prototype.removeListener =
|
||||
Emitter.prototype.removeAllListeners =
|
||||
Emitter.prototype.removeEventListener = function(event, fn){
|
||||
this._callbacks = this._callbacks || {};
|
||||
|
||||
// all
|
||||
if (0 == arguments.length) {
|
||||
this._callbacks = {};
|
||||
return this;
|
||||
}
|
||||
|
||||
// specific event
|
||||
var callbacks = this._callbacks['$' + event];
|
||||
if (!callbacks) return this;
|
||||
|
||||
// remove all handlers
|
||||
if (1 == arguments.length) {
|
||||
delete this._callbacks['$' + event];
|
||||
return this;
|
||||
}
|
||||
|
||||
// remove specific handler
|
||||
var cb;
|
||||
for (var i = 0; i < callbacks.length; i++) {
|
||||
cb = callbacks[i];
|
||||
if (cb === fn || cb.fn === fn) {
|
||||
callbacks.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove event specific arrays for event types that no
|
||||
// one is subscribed for to avoid memory leak.
|
||||
if (callbacks.length === 0) {
|
||||
delete this._callbacks['$' + event];
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Emit `event` with the given args.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Mixed} ...
|
||||
* @return {Emitter}
|
||||
*/
|
||||
|
||||
Emitter.prototype.emit = function(event){
|
||||
this._callbacks = this._callbacks || {};
|
||||
|
||||
var args = new Array(arguments.length - 1)
|
||||
, callbacks = this._callbacks['$' + event];
|
||||
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
args[i - 1] = arguments[i];
|
||||
}
|
||||
|
||||
if (callbacks) {
|
||||
callbacks = callbacks.slice(0);
|
||||
for (var i = 0, len = callbacks.length; i < len; ++i) {
|
||||
callbacks[i].apply(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
// alias used for reserved events (protected method)
|
||||
Emitter.prototype.emitReserved = Emitter.prototype.emit;
|
||||
|
||||
/**
|
||||
* Return array of callbacks for `event`.
|
||||
*
|
||||
* @param {String} event
|
||||
* @return {Array}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.listeners = function(event){
|
||||
this._callbacks = this._callbacks || {};
|
||||
return this._callbacks['$' + event] || [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if this emitter has `event` handlers.
|
||||
*
|
||||
* @param {String} event
|
||||
* @return {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.hasListeners = function(event){
|
||||
return !! this.listeners(event).length;
|
||||
};
|
4
uniapp04/node_modules/@socket.io/component-emitter/lib/cjs/package.json
generated
vendored
Normal file
4
uniapp04/node_modules/@socket.io/component-emitter/lib/cjs/package.json
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "@socket.io/component-emitter",
|
||||
"type": "commonjs"
|
||||
}
|
179
uniapp04/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts
generated
vendored
Normal file
179
uniapp04/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,179 @@
|
|||
/**
|
||||
* An events map is an interface that maps event names to their value, which
|
||||
* represents the type of the `on` listener.
|
||||
*/
|
||||
export interface EventsMap {
|
||||
[event: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default events map, used if no EventsMap is given. Using this EventsMap
|
||||
* is equivalent to accepting all event names, and any data.
|
||||
*/
|
||||
export interface DefaultEventsMap {
|
||||
[event: string]: (...args: any[]) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a union type containing all the keys of an event map.
|
||||
*/
|
||||
export type EventNames<Map extends EventsMap> = keyof Map & (string | symbol);
|
||||
|
||||
/** The tuple type representing the parameters of an event listener */
|
||||
export type EventParams<
|
||||
Map extends EventsMap,
|
||||
Ev extends EventNames<Map>
|
||||
> = Parameters<Map[Ev]>;
|
||||
|
||||
/**
|
||||
* The event names that are either in ReservedEvents or in UserEvents
|
||||
*/
|
||||
export type ReservedOrUserEventNames<
|
||||
ReservedEventsMap extends EventsMap,
|
||||
UserEvents extends EventsMap
|
||||
> = EventNames<ReservedEventsMap> | EventNames<UserEvents>;
|
||||
|
||||
/**
|
||||
* Type of a listener of a user event or a reserved event. If `Ev` is in
|
||||
* `ReservedEvents`, the reserved event listener is returned.
|
||||
*/
|
||||
export type ReservedOrUserListener<
|
||||
ReservedEvents extends EventsMap,
|
||||
UserEvents extends EventsMap,
|
||||
Ev extends ReservedOrUserEventNames<ReservedEvents, UserEvents>
|
||||
> = FallbackToUntypedListener<
|
||||
Ev extends EventNames<ReservedEvents>
|
||||
? ReservedEvents[Ev]
|
||||
: Ev extends EventNames<UserEvents>
|
||||
? UserEvents[Ev]
|
||||
: never
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returns an untyped listener type if `T` is `never`; otherwise, returns `T`.
|
||||
*
|
||||
* This is a hack to mitigate https://github.com/socketio/socket.io/issues/3833.
|
||||
* Needed because of https://github.com/microsoft/TypeScript/issues/41778
|
||||
*/
|
||||
type FallbackToUntypedListener<T> = [T] extends [never]
|
||||
? (...args: any[]) => void | Promise<void>
|
||||
: T;
|
||||
|
||||
/**
|
||||
* Strictly typed version of an `EventEmitter`. A `TypedEventEmitter` takes type
|
||||
* parameters for mappings of event names to event data types, and strictly
|
||||
* types method calls to the `EventEmitter` according to these event maps.
|
||||
*
|
||||
* @typeParam ListenEvents - `EventsMap` of user-defined events that can be
|
||||
* listened to with `on` or `once`
|
||||
* @typeParam EmitEvents - `EventsMap` of user-defined events that can be
|
||||
* emitted with `emit`
|
||||
* @typeParam ReservedEvents - `EventsMap` of reserved events, that can be
|
||||
* emitted by socket.io with `emitReserved`, and can be listened to with
|
||||
* `listen`.
|
||||
*/
|
||||
export class Emitter<
|
||||
ListenEvents extends EventsMap,
|
||||
EmitEvents extends EventsMap,
|
||||
ReservedEvents extends EventsMap = {}
|
||||
> {
|
||||
/**
|
||||
* Adds the `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param listener Callback function
|
||||
*/
|
||||
on<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
||||
ev: Ev,
|
||||
listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Adds a one-time `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param listener Callback function
|
||||
*/
|
||||
once<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
||||
ev: Ev,
|
||||
listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Removes the `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param listener Callback function
|
||||
*/
|
||||
off<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
||||
ev?: Ev,
|
||||
listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Emits an event.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param args Values to send to listeners of this event
|
||||
*/
|
||||
emit<Ev extends EventNames<EmitEvents>>(
|
||||
ev: Ev,
|
||||
...args: EventParams<EmitEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Emits a reserved event.
|
||||
*
|
||||
* This method is `protected`, so that only a class extending
|
||||
* `StrictEventEmitter` can emit its own reserved events.
|
||||
*
|
||||
* @param ev Reserved event name
|
||||
* @param args Arguments to emit along with the event
|
||||
*/
|
||||
protected emitReserved<Ev extends EventNames<ReservedEvents>>(
|
||||
ev: Ev,
|
||||
...args: EventParams<ReservedEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Returns the listeners listening to an event.
|
||||
*
|
||||
* @param event Event name
|
||||
* @returns Array of listeners subscribed to `event`
|
||||
*/
|
||||
listeners<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
|
||||
event: Ev
|
||||
): ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>[];
|
||||
|
||||
/**
|
||||
* Returns true if there is a listener for this event.
|
||||
*
|
||||
* @param event Event name
|
||||
* @returns boolean
|
||||
*/
|
||||
hasListeners<
|
||||
Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
|
||||
>(event: Ev): boolean;
|
||||
|
||||
/**
|
||||
* Removes the `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
* @param listener Callback function
|
||||
*/
|
||||
removeListener<
|
||||
Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
|
||||
>(
|
||||
ev?: Ev,
|
||||
listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
|
||||
): this;
|
||||
|
||||
/**
|
||||
* Removes all `listener` function as an event listener for `ev`.
|
||||
*
|
||||
* @param ev Name of the event
|
||||
*/
|
||||
removeAllListeners<
|
||||
Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
|
||||
>(ev?: Ev): this;
|
||||
}
|
169
uniapp04/node_modules/@socket.io/component-emitter/lib/esm/index.js
generated
vendored
Normal file
169
uniapp04/node_modules/@socket.io/component-emitter/lib/esm/index.js
generated
vendored
Normal file
|
@ -0,0 +1,169 @@
|
|||
/**
|
||||
* Initialize a new `Emitter`.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
export function Emitter(obj) {
|
||||
if (obj) return mixin(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mixin the emitter properties.
|
||||
*
|
||||
* @param {Object} obj
|
||||
* @return {Object}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function mixin(obj) {
|
||||
for (var key in Emitter.prototype) {
|
||||
obj[key] = Emitter.prototype[key];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen on the given `event` with `fn`.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.on =
|
||||
Emitter.prototype.addEventListener = function(event, fn){
|
||||
this._callbacks = this._callbacks || {};
|
||||
(this._callbacks['$' + event] = this._callbacks['$' + event] || [])
|
||||
.push(fn);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds an `event` listener that will be invoked a single
|
||||
* time then automatically removed.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.once = function(event, fn){
|
||||
function on() {
|
||||
this.off(event, on);
|
||||
fn.apply(this, arguments);
|
||||
}
|
||||
|
||||
on.fn = fn;
|
||||
this.on(event, on);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove the given callback for `event` or all
|
||||
* registered callbacks.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.off =
|
||||
Emitter.prototype.removeListener =
|
||||
Emitter.prototype.removeAllListeners =
|
||||
Emitter.prototype.removeEventListener = function(event, fn){
|
||||
this._callbacks = this._callbacks || {};
|
||||
|
||||
// all
|
||||
if (0 == arguments.length) {
|
||||
this._callbacks = {};
|
||||
return this;
|
||||
}
|
||||
|
||||
// specific event
|
||||
var callbacks = this._callbacks['$' + event];
|
||||
if (!callbacks) return this;
|
||||
|
||||
// remove all handlers
|
||||
if (1 == arguments.length) {
|
||||
delete this._callbacks['$' + event];
|
||||
return this;
|
||||
}
|
||||
|
||||
// remove specific handler
|
||||
var cb;
|
||||
for (var i = 0; i < callbacks.length; i++) {
|
||||
cb = callbacks[i];
|
||||
if (cb === fn || cb.fn === fn) {
|
||||
callbacks.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove event specific arrays for event types that no
|
||||
// one is subscribed for to avoid memory leak.
|
||||
if (callbacks.length === 0) {
|
||||
delete this._callbacks['$' + event];
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Emit `event` with the given args.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Mixed} ...
|
||||
* @return {Emitter}
|
||||
*/
|
||||
|
||||
Emitter.prototype.emit = function(event){
|
||||
this._callbacks = this._callbacks || {};
|
||||
|
||||
var args = new Array(arguments.length - 1)
|
||||
, callbacks = this._callbacks['$' + event];
|
||||
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
args[i - 1] = arguments[i];
|
||||
}
|
||||
|
||||
if (callbacks) {
|
||||
callbacks = callbacks.slice(0);
|
||||
for (var i = 0, len = callbacks.length; i < len; ++i) {
|
||||
callbacks[i].apply(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
// alias used for reserved events (protected method)
|
||||
Emitter.prototype.emitReserved = Emitter.prototype.emit;
|
||||
|
||||
/**
|
||||
* Return array of callbacks for `event`.
|
||||
*
|
||||
* @param {String} event
|
||||
* @return {Array}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.listeners = function(event){
|
||||
this._callbacks = this._callbacks || {};
|
||||
return this._callbacks['$' + event] || [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if this emitter has `event` handlers.
|
||||
*
|
||||
* @param {String} event
|
||||
* @return {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.hasListeners = function(event){
|
||||
return !! this.listeners(event).length;
|
||||
};
|
4
uniapp04/node_modules/@socket.io/component-emitter/lib/esm/package.json
generated
vendored
Normal file
4
uniapp04/node_modules/@socket.io/component-emitter/lib/esm/package.json
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "@socket.io/component-emitter",
|
||||
"type": "module"
|
||||
}
|
28
uniapp04/node_modules/@socket.io/component-emitter/package.json
generated
vendored
Normal file
28
uniapp04/node_modules/@socket.io/component-emitter/package.json
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "@socket.io/component-emitter",
|
||||
"description": "Event emitter",
|
||||
"version": "3.1.2",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"component": {
|
||||
"scripts": {
|
||||
"emitter/index.js": "index.js"
|
||||
}
|
||||
},
|
||||
"main": "./lib/cjs/index.js",
|
||||
"module": "./lib/esm/index.js",
|
||||
"types": "./lib/cjs/index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/socketio/emitter.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"files": [
|
||||
"lib/"
|
||||
]
|
||||
}
|
21
uniapp04/node_modules/@vue/composition-api/LICENSE
generated
vendored
Normal file
21
uniapp04/node_modules/@vue/composition-api/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, liximomo(X.L)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
558
uniapp04/node_modules/@vue/composition-api/README.md
generated
vendored
Normal file
558
uniapp04/node_modules/@vue/composition-api/README.md
generated
vendored
Normal file
|
@ -0,0 +1,558 @@
|
|||
# @vue/composition-api
|
||||
|
||||
Vue 2 plugin for **Composition API**
|
||||
|
||||
[](https://www.npmjs.com/package/@vue/composition-api)
|
||||
[](https://github.com/vuejs/composition-api/actions?query=workflow%3A%22Build+%26+Test%22)
|
||||
[](https://bundlephobia.com/result?p=@vue/composition-api)
|
||||
|
||||
English | [中文](./README.zh-CN.md) ・ [**Composition API Docs**](https://v3.vuejs.org/guide/composition-api-introduction.html)
|
||||
|
||||
|
||||
> ⚠️ With the release of [Vue 2.7](https://blog.vuejs.org/posts/vue-2-7-naruto.html), which has Composition API built-in, **you no longer need this plugin**. Thereby this plugin has entered maintenance mode and will only support Vue 2.6 or earlier. This project will reach End of Life by the end of 2022.
|
||||
|
||||
## Installation
|
||||
|
||||
### NPM
|
||||
|
||||
```bash
|
||||
npm install @vue/composition-api
|
||||
# or
|
||||
yarn add @vue/composition-api
|
||||
```
|
||||
|
||||
You must install `@vue/composition-api` as a plugin via `Vue.use()` before you can use the [Composition API](https://composition-api.vuejs.org/) to compose your component.
|
||||
|
||||
```js
|
||||
import Vue from 'vue'
|
||||
import VueCompositionAPI from '@vue/composition-api'
|
||||
|
||||
Vue.use(VueCompositionAPI)
|
||||
```
|
||||
|
||||
```js
|
||||
// use the APIs
|
||||
import { ref, reactive } from '@vue/composition-api'
|
||||
```
|
||||
|
||||
> :bulb: When you migrate to Vue 3, just replacing `@vue/composition-api` to `vue` and your code should just work.
|
||||
|
||||
### CDN
|
||||
|
||||
Include `@vue/composition-api` after Vue and it will install itself automatically.
|
||||
|
||||
<!--cdn-links-start-->
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@vue/composition-api@1.7.2"></script>
|
||||
```
|
||||
<!--cdn-links-end-->
|
||||
|
||||
`@vue/composition-api` will be exposed to global variable `window.VueCompositionAPI`.
|
||||
|
||||
```ts
|
||||
const { ref, reactive } = VueCompositionAPI
|
||||
```
|
||||
|
||||
## TypeScript Support
|
||||
|
||||
> TypeScript version **>4.2** is required
|
||||
|
||||
To let TypeScript properly infer types inside Vue component options, you need to define components with `defineComponent`
|
||||
|
||||
```ts
|
||||
import { defineComponent } from '@vue/composition-api'
|
||||
|
||||
export default defineComponent({
|
||||
// type inference enabled
|
||||
})
|
||||
```
|
||||
|
||||
### JSX/TSX
|
||||
|
||||
JSX is now officially supported on [vuejs/jsx](https://github.com/vuejs/jsx). You can enable it by following [this document](https://github.com/vuejs/jsx/tree/dev/packages/babel-preset-jsx#usage). A community maintained version can be found at [babel-preset-vca-jsx](https://github.com/luwanquan/babel-preset-vca-jsx) by [@luwanquan](https://github.com/luwanquan).
|
||||
|
||||
To support TSX, create a declaration file with the following content in your project.
|
||||
|
||||
```ts
|
||||
// file: shim-tsx.d.ts
|
||||
import Vue, { VNode } from 'vue';
|
||||
import { ComponentRenderProxy } from '@vue/composition-api';
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface Element extends VNode {}
|
||||
interface ElementClass extends ComponentRenderProxy {}
|
||||
interface ElementAttributesProperty {
|
||||
$props: any; // specify the property name to use
|
||||
}
|
||||
interface IntrinsicElements {
|
||||
[elem: string]: any;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## SSR
|
||||
|
||||
Even if there is no definitive Vue 3 API for SSR yet, this plugin implements the `onServerPrefetch` lifecycle hook that allows you to use the `serverPrefetch` hook found in the classic API.
|
||||
|
||||
```js
|
||||
import { onServerPrefetch } from '@vue/composition-api'
|
||||
|
||||
export default {
|
||||
setup(props, { ssrContext }) {
|
||||
const result = ref()
|
||||
|
||||
onServerPrefetch(async () => {
|
||||
result.value = await callApi(ssrContext.someId)
|
||||
})
|
||||
|
||||
return {
|
||||
result,
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Browser Compatibility
|
||||
|
||||
`@vue/composition-api` supports all modern browsers and IE11+. For lower versions IE you should install `WeakMap` polyfill (for example from `core-js` package).
|
||||
|
||||
## Limitations
|
||||
|
||||
> :white_check_mark: Support :x: Not Supported
|
||||
|
||||
### `Ref` Unwrap
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ <b>Should NOT</b> use <code>ref</code> in a plain object when working with <code>Array</code>
|
||||
</summary>
|
||||
|
||||
```js
|
||||
const a = {
|
||||
count: ref(0),
|
||||
}
|
||||
const b = reactive({
|
||||
list: [a], // `a.count` will not unwrap!!
|
||||
})
|
||||
|
||||
// no unwrap for `count`, `.value` is required
|
||||
b.list[0].count.value === 0 // true
|
||||
```
|
||||
|
||||
```js
|
||||
const b = reactive({
|
||||
list: [
|
||||
{
|
||||
count: ref(0), // no unwrap!!
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
// no unwrap for `count`, `.value` is required
|
||||
b.list[0].count.value === 0 // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
✅ <b>Should</b> always use <code>ref</code> in a <code>reactive</code> when working with <code>Array</code>
|
||||
</summary>
|
||||
|
||||
```js
|
||||
const a = reactive({
|
||||
list: [
|
||||
reactive({
|
||||
count: ref(0),
|
||||
}),
|
||||
]
|
||||
})
|
||||
// unwrapped
|
||||
a.list[0].count === 0 // true
|
||||
|
||||
a.list.push(
|
||||
reactive({
|
||||
count: ref(1),
|
||||
})
|
||||
)
|
||||
// unwrapped
|
||||
a.list[1].count === 1 // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Template Refs
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
✅ String ref && return it from <code>setup()</code>
|
||||
</summary>
|
||||
|
||||
```html
|
||||
<template>
|
||||
<div ref="root"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
setup() {
|
||||
const root = ref(null)
|
||||
|
||||
onMounted(() => {
|
||||
// the DOM element will be assigned to the ref after initial render
|
||||
console.log(root.value) // <div/>
|
||||
})
|
||||
|
||||
return {
|
||||
root,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
✅ String ref && return it from <code>setup()</code> && Render Function / JSX
|
||||
</summary>
|
||||
|
||||
```jsx
|
||||
export default {
|
||||
setup() {
|
||||
const root = ref(null)
|
||||
|
||||
onMounted(() => {
|
||||
// the DOM element will be assigned to the ref after initial render
|
||||
console.log(root.value) // <div/>
|
||||
})
|
||||
|
||||
return {
|
||||
root,
|
||||
}
|
||||
},
|
||||
render() {
|
||||
// with JSX
|
||||
return () => <div ref="root" />
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ Function ref
|
||||
</summary>
|
||||
|
||||
```html
|
||||
<template>
|
||||
<div :ref="el => root = el"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
setup() {
|
||||
const root = ref(null)
|
||||
|
||||
return {
|
||||
root,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ Render Function / JSX in <code>setup()</code>
|
||||
</summary>
|
||||
|
||||
```jsx
|
||||
export default {
|
||||
setup() {
|
||||
const root = ref(null)
|
||||
|
||||
return () =>
|
||||
h('div', {
|
||||
ref: root,
|
||||
})
|
||||
|
||||
// with JSX
|
||||
return () => <div ref={root} />
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>$refs</code> accessing workaround
|
||||
</summary>
|
||||
|
||||
<br>
|
||||
|
||||
> :warning: **Warning**: The `SetupContext.refs` won't exist in `Vue 3.0`. `@vue/composition-api` provide it as a workaround here.
|
||||
|
||||
If you really want to use template refs in this case, you can access `vm.$refs` via `SetupContext.refs`
|
||||
|
||||
```jsx
|
||||
export default {
|
||||
setup(initProps, setupContext) {
|
||||
const refs = setupContext.refs
|
||||
onMounted(() => {
|
||||
// the DOM element will be assigned to the ref after initial render
|
||||
console.log(refs.root) // <div/>
|
||||
})
|
||||
|
||||
return () =>
|
||||
h('div', {
|
||||
ref: 'root',
|
||||
})
|
||||
|
||||
// with JSX
|
||||
return () => <div ref="root" />
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Reactive
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>reactive()</code> <b>mutates</b> the original object
|
||||
</summary>
|
||||
|
||||
`reactive` uses `Vue.observable` underneath which will ***mutate*** the original object.
|
||||
|
||||
> :bulb: In Vue 3, it will return a new proxy object.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>set</code> and <code>del</code> workaround for adding and deleting reactive properties
|
||||
</summary>
|
||||
|
||||
> ⚠️ Warning: `set` and `del` do NOT exist in Vue 3. We provide them as a workaround here, due to the limitation of [Vue 2.x reactivity system](https://vuejs.org/v2/guide/reactivity.html#For-Objects).
|
||||
>
|
||||
> In Vue 2, you will need to call `set` to track new keys on an `object`(similar to `Vue.set` but for `reactive objects` created by the Composition API). In Vue 3, you can just assign them like normal objects.
|
||||
>
|
||||
> Similarly, in Vue 2 you will need to call `del` to [ensure a key deletion triggers view updates](https://vuejs.org/v2/api/#Vue-delete) in reactive objects (similar to `Vue.delete` but for `reactive objects` created by the Composition API). In Vue 3 you can just delete them by calling `delete foo.bar`.
|
||||
|
||||
```ts
|
||||
import { reactive, set, del } from '@vue/composition-api'
|
||||
|
||||
const a = reactive({
|
||||
foo: 1
|
||||
})
|
||||
|
||||
// add new reactive key
|
||||
set(a, 'bar', 1)
|
||||
|
||||
// remove a key and trigger reactivity
|
||||
del(a, 'bar')
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Watch
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ <code>onTrack</code> and <code>onTrigger</code> are not available in <code>WatchOptions</code>
|
||||
</summary>
|
||||
|
||||
```js
|
||||
watch(() => {
|
||||
/* ... */
|
||||
}, {
|
||||
immediate: true,
|
||||
onTrack() {}, // not available
|
||||
onTrigger() {}, // not available
|
||||
})
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### `createApp`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>createApp()</code> is global
|
||||
</summary>
|
||||
|
||||
In Vue 3, `createApp()` is introduced to provide context(plugin, components, etc.) isolation between app instances. Due the design of Vue 2, in this plugin, we provide `createApp()` as a forward compatible API which is just an alias of the global.
|
||||
|
||||
```ts
|
||||
const app1 = createApp(RootComponent1)
|
||||
app1.component('Foo', Foo) // equivalent to Vue.component('Foo', Foo)
|
||||
app1.use(VueRouter) // equivalent to Vue.use(VueRouter)
|
||||
|
||||
const app2 = createApp(RootComponent2)
|
||||
app2.component('Bar', Bar) // equivalent to Vue.component('Bar', Bar)
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### `createElement` / `h`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>createElement</code> / <code>h</code> workaround
|
||||
</summary>
|
||||
|
||||
<br>
|
||||
|
||||
`createElement` / `h` in Vue 2 is only accessable in `render()` function. To use it outside of `render()`, you can explicitly bind a component instance to it.
|
||||
|
||||
> :warning: **Warning**: This ability is provided as a workaround Vue 2, it's not part of the Vue 3 API.
|
||||
|
||||
```jsx
|
||||
import { h as _h } from '@vue/composition-api'
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const vm = getCurrentInstance()
|
||||
const h = _h.bind(vm)
|
||||
|
||||
return () =>
|
||||
h('div', {
|
||||
ref: 'root',
|
||||
})
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
### `shallowReadonly`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>shallowReadonly()</code> will create a new object and with the same root properties, new properties added will <b>not</b> be readonly or reactive.
|
||||
</summary>
|
||||
|
||||
> :bulb: In Vue 3, it will return a new proxy object.
|
||||
|
||||
</details>
|
||||
|
||||
### `readonly`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>readonly()</code> provides <b>only type-level</b> readonly check.
|
||||
</summary>
|
||||
|
||||
`readonly()` is provided as API alignment with Vue 3 on type-level only. Use <code>isReadonly()</code> on it or it's properties can not be guaranteed.
|
||||
|
||||
</details>
|
||||
|
||||
### `props`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>toRefs(props.foo)</code> will incorrectly warn when accessing nested levels of props. <br>
|
||||
⚠️ <code>isReactive(props.foo)</code> will return false.
|
||||
</summary>
|
||||
|
||||
```ts
|
||||
defineComponent({
|
||||
setup(props) {
|
||||
const { bar } = toRefs(props.foo) // it will `warn`
|
||||
|
||||
// use this instead
|
||||
const { foo } = toRefs(props)
|
||||
const a = foo.value.bar
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### `computed().effect`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>computed()</code> has a property <code>effect</code> set to <code>true</code> instead of a <code>ReactiveEffect<T></code>.
|
||||
</summary>
|
||||
|
||||
Due to the difference in implementation, there is no such concept as a `ReactiveEffect` in `@vue/composition-api`. Therefore, `effect` is merely `true` to enable differentiating computed from refs:
|
||||
|
||||
```ts
|
||||
function isComputed<T>(o: ComputedRef<T> | unknown): o is ComputedRef<T>
|
||||
function isComputed(o: any): o is ComputedRef {
|
||||
return !!(isRef(o) && o.effect)
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Missing APIs
|
||||
|
||||
The following APIs introduced in Vue 3 are not available in this plugin.
|
||||
|
||||
- `onRenderTracked`
|
||||
- `onRenderTriggered`
|
||||
- `isProxy`
|
||||
|
||||
### Reactive APIs in `data()`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ Passing <code>ref</code>, <code>reactive</code> or other reactive apis to <code>data()</code> would not work.
|
||||
</summary>
|
||||
|
||||
```jsx
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// will result { a: { value: 1 } } in template
|
||||
a: ref(1),
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### `emits` Options
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ <code>emits</code> option is provided in type-level only, in order to align with Vue 3's type interface. Does NOT have actual effects on the code.
|
||||
</summary>
|
||||
|
||||
```ts
|
||||
defineComponent({
|
||||
emits: {
|
||||
// has no effects
|
||||
submit: (eventOption) => {
|
||||
if (...) {
|
||||
return true
|
||||
} else {
|
||||
console.warn('Invalid submit event payload!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Performance Impact
|
||||
|
||||
Due the limitation of Vue2's public API. `@vue/composition-api` inevitably introduces some performance overhead. Note that in most scenarios, this shouldn't be the source of performance issues.
|
||||
|
||||
You can check the [benchmark results](https://antfu.github.io/vue-composition-api-benchmark-results/) for more details.
|
568
uniapp04/node_modules/@vue/composition-api/README.zh-CN.md
generated
vendored
Normal file
568
uniapp04/node_modules/@vue/composition-api/README.zh-CN.md
generated
vendored
Normal file
|
@ -0,0 +1,568 @@
|
|||
# @vue/composition-api
|
||||
|
||||
用于提供 **组合式 API** 的 Vue 2 插件.
|
||||
|
||||
[](https://www.npmjs.com/package/@vue/composition-api)
|
||||
[](https://github.com/vuejs/composition-api/actions?query=workflow%3A%22Build+%26+Test%22)
|
||||
|
||||
[English](./README.md) | 中文 ・ [**组合式 API 文档**](https://v3.cn.vuejs.org/guide/composition-api-introduction.html)
|
||||
|
||||
|
||||
> ⚠️ 随着 [Vue 2.7](https://blog.vuejs.org/posts/vue-2-7-naruto.html)的发布,它内置了Composition API,**你不再需要这个插件了**。因此,这个插件已经进入维护模式,将只支持Vue 2.6 或更早的版本。本项目将在 2022 年底达到生命终点(EOL)。
|
||||
|
||||
## 安装
|
||||
|
||||
### NPM
|
||||
|
||||
```bash
|
||||
npm install @vue/composition-api
|
||||
# or
|
||||
yarn add @vue/composition-api
|
||||
```
|
||||
|
||||
在使用 `@vue/composition-api` 前,必须先通过 `Vue.use()` 进行安装。之后才可使用新的 [**组合式 API**](https://composition-api.vuejs.org/zh) 进行组件开发。
|
||||
|
||||
```js
|
||||
import Vue from 'vue'
|
||||
import VueCompositionAPI from '@vue/composition-api'
|
||||
|
||||
Vue.use(VueCompositionAPI)
|
||||
```
|
||||
|
||||
```js
|
||||
// 使用 API
|
||||
import { ref, reactive } from '@vue/composition-api'
|
||||
```
|
||||
|
||||
> :bulb: 当迁移到 Vue 3 时,只需简单的将 `@vue/composition-api` 替换成 `vue` 即可。你现有的代码几乎无需进行额外的改动。
|
||||
|
||||
### CDN
|
||||
|
||||
在 Vue 之后引入 `@vue/composition-api` ,插件将会自动完成安装。
|
||||
|
||||
<!--cdn-links-start-->
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@vue/composition-api@1.7.2"></script>
|
||||
```
|
||||
<!--cdn-links-end-->
|
||||
|
||||
`@vue/composition-api` 将会暴露在全局变量 `window.VueCompositionAPI` 中。
|
||||
|
||||
```ts
|
||||
const { ref, reactive } = VueCompositionAPI
|
||||
```
|
||||
|
||||
## TypeScript 支持
|
||||
|
||||
> 本插件要求使用 TypeScript **4.2** 或以上版本
|
||||
|
||||
为了让 TypeScript 在 Vue 组件选项中正确地进行类型推导,我们必须使用 `defineComponent` 来定义组件:
|
||||
|
||||
```ts
|
||||
import { defineComponent } from '@vue/composition-api'
|
||||
|
||||
export default defineComponent({
|
||||
// 类型推断启用
|
||||
})
|
||||
```
|
||||
|
||||
### JSX/TSX
|
||||
|
||||
JSX 现已在 [vuejs/jsx](https://github.com/vuejs/jsx) 中官方支持。你可以根据[这篇文档](https://github.com/vuejs/jsx/tree/dev/packages/babel-preset-jsx#usage)开启支持。你也可以使用由 [@luwanquan](https://github.com/luwanquan) 维护的社区版本 [babel-preset-vca-jsx](https://github.com/luwanquan/babel-preset-vca-jsx)。
|
||||
|
||||
对于 TSX 支持,请在你的项目中创建如下声明文件:
|
||||
|
||||
```ts
|
||||
// file: shim-tsx.d.ts
|
||||
import Vue, { VNode } from 'vue';
|
||||
import { ComponentRenderProxy } from '@vue/composition-api';
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
interface Element extends VNode {}
|
||||
interface ElementClass extends ComponentRenderProxy {}
|
||||
interface ElementAttributesProperty {
|
||||
$props: any; // specify the property name to use
|
||||
}
|
||||
interface IntrinsicElements {
|
||||
[elem: string]: any;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## SSR
|
||||
|
||||
尽管 Vue 3 暂时没有给出确定的 SSR 的 API,这个插件实现了 `onServerPrefetch` 生命周期钩子函数。这个钩子允许你使用传统 API 中的 `serverPrefetch` 函数。
|
||||
|
||||
```js
|
||||
import { onServerPrefetch } from '@vue/composition-api'
|
||||
|
||||
export default {
|
||||
setup(props, { ssrContext }) {
|
||||
const result = ref()
|
||||
|
||||
onServerPrefetch(async () => {
|
||||
result.value = await callApi(ssrContext.someId)
|
||||
})
|
||||
|
||||
return {
|
||||
result,
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
## 浏览器兼容性
|
||||
|
||||
`@vue/composition-api` 支持所有现代浏览器以及IE11+。对于更低版本的IE浏览器你需要安装`WeakMap` polyfill (例如使用 `core-js`库)。
|
||||
|
||||
## 限制
|
||||
|
||||
> :white_check_mark: 支持 :x: 不支持
|
||||
|
||||
### `Ref` 自动展开 (unwrap)
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ <b>不要</b> 在数组中使用含有 <code>ref</code> 的普通对象
|
||||
</summary>
|
||||
|
||||
```js
|
||||
const a = {
|
||||
count: ref(0),
|
||||
}
|
||||
const b = reactive({
|
||||
list: [a], // `a.count` 不会自动展开!!
|
||||
})
|
||||
|
||||
// `count` 不会自动展开, 须使用 `.value`
|
||||
b.list[0].count.value === 0 // true
|
||||
```
|
||||
|
||||
```js
|
||||
const b = reactive({
|
||||
list: [
|
||||
{
|
||||
count: ref(0), // 不会自动展开!!
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
// `count` 不会自动展开, 须使用 `.value`
|
||||
b.list[0].count.value === 0 // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
✅ 在数组中,<b>应该</b> 总是将 <code>ref</code> 存放到 <code>reactive</code> 对象中
|
||||
</summary>
|
||||
|
||||
```js
|
||||
const a = reactive({
|
||||
count: ref(0),
|
||||
})
|
||||
const b = reactive({
|
||||
list: [a],
|
||||
})
|
||||
// 自动展开
|
||||
b.list[0].count === 0 // true
|
||||
|
||||
b.list.push(
|
||||
reactive({
|
||||
count: ref(1),
|
||||
})
|
||||
)
|
||||
// 自动展开
|
||||
b.list[1].count === 1 // true
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### 模板 Refs
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
✅ 在`模板`中使用字符串 ref && 从 <code>setup()</code> 返回 ref
|
||||
</summary>
|
||||
|
||||
```html
|
||||
<template>
|
||||
<div ref="root"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
setup() {
|
||||
const root = ref(null)
|
||||
|
||||
onMounted(() => {
|
||||
// 在初次渲染后 DOM 元素会被赋值给 ref
|
||||
console.log(root.value) // <div/>
|
||||
})
|
||||
|
||||
return {
|
||||
root,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
✅ 在<code>render()</code>中使用字符串 ref && 从 <code>setup()</code> 返回 ref
|
||||
</summary>
|
||||
|
||||
```jsx
|
||||
export default {
|
||||
setup() {
|
||||
const root = ref(null)
|
||||
|
||||
onMounted(() => {
|
||||
// 在初次渲染后 DOM 元素会被赋值给 ref
|
||||
console.log(root.value) // <div/>
|
||||
})
|
||||
|
||||
return {
|
||||
root,
|
||||
}
|
||||
},
|
||||
render() {
|
||||
// 使用 JSX
|
||||
return () => <div ref="root" />
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ 函数式 ref
|
||||
</summary>
|
||||
|
||||
```html
|
||||
<template>
|
||||
<div :ref="el => root = el"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
setup() {
|
||||
const root = ref(null)
|
||||
|
||||
return {
|
||||
root,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ 在 <code>setup()</code> 中返回的`渲染函数 / JSX`
|
||||
</summary>
|
||||
|
||||
```jsx
|
||||
export default {
|
||||
setup() {
|
||||
const root = ref(null)
|
||||
|
||||
return () =>
|
||||
h('div', {
|
||||
ref: root,
|
||||
})
|
||||
|
||||
// 使用 JSX
|
||||
return () => <div ref={root} />
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>$refs</code> 访问的变通方案
|
||||
</summary>
|
||||
|
||||
> :warning: **警告**: `SetupContext.refs` 并非 `Vue 3.0` 的一部分, `@vue/composition-api` 将其暴露在 `SetupContext` 中只是临时提供一种变通方案。
|
||||
|
||||
如果你依然选择在 `setup()` 中写 `render` 函数,那么你可以使用 `SetupContext.refs` 来访问模板引用,它等价于 Vue 2.x 中的 `this.$refs`:
|
||||
|
||||
```js
|
||||
export default {
|
||||
setup(initProps, setupContext) {
|
||||
const refs = setupContext.refs
|
||||
onMounted(() => {
|
||||
// 在初次渲染后 DOM 元素会被赋值给 ref
|
||||
console.log(refs.root) // <div/>
|
||||
})
|
||||
|
||||
return () =>
|
||||
h('div', {
|
||||
ref: 'root',
|
||||
})
|
||||
|
||||
// 使用 JSX
|
||||
return () => <div ref="root" />
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
如果项目使用了 TypeScript,你还需要扩展 `SetupContext` 类型:
|
||||
|
||||
```ts
|
||||
import Vue from 'vue'
|
||||
|
||||
declare module '@vue/composition-api' {
|
||||
interface SetupContext {
|
||||
readonly refs: { [key: string]: Vue | Element | Vue[] | Element[] }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Reactive
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>reactive()</code> 会返回一个<b>修改过的</b>原始的对象
|
||||
</summary>
|
||||
|
||||
此行为与 Vue 2 中的 `Vue.observable` 一致
|
||||
|
||||
> :bulb: 在 Vue 3 中,`reactive()` 会返回一个新的的代理对象
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>set</code> 和 <code>del</code> 添加与刪除响应式属性变通方案
|
||||
</summary>
|
||||
|
||||
> ⚠️ 警告: `set` 和 `del` 并非 Vue 3 的一部分。由于 [Vue 2.x 响应式系统的限制](https://vuejs.org/v2/guide/reactivity.html#For-Objects), 我们在这里提供它们作为一种变通方案。
|
||||
> 在 Vue 2中,你将需要调用`set` 去追踪`object`上新的属性 (与`Vue.set`类似,但用于由 Composition API 创建的`reactive objects`)。在 Vue 3 中,你只需要像对待普通对象一样直接为属性赋值即可。
|
||||
>
|
||||
> 同样地, 在 Vue 2 中你将需要调用`del`去 [确保响应式对象中属性的删除将触发视图更新](https://vuejs.org/v2/api/#Vue-delete) (与`Vue.delete`类似,但用于由 Composition API 创建的`reactive objects`)。在Vue3中,你只需要通过调用 `delete foo.bar` 来删除它们。
|
||||
|
||||
```ts
|
||||
import { reactive, set, del } from '@vue/composition-api'
|
||||
|
||||
const a = reactive({
|
||||
foo: 1
|
||||
})
|
||||
|
||||
// 添加新的响应式属性
|
||||
set(a, 'bar', 1)
|
||||
|
||||
// 刪除属性并触发响应式更新
|
||||
del(a, 'bar')
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Watch
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ 不支持 <code>onTrack</code> 和 <code>onTrigger</code> 选项
|
||||
</summary>
|
||||
|
||||
```js
|
||||
watch(
|
||||
() => {
|
||||
/* ... */
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
onTrack() {}, // 不可用
|
||||
onTrigger() {}, // 不可用
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### `createApp`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>createApp()</code> 是全局的
|
||||
</summary>
|
||||
|
||||
在 Vue3 中,引入了 `createApp()` 来隔离不同应用实例的上下文(plugin, components 等)。 由于 Vue2 的设计,在这个插件中,我们提供 `createApp()` 作为一个向前兼容的 API ,它只是全局的一个别名。
|
||||
|
||||
```ts
|
||||
const app1 = createApp(RootComponent1)
|
||||
app1.component('Foo', Foo) // 相当于 Vue.component('Foo', Foo)
|
||||
app1.use(VueRouter) // 相当于 Vue.use(VueRouter)
|
||||
|
||||
const app2 = createApp(RootComponent2)
|
||||
app2.component('Bar', Bar) // 相当于 Vue.component('Bar', Bar)
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### `createElement` / `h`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>createElement</code> / <code>h</code> 变通方案
|
||||
</summary>
|
||||
|
||||
<br>
|
||||
|
||||
在 Vue2中 `createElement` / `h` 只能通过 `render()` 函数访问。要在 `render()`之外使用它, 你可以显式地给它绑定一个组件实例。
|
||||
|
||||
> :warning: **警告**: 此功能是作为 Vue 2 的变通方法提供的,它不是 Vue 3 API 的一部分。
|
||||
|
||||
```jsx
|
||||
import { h as _h } from '@vue/composition-api'
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const vm = getCurrentInstance()
|
||||
const h = _h.bind(vm)
|
||||
|
||||
return () =>
|
||||
h('div', {
|
||||
ref: 'root',
|
||||
})
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
### `shallowReadonly`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>shallowReadonly()</code> 会返回一个新的浅拷贝对象,在此之后新加的字段<b>将不会</b>获得只读或响应式状态。
|
||||
</summary>
|
||||
|
||||
> :bulb: 在 Vue 3 中,`shallowReadonly()` 会返回一个新的的代理对象
|
||||
|
||||
</details>
|
||||
|
||||
### `readonly`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>readonly()</code> <b>只提供类型层面</b>的只读。
|
||||
</summary>
|
||||
|
||||
`readonly()` 只在类型层面提供和 Vue 3 的对齐。在其返回值或其属性上使用 <code>isReadonly()</code> 检查的结果将无法保证。
|
||||
|
||||
</details>
|
||||
|
||||
### `props`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ 当使用 <code>toRefs</code> 访问深层属性对象 (如 <code>toRefs(props.foo)</code> 时将会得到不正确的警告。<br>
|
||||
⚠️ <code>isReactive(props.foo)</code> 将会返回 false。
|
||||
</summary>
|
||||
|
||||
```ts
|
||||
defineComponent({
|
||||
setup(props) {
|
||||
const { bar } = toRefs(props.foo) // it will `warn`
|
||||
|
||||
// use this instead
|
||||
const { foo } = toRefs(props)
|
||||
const a = foo.value.bar
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### `computed().effect`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
⚠️ <code>computed()</code> 拥有一个被设置为 <code>true</code> 的 <code>effect</code> 属性,用来代替 <code>ReactiveEffect<T></code>。
|
||||
</summary>
|
||||
|
||||
由于实现上的不同, 在 `@vue/composition-api` 中没有 `ReactiveEffect` 这种概念。 因此, `effect` 为 `true` 只是为了能够区分 computed 和 refs:
|
||||
|
||||
```ts
|
||||
function isComputed<T>(o: ComputedRef<T> | unknown): o is ComputedRef<T>
|
||||
function isComputed(o: any): o is ComputedRef {
|
||||
return !!(isRef(o) && o.effect)
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### 缺失的 API
|
||||
|
||||
以下在 Vue 3 新引入的 API ,在本插件中暂不适用:
|
||||
|
||||
- `onRenderTracked`
|
||||
- `onRenderTriggered`
|
||||
- `isProxy`
|
||||
|
||||
### 在 `data()` 中使用组合式 API
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ 在 <code>data()</code> 中使用 <code>ref</code>, <code>reactive</code> 或其他组合式 API 将不会生效
|
||||
</summary>
|
||||
|
||||
```jsx
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 在模版中会成为 { a: { value: 1 } }
|
||||
a: ref(1),
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### `emit` 选项
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
❌ <code>emit</code> 仅因在类型定义中对齐 Vue3 的选项而提供,<b>不会</b>有任何效果。
|
||||
</summary>
|
||||
|
||||
```ts
|
||||
defineComponent({
|
||||
emit: {
|
||||
// 无效
|
||||
submit: (eventOption) => {
|
||||
if (...) {
|
||||
return true
|
||||
} else {
|
||||
console.warn('Invalid submit event payload!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### 性能影响
|
||||
|
||||
由于 Vue 2 的公共 API 的限制,`@vue/composition-api` 不可避免地引入了额外的性能开销。除非在极端情况下,否则这并不会对你造成影响。
|
||||
|
||||
你可以查看这个 [跑分结果](https://antfu.github.io/vue-composition-api-benchmark-results/) 了解更多信息。
|
2294
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.common.js
generated
vendored
Normal file
2294
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.common.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js
generated
vendored
Normal file
1
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
519
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.d.ts
generated
vendored
Normal file
519
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,519 @@
|
|||
import Vue$1, { VNode, VueConstructor, ComponentOptions, AsyncComponent, VNodeDirective, CreateElement } from 'vue';
|
||||
import { Component as Component$1, AsyncComponent as AsyncComponent$1 } from 'vue/types/options';
|
||||
import { VNodeChildren, VNode as VNode$1, VNodeData } from 'vue/types/vnode';
|
||||
|
||||
declare type Data = {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
declare type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
||||
declare type ComponentObjectPropsOptions<P = Data> = {
|
||||
[K in keyof P]: Prop<P[K]> | null;
|
||||
};
|
||||
declare type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
||||
declare type DefaultFactory<T> = () => T | null | undefined;
|
||||
interface PropOptions<T = any, D = T> {
|
||||
type?: PropType<T> | true | null;
|
||||
required?: boolean;
|
||||
default?: D | DefaultFactory<D> | null | undefined | object;
|
||||
validator?(value: unknown): boolean;
|
||||
}
|
||||
declare type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
|
||||
declare type PropConstructor<T> = {
|
||||
new (...args: any[]): T & object;
|
||||
} | {
|
||||
(): T;
|
||||
} | {
|
||||
new (...args: string[]): Function;
|
||||
};
|
||||
declare type RequiredKeys<T> = {
|
||||
[K in keyof T]: T[K] extends {
|
||||
required: true;
|
||||
} | {
|
||||
default: any;
|
||||
} | BooleanConstructor | {
|
||||
type: BooleanConstructor;
|
||||
} ? K : never;
|
||||
}[keyof T];
|
||||
declare type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
||||
declare type ExtractFunctionPropType<T extends Function, TArgs extends Array<any> = any[], TResult = any> = T extends (...args: TArgs) => TResult ? T : never;
|
||||
declare type ExtractCorrectPropType<T> = T extends Function ? ExtractFunctionPropType<T> : Exclude<T, Function>;
|
||||
declare type InferPropType<T> = T extends null ? any : T extends {
|
||||
type: null | true;
|
||||
} ? any : T extends ObjectConstructor | {
|
||||
type: ObjectConstructor;
|
||||
} ? Record<string, any> : T extends BooleanConstructor | {
|
||||
type: BooleanConstructor;
|
||||
} ? boolean : T extends DateConstructor | {
|
||||
type: DateConstructor;
|
||||
} ? Date : T extends FunctionConstructor | {
|
||||
type: FunctionConstructor;
|
||||
} ? Function : T extends Prop<infer V, infer D> ? unknown extends V ? D extends null | undefined ? V : D : ExtractCorrectPropType<V> : T;
|
||||
declare type ExtractPropTypes<O> = {
|
||||
[K in keyof Pick<O, RequiredKeys<O>>]: InferPropType<O[K]>;
|
||||
} & {
|
||||
[K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>;
|
||||
};
|
||||
declare type DefaultKeys<T> = {
|
||||
[K in keyof T]: T[K] extends {
|
||||
default: any;
|
||||
} | BooleanConstructor | {
|
||||
type: BooleanConstructor;
|
||||
} ? T[K] extends {
|
||||
type: BooleanConstructor;
|
||||
required: true;
|
||||
} ? never : K : never;
|
||||
}[keyof T];
|
||||
declare type ExtractDefaultPropTypes<O> = O extends object ? {
|
||||
[K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>;
|
||||
} : {};
|
||||
|
||||
declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
||||
|
||||
declare type Slot = (...args: any[]) => VNode[];
|
||||
declare type InternalSlots = {
|
||||
[name: string]: Slot | undefined;
|
||||
};
|
||||
declare type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
||||
declare type EmitsOptions = ObjectEmitsOptions | string[];
|
||||
declare type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options, ReturnType extends void | Vue$1 = void> = Options extends Array<infer V> ? (event: V, ...args: any[]) => ReturnType : {} extends Options ? (event: string, ...args: any[]) => ReturnType : UnionToIntersection<{
|
||||
[key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => ReturnType : (event: key, ...args: any[]) => ReturnType;
|
||||
}[Event]>;
|
||||
declare type ComponentRenderEmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options, T extends Vue$1 | void = void> = EmitFn<Options, Event, T>;
|
||||
declare type Slots = Readonly<InternalSlots>;
|
||||
interface SetupContext<E extends EmitsOptions = {}> {
|
||||
attrs: Data;
|
||||
slots: Slots;
|
||||
emit: EmitFn<E>;
|
||||
/**
|
||||
* @deprecated not available in Vue 2
|
||||
*/
|
||||
expose: (exposed?: Record<string, any>) => void;
|
||||
/**
|
||||
* @deprecated not available in Vue 3
|
||||
*/
|
||||
readonly parent: ComponentInstance | null;
|
||||
/**
|
||||
* @deprecated not available in Vue 3
|
||||
*/
|
||||
readonly root: ComponentInstance;
|
||||
/**
|
||||
* @deprecated not available in Vue 3
|
||||
*/
|
||||
readonly listeners: {
|
||||
[key in string]?: Function;
|
||||
};
|
||||
/**
|
||||
* @deprecated not available in Vue 3
|
||||
*/
|
||||
readonly refs: {
|
||||
[key: string]: Vue | Element | Vue[] | Element[];
|
||||
};
|
||||
}
|
||||
/**
|
||||
* We expose a subset of properties on the internal instance as they are
|
||||
* useful for advanced external libraries and tools.
|
||||
*/
|
||||
declare interface ComponentInternalInstance {
|
||||
uid: number;
|
||||
type: Record<string, unknown>;
|
||||
parent: ComponentInternalInstance | null;
|
||||
root: ComponentInternalInstance;
|
||||
/**
|
||||
* Vnode representing this component in its parent's vdom tree
|
||||
*/
|
||||
vnode: VNode;
|
||||
/**
|
||||
* Root vnode of this component's own vdom tree
|
||||
*/
|
||||
/**
|
||||
* The reactive effect for rendering and patching the component. Callable.
|
||||
*/
|
||||
update: Function;
|
||||
data: Data;
|
||||
props: Data;
|
||||
attrs: Data;
|
||||
refs: Data;
|
||||
emit: EmitFn;
|
||||
slots: InternalSlots;
|
||||
emitted: Record<string, boolean> | null;
|
||||
proxy: ComponentInstance;
|
||||
isMounted: boolean;
|
||||
isUnmounted: boolean;
|
||||
isDeactivated: boolean;
|
||||
}
|
||||
declare function getCurrentInstance(): ComponentInternalInstance | null;
|
||||
|
||||
declare type EmitsToProps<T extends EmitsOptions> = T extends string[] ? {
|
||||
[K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
|
||||
} : T extends ObjectEmitsOptions ? {
|
||||
[K in string & `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}` ? T[Uncapitalize<C>] extends null ? (...args: any[]) => any : (...args: T[Uncapitalize<C>] extends (...args: infer P) => any ? P : never) => any : never;
|
||||
} : {};
|
||||
declare type ComponentInstance = InstanceType<VueConstructor>;
|
||||
declare type ComponentRenderProxy<P = {}, // props type extracted from props option
|
||||
B = {}, // raw bindings returned from setup()
|
||||
D = {}, // return from data()
|
||||
C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false> = {
|
||||
$data: D;
|
||||
$props: Readonly<MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps>;
|
||||
$attrs: Record<string, string>;
|
||||
$emit: ComponentRenderEmitFn<Emits, keyof Emits, ComponentRenderProxy<P, B, D, C, M, Mixin, Extends, Emits, PublicProps, Defaults, MakeDefaultsOptional>>;
|
||||
} & Readonly<P> & ShallowUnwrapRef<B> & D & M & ExtractComputedReturns<C> & Omit<Vue$1, '$data' | '$props' | '$attrs' | '$emit'>;
|
||||
declare type VueConstructorProxy<PropsOptions, RawBindings, Data, Computed extends ComputedOptions, Methods extends MethodOptions, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, Props = ExtractPropTypes<PropsOptions> & ({} extends Emits ? {} : EmitsToProps<Emits>)> = Omit<VueConstructor, never> & {
|
||||
new (...args: any[]): ComponentRenderProxy<Props, ShallowUnwrapRef<RawBindings>, Data, Computed, Methods, Mixin, Extends, Emits, Props, ExtractDefaultPropTypes<PropsOptions>, true>;
|
||||
};
|
||||
declare type DefaultData<V> = object | ((this: V) => object);
|
||||
declare type DefaultMethods<V> = {
|
||||
[key: string]: (this: V, ...args: any[]) => any;
|
||||
};
|
||||
declare type DefaultComputed = {
|
||||
[key: string]: any;
|
||||
};
|
||||
declare type VueProxy<PropsOptions, RawBindings, Data = DefaultData<Vue$1>, Computed extends ComputedOptions = DefaultComputed, Methods extends MethodOptions = DefaultMethods<Vue$1>, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}> = ComponentOptions<Vue$1, ShallowUnwrapRef<RawBindings> & Data, Methods, Computed, PropsOptions, ExtractPropTypes<PropsOptions>> & VueConstructorProxy<PropsOptions, RawBindings, Data, Computed, Methods, Mixin, Extends, Emits>;
|
||||
declare type ComponentPublicInstance<P = {}, // props type extracted from props option
|
||||
B = {}, // raw bindings returned from setup()
|
||||
D = {}, // return from data()
|
||||
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false> = {
|
||||
$: ComponentInternalInstance;
|
||||
$data: D;
|
||||
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps;
|
||||
$attrs: Data;
|
||||
$refs: Data;
|
||||
$slots: Slots;
|
||||
$root: ComponentPublicInstance | null;
|
||||
$parent: ComponentPublicInstance | null;
|
||||
$emit: EmitFn<E>;
|
||||
$el: any;
|
||||
$forceUpdate: () => void;
|
||||
$nextTick: typeof nextTick;
|
||||
$watch(source: string | Function, cb: Function, options?: WatchOptions): WatchStopHandle;
|
||||
} & P & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M;
|
||||
|
||||
declare type ComputedGetter$1<T> = (ctx?: any) => T;
|
||||
declare type ComputedSetter$1<T> = (v: T) => void;
|
||||
interface WritableComputedOptions$1<T> {
|
||||
get: ComputedGetter$1<T>;
|
||||
set: ComputedSetter$1<T>;
|
||||
}
|
||||
declare type ComputedOptions = Record<string, ComputedGetter$1<any> | WritableComputedOptions$1<any>>;
|
||||
interface MethodOptions {
|
||||
[key: string]: Function;
|
||||
}
|
||||
declare type SetupFunction<Props, RawBindings = {}, Emits extends EmitsOptions = {}> = (this: void, props: Readonly<Props>, ctx: SetupContext<Emits>) => RawBindings | (() => VNode | null) | void;
|
||||
interface ComponentOptionsBase<Props, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}> extends Omit<ComponentOptions<Vue$1, D, M, C, Props>, 'data' | 'computed' | 'method' | 'setup' | 'props'> {
|
||||
[key: string]: any;
|
||||
data?: (this: Props & Vue$1, vm: Props) => D;
|
||||
computed?: C;
|
||||
methods?: M;
|
||||
}
|
||||
declare type ExtractComputedReturns<T extends any> = {
|
||||
[key in keyof T]: T[key] extends {
|
||||
get: (...args: any[]) => infer TReturn;
|
||||
} ? TReturn : T[key] extends (...args: any[]) => infer TReturn ? TReturn : never;
|
||||
};
|
||||
declare type ComponentOptionsWithProps<PropsOptions = ComponentPropsOptions, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, Props = ExtractPropTypes<PropsOptions>> = ComponentOptionsBase<Props, D, C, M> & {
|
||||
props?: PropsOptions;
|
||||
emits?: Emits & ThisType<void>;
|
||||
setup?: SetupFunction<Props, RawBindings, Emits>;
|
||||
} & ThisType<ComponentRenderProxy<Props, RawBindings, D, C, M, Mixin, Extends, Emits>>;
|
||||
declare type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, Props = Readonly<{
|
||||
[key in PropNames]?: any;
|
||||
}>> = ComponentOptionsBase<Props, D, C, M> & {
|
||||
props?: PropNames[];
|
||||
emits?: Emits & ThisType<void>;
|
||||
setup?: SetupFunction<Props, RawBindings, Emits>;
|
||||
} & ThisType<ComponentRenderProxy<Props, RawBindings, D, C, M, Mixin, Extends, Emits>>;
|
||||
declare type ComponentOptionsWithoutProps<Props = {}, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}> = ComponentOptionsBase<Props, D, C, M> & {
|
||||
props?: undefined;
|
||||
emits?: Emits & ThisType<void>;
|
||||
setup?: SetupFunction<Props, RawBindings, Emits>;
|
||||
} & ThisType<ComponentRenderProxy<Props, RawBindings, D, C, M, Mixin, Extends, Emits>>;
|
||||
|
||||
declare type AnyObject = Record<string | number | symbol, any>;
|
||||
declare type Equal<Left, Right> = (<U>() => U extends Left ? 1 : 0) extends (<U>() => U extends Right ? 1 : 0) ? true : false;
|
||||
declare type HasDefined<T> = Equal<T, unknown> extends true ? false : true;
|
||||
|
||||
/**
|
||||
* overload 1: object format with no props
|
||||
*/
|
||||
declare function defineComponent<RawBindings, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}>(options: ComponentOptionsWithoutProps<{}, RawBindings, D, C, M, Mixin, Extends, Emits>): VueProxy<{}, RawBindings, D, C, M, Mixin, Extends, Emits>;
|
||||
/**
|
||||
* overload 2: object format with array props declaration
|
||||
* props inferred as `{ [key in PropNames]?: any }`
|
||||
*
|
||||
* return type is for Vetur and TSX support
|
||||
*/
|
||||
declare function defineComponent<PropNames extends string, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, PropsOptions extends ComponentPropsOptions = ComponentPropsOptions>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, Emits>): VueProxy<Readonly<{
|
||||
[key in PropNames]?: any;
|
||||
}>, RawBindings, D, C, M, Mixin, Extends, Emits>;
|
||||
/**
|
||||
* overload 3: object format with object props declaration
|
||||
*
|
||||
* see `ExtractPropTypes` in './componentProps.ts'
|
||||
*/
|
||||
declare function defineComponent<Props, RawBindings = Data, D = Data, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin = {}, Extends = {}, Emits extends EmitsOptions = {}, PropsOptions extends ComponentPropsOptions = ComponentPropsOptions>(options: HasDefined<Props> extends true ? ComponentOptionsWithProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, Emits, Props> : ComponentOptionsWithProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, Emits>): VueProxy<PropsOptions, RawBindings, D, C, M, Mixin, Extends, Emits>;
|
||||
|
||||
declare type Component = VueProxy<any, any, any, any, any>;
|
||||
declare type ComponentOrComponentOptions = Component | ComponentOptionsWithoutProps | ComponentOptionsWithArrayProps | ComponentOptionsWithProps;
|
||||
declare type AsyncComponentResolveResult<T = ComponentOrComponentOptions> = T | {
|
||||
default: T;
|
||||
};
|
||||
declare type AsyncComponentLoader = () => Promise<AsyncComponentResolveResult>;
|
||||
interface AsyncComponentOptions {
|
||||
loader: AsyncComponentLoader;
|
||||
loadingComponent?: ComponentOrComponentOptions;
|
||||
errorComponent?: ComponentOrComponentOptions;
|
||||
delay?: number;
|
||||
timeout?: number;
|
||||
suspensible?: boolean;
|
||||
onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
|
||||
}
|
||||
declare function defineAsyncComponent(source: AsyncComponentLoader | AsyncComponentOptions): AsyncComponent;
|
||||
|
||||
declare type DirectiveModifiers = Record<string, boolean>;
|
||||
interface DirectiveBinding<V> extends Readonly<VNodeDirective> {
|
||||
readonly modifiers: DirectiveModifiers;
|
||||
readonly value: V;
|
||||
readonly oldValue: V | null;
|
||||
}
|
||||
declare type DirectiveHook<T = any, Prev = VNode | null, V = any> = (el: T, binding: DirectiveBinding<V>, vnode: VNode, prevVNode: Prev) => void;
|
||||
interface ObjectDirective<T = any, V = any> {
|
||||
bind?: DirectiveHook<T, any, V>;
|
||||
inserted?: DirectiveHook<T, any, V>;
|
||||
update?: DirectiveHook<T, any, V>;
|
||||
componentUpdated?: DirectiveHook<T, any, V>;
|
||||
unbind?: DirectiveHook<T, any, V>;
|
||||
}
|
||||
declare type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
|
||||
declare type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
|
||||
|
||||
declare const Plugin: {
|
||||
install: (Vue: VueConstructor) => void;
|
||||
};
|
||||
|
||||
declare const _refBrand: unique symbol;
|
||||
interface Ref<T = any> {
|
||||
readonly [_refBrand]: true;
|
||||
value: T;
|
||||
}
|
||||
interface WritableComputedRef<T> extends Ref<T> {
|
||||
/**
|
||||
* `effect` is added to be able to differentiate refs from computed properties.
|
||||
* **Differently from Vue 3, it's just `true`**. This is because there is no equivalent
|
||||
* of `ReactiveEffect<T>` in `@vue/composition-api`.
|
||||
*/
|
||||
effect: true;
|
||||
}
|
||||
interface ComputedRef<T = any> extends WritableComputedRef<T> {
|
||||
readonly value: T;
|
||||
}
|
||||
declare type ToRefs<T = any> = {
|
||||
[K in keyof T]: Ref<T[K]>;
|
||||
};
|
||||
declare type CollectionTypes = IterableCollections | WeakCollections;
|
||||
declare type IterableCollections = Map<any, any> | Set<any>;
|
||||
declare type WeakCollections = WeakMap<any, any> | WeakSet<any>;
|
||||
declare type BaseTypes = string | number | boolean | Node | Window | Date;
|
||||
declare type ShallowUnwrapRef<T> = {
|
||||
[K in keyof T]: T[K] extends Ref<infer V> ? V : T[K];
|
||||
};
|
||||
declare type UnwrapRef<T> = T extends Ref<infer V> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
|
||||
declare type UnwrapRefSimple<T> = T extends Function | CollectionTypes | BaseTypes | Ref ? T : T extends Array<any> ? {
|
||||
[K in keyof T]: UnwrapRefSimple<T[K]>;
|
||||
} : T extends object ? {
|
||||
[P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]>;
|
||||
} : T;
|
||||
interface RefOption<T> {
|
||||
get(): T;
|
||||
set?(x: T): void;
|
||||
}
|
||||
declare class RefImpl<T> implements Ref<T> {
|
||||
readonly [_refBrand]: true;
|
||||
value: T;
|
||||
constructor({ get, set }: RefOption<T>);
|
||||
}
|
||||
declare function createRef<T>(options: RefOption<T>, isReadonly?: boolean, isComputed?: boolean): RefImpl<T>;
|
||||
declare function ref<T extends object>(raw: T): T extends Ref ? T : Ref<UnwrapRef<T>>;
|
||||
declare function ref<T>(raw: T): Ref<UnwrapRef<T>>;
|
||||
declare function ref<T = any>(): Ref<T | undefined>;
|
||||
declare function isRef<T>(value: any): value is Ref<T>;
|
||||
declare function unref<T>(ref: T | Ref<T>): T;
|
||||
declare function toRefs<T extends object>(obj: T): ToRefs<T>;
|
||||
declare type CustomRefFactory<T> = (track: () => void, trigger: () => void) => {
|
||||
get: () => T;
|
||||
set: (value: T) => void;
|
||||
};
|
||||
declare function customRef<T>(factory: CustomRefFactory<T>): Ref<T>;
|
||||
declare function toRef<T extends object, K extends keyof T>(object: T, key: K): Ref<T[K]>;
|
||||
declare function shallowRef<T extends object>(value: T): T extends Ref ? T : Ref<T>;
|
||||
declare function shallowRef<T>(value: T): Ref<T>;
|
||||
declare function shallowRef<T = any>(): Ref<T | undefined>;
|
||||
declare function triggerRef(value: any): void;
|
||||
declare function proxyRefs<T extends object>(objectWithRefs: T): ShallowUnwrapRef<T>;
|
||||
|
||||
declare function isRaw(obj: any): boolean;
|
||||
declare function isReactive(obj: any): boolean;
|
||||
declare function shallowReactive<T extends object = any>(obj: T): T;
|
||||
/**
|
||||
* Make obj reactivity
|
||||
*/
|
||||
declare function reactive<T extends object>(obj: T): UnwrapRef<T>;
|
||||
/**
|
||||
* Make sure obj can't be a reactive
|
||||
*/
|
||||
declare function markRaw<T extends object>(obj: T): T;
|
||||
declare function toRaw<T>(observed: T): T;
|
||||
|
||||
declare function isReadonly(obj: any): boolean;
|
||||
declare type Primitive = string | number | boolean | bigint | symbol | undefined | null;
|
||||
declare type Builtin = Primitive | Function | Date | Error | RegExp;
|
||||
declare type DeepReadonly<T> = T extends Builtin ? T : T extends Map<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>> : T extends WeakMap<infer K, infer V> ? WeakMap<DeepReadonly<K>, DeepReadonly<V>> : T extends Set<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends ReadonlySet<infer U> ? ReadonlySet<DeepReadonly<U>> : T extends WeakSet<infer U> ? WeakSet<DeepReadonly<U>> : T extends Promise<infer U> ? Promise<DeepReadonly<U>> : T extends {} ? {
|
||||
readonly [K in keyof T]: DeepReadonly<T[K]>;
|
||||
} : Readonly<T>;
|
||||
declare type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>;
|
||||
/**
|
||||
* **In @vue/composition-api, `reactive` only provides type-level readonly check**
|
||||
*
|
||||
* Creates a readonly copy of the original object. Note the returned copy is not
|
||||
* made reactive, but `readonly` can be called on an already reactive object.
|
||||
*/
|
||||
declare function readonly<T extends object>(target: T): DeepReadonly<UnwrapNestedRefs<T>>;
|
||||
declare function shallowReadonly<T extends object>(obj: T): Readonly<T>;
|
||||
|
||||
/**
|
||||
* Set a property on an object. Adds the new property, triggers change
|
||||
* notification and intercept it's subsequent access if the property doesn't
|
||||
* already exist.
|
||||
*/
|
||||
declare function set<T>(target: AnyObject, key: any, val: T): T;
|
||||
|
||||
/**
|
||||
* Delete a property and trigger change if necessary.
|
||||
*/
|
||||
declare function del(target: AnyObject, key: any): void;
|
||||
|
||||
declare const onBeforeMount: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
declare const onMounted: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
declare const onBeforeUpdate: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
declare const onUpdated: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
declare const onBeforeUnmount: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
declare const onUnmounted: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
declare const onErrorCaptured: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
declare const onActivated: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
declare const onDeactivated: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
declare const onServerPrefetch: (callback: Function, target?: ComponentInternalInstance | null | undefined) => Function | null;
|
||||
|
||||
declare type WatchEffect = (onInvalidate: InvalidateCbRegistrator) => void;
|
||||
declare type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
|
||||
declare type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onInvalidate: InvalidateCbRegistrator) => any;
|
||||
declare type MapSources<T, Immediate> = {
|
||||
[K in keyof T]: T[K] extends WatchSource<infer V> ? Immediate extends true ? V | undefined : V : never;
|
||||
};
|
||||
declare type MultiWatchSources = (WatchSource<unknown> | object)[];
|
||||
interface WatchOptionsBase {
|
||||
flush?: FlushMode;
|
||||
}
|
||||
declare type InvalidateCbRegistrator = (cb: () => void) => void;
|
||||
declare type FlushMode = 'pre' | 'post' | 'sync';
|
||||
interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
|
||||
immediate?: Immediate;
|
||||
deep?: boolean;
|
||||
}
|
||||
interface VueWatcher {
|
||||
lazy: boolean;
|
||||
get(): any;
|
||||
teardown(): void;
|
||||
run(): void;
|
||||
value: any;
|
||||
}
|
||||
declare type WatchStopHandle = () => void;
|
||||
declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchStopHandle;
|
||||
declare function watchPostEffect(effect: WatchEffect): WatchStopHandle;
|
||||
declare function watchSyncEffect(effect: WatchEffect): WatchStopHandle;
|
||||
declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
||||
declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: T, cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
||||
declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
||||
declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
||||
declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
||||
|
||||
declare type ComputedGetter<T> = (ctx?: any) => T;
|
||||
declare type ComputedSetter<T> = (v: T) => void;
|
||||
interface WritableComputedOptions<T> {
|
||||
get: ComputedGetter<T>;
|
||||
set: ComputedSetter<T>;
|
||||
}
|
||||
declare function computed<T>(getter: ComputedGetter<T>): ComputedRef<T>;
|
||||
declare function computed<T>(options: WritableComputedOptions<T>): WritableComputedRef<T>;
|
||||
|
||||
interface InjectionKey<T> extends Symbol {
|
||||
}
|
||||
declare function provide<T>(key: InjectionKey<T> | string, value: T): void;
|
||||
declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
|
||||
declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
|
||||
declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory?: true): T;
|
||||
|
||||
declare const useCssModule: (name?: string) => Record<string, string>;
|
||||
/**
|
||||
* @deprecated use `useCssModule` instead.
|
||||
*/
|
||||
declare const useCSSModule: (name?: string) => Record<string, string>;
|
||||
|
||||
interface App<T = any> {
|
||||
config: VueConstructor['config'];
|
||||
use: VueConstructor['use'];
|
||||
mixin: VueConstructor['mixin'];
|
||||
component: VueConstructor['component'];
|
||||
directive(name: string): Directive | undefined;
|
||||
directive(name: string, directive: Directive): this;
|
||||
provide<T>(key: InjectionKey<T> | symbol | string, value: T): this;
|
||||
mount: Vue$1['$mount'];
|
||||
unmount: Vue$1['$destroy'];
|
||||
}
|
||||
declare function createApp(rootComponent: any, rootProps?: any): App;
|
||||
|
||||
declare type NextTick = Vue$1['$nextTick'];
|
||||
declare const nextTick: NextTick;
|
||||
|
||||
interface H extends CreateElement {
|
||||
(this: ComponentInternalInstance | null | undefined, tag?: string | Component$1<any, any, any, any> | AsyncComponent$1<any, any, any, any> | (() => Component$1), children?: VNodeChildren): VNode$1;
|
||||
(this: ComponentInternalInstance | null | undefined, tag?: string | Component$1<any, any, any, any> | AsyncComponent$1<any, any, any, any> | (() => Component$1), data?: VNodeData, children?: VNodeChildren): VNode$1;
|
||||
}
|
||||
declare const createElement: H;
|
||||
|
||||
/**
|
||||
* Displays a warning message (using console.error) with a stack trace if the
|
||||
* function is called inside of active component.
|
||||
*
|
||||
* @param message warning message to be displayed
|
||||
*/
|
||||
declare function warn(message: string): void;
|
||||
|
||||
declare class EffectScopeImpl {
|
||||
active: boolean;
|
||||
effects: EffectScope[];
|
||||
cleanups: (() => void)[];
|
||||
constructor(vm: Vue);
|
||||
run<T>(fn: () => T): T | undefined;
|
||||
on(): void;
|
||||
off(): void;
|
||||
stop(): void;
|
||||
}
|
||||
declare class EffectScope extends EffectScopeImpl {
|
||||
constructor(detached?: boolean);
|
||||
}
|
||||
declare function effectScope(detached?: boolean): EffectScope;
|
||||
declare function getCurrentScope(): EffectScope | undefined;
|
||||
declare function onScopeDispose(fn: () => void): void;
|
||||
|
||||
declare function useSlots(): SetupContext['slots'];
|
||||
declare function useAttrs(): SetupContext['attrs'];
|
||||
|
||||
declare const version: string;
|
||||
|
||||
declare module 'vue/types/options' {
|
||||
interface ComponentOptions<V extends Vue$1> {
|
||||
setup?: SetupFunction<Data, Data>;
|
||||
}
|
||||
}
|
||||
|
||||
export { App, ComponentInstance, ComponentInternalInstance, ComponentPropsOptions, ComponentPublicInstance, ComponentRenderProxy, ComputedGetter, ComputedOptions, ComputedRef, ComputedSetter, Data, DeepReadonly, Directive, DirectiveBinding, DirectiveHook, DirectiveModifiers, EffectScope, ExtractDefaultPropTypes, ExtractPropTypes, FlushMode, FunctionDirective, InjectionKey, MethodOptions, ObjectDirective, PropOptions, PropType, Ref, SetupContext, SetupFunction, ShallowUnwrapRef, ToRefs, UnwrapNestedRefs, UnwrapRef, UnwrapRefSimple, VueWatcher, WatchCallback, WatchEffect, WatchOptions, WatchOptionsBase, WatchSource, WatchStopHandle, WritableComputedOptions, WritableComputedRef, computed, createApp, createRef, customRef, Plugin as default, defineAsyncComponent, defineComponent, del, effectScope, getCurrentInstance, getCurrentScope, createElement as h, inject, isRaw, isReactive, isReadonly, isRef, markRaw, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCSSModule, useCssModule, useSlots, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect };
|
2251
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.esm.js
generated
vendored
Normal file
2251
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.esm.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2300
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.js
generated
vendored
Normal file
2300
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2251
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.mjs
generated
vendored
Normal file
2251
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.prod.js
generated
vendored
Normal file
1
uniapp04/node_modules/@vue/composition-api/dist/vue-composition-api.prod.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
uniapp04/node_modules/@vue/composition-api/index.js
generated
vendored
Normal file
7
uniapp04/node_modules/@vue/composition-api/index.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./dist/vue-composition-api.common.prod.js')
|
||||
} else {
|
||||
module.exports = require('./dist/vue-composition-api.common.js')
|
||||
}
|
97
uniapp04/node_modules/@vue/composition-api/package.json
generated
vendored
Normal file
97
uniapp04/node_modules/@vue/composition-api/package.json
generated
vendored
Normal file
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
"name": "@vue/composition-api",
|
||||
"version": "1.7.2",
|
||||
"packageManager": "pnpm@8.6.12",
|
||||
"description": "Provide logic composition capabilities for Vue.",
|
||||
"keywords": [
|
||||
"vue",
|
||||
"composition-api"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/composition-api.git"
|
||||
},
|
||||
"main": "./index.js",
|
||||
"module": "./dist/vue-composition-api.mjs",
|
||||
"unpkg": "./dist/vue-composition-api.prod.js",
|
||||
"jsdelivr": "./dist/vue-composition-api.prod.js",
|
||||
"types": "./dist/vue-composition-api.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/vue-composition-api.mjs",
|
||||
"types": "./dist/vue-composition-api.d.ts",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"author": {
|
||||
"name": "liximomo",
|
||||
"email": "liximomo@gmail.com"
|
||||
},
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist",
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"start": "rollup -c -w",
|
||||
"build": "rimraf dist && rollup -c",
|
||||
"lint": "prettier --write --parser typescript \"{src,test,test-dts}/**/*.ts?(x)\" && prettier --write \"{src,test}/**/*.js\"",
|
||||
"test": "vitest",
|
||||
"test:all": "pnpm run test && pnpm run test:dts",
|
||||
"test:dts": "tsc -p ./test-dts/tsconfig.json && tsc -p ./test-dts/tsconfig.vue3.json && pnpm run build && tsc -p ./test-dts/tsconfig.build.json",
|
||||
"update-readme": "node ./scripts/update-readme.js",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s && pnpm run update-readme && git add CHANGELOG.md README.*",
|
||||
"release": "bumpp -x \"npm run changelog\" --all && npm publish",
|
||||
"release-gh": "conventional-github-releaser -p angular",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/composition-api/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/composition-api#readme",
|
||||
"peerDependencies": {
|
||||
"vue": ">= 2.5 < 2.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||
"@rollup/plugin-replace": "^4.0.0",
|
||||
"@types/node": "^17.0.31",
|
||||
"bumpp": "^9.1.1",
|
||||
"conventional-changelog-cli": "^2.2.2",
|
||||
"conventional-github-releaser": "^3.1.5",
|
||||
"jsdom": "^20.0.0",
|
||||
"lint-staged": "^14.0.0",
|
||||
"prettier": "^3.0.1",
|
||||
"rimraf": "^5.0.1",
|
||||
"rollup": "^2.72.0",
|
||||
"rollup-plugin-dts": "^4.2.1",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-plugin-typescript2": "^0.31.2",
|
||||
"simple-git-hooks": "^2.9.0",
|
||||
"tslib": "^2.4.0",
|
||||
"typescript": "^4.6.4",
|
||||
"vitest": "^0.34.1",
|
||||
"vue": "^2.6.14",
|
||||
"vue3": "npm:vue@3.2.21",
|
||||
"vue-router": "^3.5.3",
|
||||
"vue-server-renderer": "^2.6.14"
|
||||
},
|
||||
"simple-git-hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"prettier --write"
|
||||
],
|
||||
"*.ts?(x)": [
|
||||
"prettier --parser=typescript --write"
|
||||
]
|
||||
},
|
||||
"prettier": {
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"printWidth": 80
|
||||
}
|
||||
}
|
20
uniapp04/node_modules/debug/LICENSE
generated
vendored
Normal file
20
uniapp04/node_modules/debug/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
||||
Copyright (c) 2018-2021 Josh Junon
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
and associated documentation files (the 'Software'), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||
portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
481
uniapp04/node_modules/debug/README.md
generated
vendored
Normal file
481
uniapp04/node_modules/debug/README.md
generated
vendored
Normal file
|
@ -0,0 +1,481 @@
|
|||
# debug
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
|
||||
|
||||
A tiny JavaScript debugging utility modelled after Node.js core's debugging
|
||||
technique. Works in Node.js and web browsers.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ npm install debug
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
|
||||
|
||||
Example [_app.js_](./examples/node/app.js):
|
||||
|
||||
```js
|
||||
var debug = require('debug')('http')
|
||||
, http = require('http')
|
||||
, name = 'My App';
|
||||
|
||||
// fake app
|
||||
|
||||
debug('booting %o', name);
|
||||
|
||||
http.createServer(function(req, res){
|
||||
debug(req.method + ' ' + req.url);
|
||||
res.end('hello\n');
|
||||
}).listen(3000, function(){
|
||||
debug('listening');
|
||||
});
|
||||
|
||||
// fake worker of some kind
|
||||
|
||||
require('./worker');
|
||||
```
|
||||
|
||||
Example [_worker.js_](./examples/node/worker.js):
|
||||
|
||||
```js
|
||||
var a = require('debug')('worker:a')
|
||||
, b = require('debug')('worker:b');
|
||||
|
||||
function work() {
|
||||
a('doing lots of uninteresting work');
|
||||
setTimeout(work, Math.random() * 1000);
|
||||
}
|
||||
|
||||
work();
|
||||
|
||||
function workb() {
|
||||
b('doing some work');
|
||||
setTimeout(workb, Math.random() * 2000);
|
||||
}
|
||||
|
||||
workb();
|
||||
```
|
||||
|
||||
The `DEBUG` environment variable is then used to enable these based on space or
|
||||
comma-delimited names.
|
||||
|
||||
Here are some examples:
|
||||
|
||||
<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
|
||||
<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
|
||||
<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
|
||||
|
||||
#### Windows command prompt notes
|
||||
|
||||
##### CMD
|
||||
|
||||
On Windows the environment variable is set using the `set` command.
|
||||
|
||||
```cmd
|
||||
set DEBUG=*,-not_this
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```cmd
|
||||
set DEBUG=* & node app.js
|
||||
```
|
||||
|
||||
##### PowerShell (VS Code default)
|
||||
|
||||
PowerShell uses different syntax to set environment variables.
|
||||
|
||||
```cmd
|
||||
$env:DEBUG = "*,-not_this"
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```cmd
|
||||
$env:DEBUG='app';node app.js
|
||||
```
|
||||
|
||||
Then, run the program to be debugged as usual.
|
||||
|
||||
npm script example:
|
||||
```js
|
||||
"windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
|
||||
```
|
||||
|
||||
## Namespace Colors
|
||||
|
||||
Every debug instance has a color generated for it based on its namespace name.
|
||||
This helps when visually parsing the debug output to identify which debug instance
|
||||
a debug line belongs to.
|
||||
|
||||
#### Node.js
|
||||
|
||||
In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
|
||||
the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
|
||||
otherwise debug will only use a small handful of basic colors.
|
||||
|
||||
<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
|
||||
|
||||
#### Web Browser
|
||||
|
||||
Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
|
||||
option. These are WebKit web inspectors, Firefox ([since version
|
||||
31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
|
||||
and the Firebug plugin for Firefox (any version).
|
||||
|
||||
<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
|
||||
|
||||
|
||||
## Millisecond diff
|
||||
|
||||
When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
|
||||
|
||||
When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
|
||||
|
||||
|
||||
## Conventions
|
||||
|
||||
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.
|
||||
|
||||
## Wildcards
|
||||
|
||||
The `*` character may be used as a wildcard. Suppose for example your library has
|
||||
debuggers named "connect:bodyParser", "connect:compress", "connect:session",
|
||||
instead of listing all three with
|
||||
`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
|
||||
`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
|
||||
|
||||
You can also exclude specific debuggers by prefixing them with a "-" character.
|
||||
For example, `DEBUG=*,-connect:*` would include all debuggers except those
|
||||
starting with "connect:".
|
||||
|
||||
## Environment Variables
|
||||
|
||||
When running through Node.js, you can set a few environment variables that will
|
||||
change the behavior of the debug logging:
|
||||
|
||||
| Name | Purpose |
|
||||
|-----------|-------------------------------------------------|
|
||||
| `DEBUG` | Enables/disables specific debugging namespaces. |
|
||||
| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). |
|
||||
| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
|
||||
| `DEBUG_DEPTH` | Object inspection depth. |
|
||||
| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
|
||||
|
||||
|
||||
__Note:__ The environment variables beginning with `DEBUG_` end up being
|
||||
converted into an Options object that gets used with `%o`/`%O` formatters.
|
||||
See the Node.js documentation for
|
||||
[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
|
||||
for the complete list.
|
||||
|
||||
## Formatters
|
||||
|
||||
Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
|
||||
Below are the officially supported formatters:
|
||||
|
||||
| Formatter | Representation |
|
||||
|-----------|----------------|
|
||||
| `%O` | Pretty-print an Object on multiple lines. |
|
||||
| `%o` | Pretty-print an Object all on a single line. |
|
||||
| `%s` | String. |
|
||||
| `%d` | Number (both integer and float). |
|
||||
| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
|
||||
| `%%` | Single percent sign ('%'). This does not consume an argument. |
|
||||
|
||||
|
||||
### Custom formatters
|
||||
|
||||
You can add custom formatters by extending the `debug.formatters` object.
|
||||
For example, if you wanted to add support for rendering a Buffer as hex with
|
||||
`%h`, you could do something like:
|
||||
|
||||
```js
|
||||
const createDebug = require('debug')
|
||||
createDebug.formatters.h = (v) => {
|
||||
return v.toString('hex')
|
||||
}
|
||||
|
||||
// …elsewhere
|
||||
const debug = createDebug('foo')
|
||||
debug('this is hex: %h', new Buffer('hello world'))
|
||||
// foo this is hex: 68656c6c6f20776f726c6421 +0ms
|
||||
```
|
||||
|
||||
|
||||
## Browser Support
|
||||
|
||||
You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
|
||||
or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
|
||||
if you don't want to build it yourself.
|
||||
|
||||
Debug's enable state is currently persisted by `localStorage`.
|
||||
Consider the situation shown below where you have `worker:a` and `worker:b`,
|
||||
and wish to debug both. You can enable this using `localStorage.debug`:
|
||||
|
||||
```js
|
||||
localStorage.debug = 'worker:*'
|
||||
```
|
||||
|
||||
And then refresh the page.
|
||||
|
||||
```js
|
||||
a = debug('worker:a');
|
||||
b = debug('worker:b');
|
||||
|
||||
setInterval(function(){
|
||||
a('doing some work');
|
||||
}, 1000);
|
||||
|
||||
setInterval(function(){
|
||||
b('doing some work');
|
||||
}, 1200);
|
||||
```
|
||||
|
||||
In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.
|
||||
|
||||
<img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png">
|
||||
|
||||
## Output streams
|
||||
|
||||
By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
|
||||
|
||||
Example [_stdout.js_](./examples/node/stdout.js):
|
||||
|
||||
```js
|
||||
var debug = require('debug');
|
||||
var error = debug('app:error');
|
||||
|
||||
// by default stderr is used
|
||||
error('goes to stderr!');
|
||||
|
||||
var log = debug('app:log');
|
||||
// set this namespace to log via console.log
|
||||
log.log = console.log.bind(console); // don't forget to bind to console!
|
||||
log('goes to stdout');
|
||||
error('still goes to stderr!');
|
||||
|
||||
// set all output to go via console.info
|
||||
// overrides all per-namespace log settings
|
||||
debug.log = console.info.bind(console);
|
||||
error('now goes to stdout via console.info');
|
||||
log('still goes to stdout, but via console.info now');
|
||||
```
|
||||
|
||||
## Extend
|
||||
You can simply extend debugger
|
||||
```js
|
||||
const log = require('debug')('auth');
|
||||
|
||||
//creates new debug instance with extended namespace
|
||||
const logSign = log.extend('sign');
|
||||
const logLogin = log.extend('login');
|
||||
|
||||
log('hello'); // auth hello
|
||||
logSign('hello'); //auth:sign hello
|
||||
logLogin('hello'); //auth:login hello
|
||||
```
|
||||
|
||||
## Set dynamically
|
||||
|
||||
You can also enable debug dynamically by calling the `enable()` method :
|
||||
|
||||
```js
|
||||
let debug = require('debug');
|
||||
|
||||
console.log(1, debug.enabled('test'));
|
||||
|
||||
debug.enable('test');
|
||||
console.log(2, debug.enabled('test'));
|
||||
|
||||
debug.disable();
|
||||
console.log(3, debug.enabled('test'));
|
||||
|
||||
```
|
||||
|
||||
print :
|
||||
```
|
||||
1 false
|
||||
2 true
|
||||
3 false
|
||||
```
|
||||
|
||||
Usage :
|
||||
`enable(namespaces)`
|
||||
`namespaces` can include modes separated by a colon and wildcards.
|
||||
|
||||
Note that calling `enable()` completely overrides previously set DEBUG variable :
|
||||
|
||||
```
|
||||
$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
|
||||
=> false
|
||||
```
|
||||
|
||||
`disable()`
|
||||
|
||||
Will disable all namespaces. The functions returns the namespaces currently
|
||||
enabled (and skipped). This can be useful if you want to disable debugging
|
||||
temporarily without knowing what was enabled to begin with.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
let debug = require('debug');
|
||||
debug.enable('foo:*,-foo:bar');
|
||||
let namespaces = debug.disable();
|
||||
debug.enable(namespaces);
|
||||
```
|
||||
|
||||
Note: There is no guarantee that the string will be identical to the initial
|
||||
enable string, but semantically they will be identical.
|
||||
|
||||
## Checking whether a debug target is enabled
|
||||
|
||||
After you've created a debug instance, you can determine whether or not it is
|
||||
enabled by checking the `enabled` property:
|
||||
|
||||
```javascript
|
||||
const debug = require('debug')('http');
|
||||
|
||||
if (debug.enabled) {
|
||||
// do stuff...
|
||||
}
|
||||
```
|
||||
|
||||
You can also manually toggle this property to force the debug instance to be
|
||||
enabled or disabled.
|
||||
|
||||
## Usage in child processes
|
||||
|
||||
Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process.
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
worker = fork(WORKER_WRAP_PATH, [workerPath], {
|
||||
stdio: [
|
||||
/* stdin: */ 0,
|
||||
/* stdout: */ 'pipe',
|
||||
/* stderr: */ 'pipe',
|
||||
'ipc',
|
||||
],
|
||||
env: Object.assign({}, process.env, {
|
||||
DEBUG_COLORS: 1 // without this settings, colors won't be shown
|
||||
}),
|
||||
});
|
||||
|
||||
worker.stderr.pipe(process.stderr, { end: false });
|
||||
```
|
||||
|
||||
|
||||
## Authors
|
||||
|
||||
- TJ Holowaychuk
|
||||
- Nathan Rajlich
|
||||
- Andrew Rhyne
|
||||
- Josh Junon
|
||||
|
||||
## Backers
|
||||
|
||||
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
|
||||
|
||||
<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
|
||||
|
||||
|
||||
## Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
||||
Copyright (c) 2018-2021 Josh Junon
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
60
uniapp04/node_modules/debug/package.json
generated
vendored
Normal file
60
uniapp04/node_modules/debug/package.json
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"name": "debug",
|
||||
"version": "4.3.7",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/debug-js/debug.git"
|
||||
},
|
||||
"description": "Lightweight debugging utility for Node.js and the browser",
|
||||
"keywords": [
|
||||
"debug",
|
||||
"log",
|
||||
"debugger"
|
||||
],
|
||||
"files": [
|
||||
"src",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"author": "Josh Junon (https://github.com/qix-)",
|
||||
"contributors": [
|
||||
"TJ Holowaychuk <tj@vision-media.ca>",
|
||||
"Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
|
||||
"Andrew Rhyne <rhyneandrew@gmail.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"lint": "xo",
|
||||
"test": "npm run test:node && npm run test:browser && npm run lint",
|
||||
"test:node": "istanbul cover _mocha -- test.js test.node.js",
|
||||
"test:browser": "karma start --single-run",
|
||||
"test:coverage": "cat ./coverage/lcov.info | coveralls"
|
||||
},
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"brfs": "^2.0.1",
|
||||
"browserify": "^16.2.3",
|
||||
"coveralls": "^3.0.2",
|
||||
"istanbul": "^0.4.5",
|
||||
"karma": "^3.1.4",
|
||||
"karma-browserify": "^6.0.0",
|
||||
"karma-chrome-launcher": "^2.2.0",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"mocha": "^5.2.0",
|
||||
"mocha-lcov-reporter": "^1.2.0",
|
||||
"sinon": "^14.0.0",
|
||||
"xo": "^0.23.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"main": "./src/index.js",
|
||||
"browser": "./src/browser.js",
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
}
|
||||
}
|
271
uniapp04/node_modules/debug/src/browser.js
generated
vendored
Normal file
271
uniapp04/node_modules/debug/src/browser.js
generated
vendored
Normal file
|
@ -0,0 +1,271 @@
|
|||
/* eslint-env browser */
|
||||
|
||||
/**
|
||||
* This is the web browser implementation of `debug()`.
|
||||
*/
|
||||
|
||||
exports.formatArgs = formatArgs;
|
||||
exports.save = save;
|
||||
exports.load = load;
|
||||
exports.useColors = useColors;
|
||||
exports.storage = localstorage();
|
||||
exports.destroy = (() => {
|
||||
let warned = false;
|
||||
|
||||
return () => {
|
||||
if (!warned) {
|
||||
warned = true;
|
||||
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
/**
|
||||
* Colors.
|
||||
*/
|
||||
|
||||
exports.colors = [
|
||||
'#0000CC',
|
||||
'#0000FF',
|
||||
'#0033CC',
|
||||
'#0033FF',
|
||||
'#0066CC',
|
||||
'#0066FF',
|
||||
'#0099CC',
|
||||
'#0099FF',
|
||||
'#00CC00',
|
||||
'#00CC33',
|
||||
'#00CC66',
|
||||
'#00CC99',
|
||||
'#00CCCC',
|
||||
'#00CCFF',
|
||||
'#3300CC',
|
||||
'#3300FF',
|
||||
'#3333CC',
|
||||
'#3333FF',
|
||||
'#3366CC',
|
||||
'#3366FF',
|
||||
'#3399CC',
|
||||
'#3399FF',
|
||||
'#33CC00',
|
||||
'#33CC33',
|
||||
'#33CC66',
|
||||
'#33CC99',
|
||||
'#33CCCC',
|
||||
'#33CCFF',
|
||||
'#6600CC',
|
||||
'#6600FF',
|
||||
'#6633CC',
|
||||
'#6633FF',
|
||||
'#66CC00',
|
||||
'#66CC33',
|
||||
'#9900CC',
|
||||
'#9900FF',
|
||||
'#9933CC',
|
||||
'#9933FF',
|
||||
'#99CC00',
|
||||
'#99CC33',
|
||||
'#CC0000',
|
||||
'#CC0033',
|
||||
'#CC0066',
|
||||
'#CC0099',
|
||||
'#CC00CC',
|
||||
'#CC00FF',
|
||||
'#CC3300',
|
||||
'#CC3333',
|
||||
'#CC3366',
|
||||
'#CC3399',
|
||||
'#CC33CC',
|
||||
'#CC33FF',
|
||||
'#CC6600',
|
||||
'#CC6633',
|
||||
'#CC9900',
|
||||
'#CC9933',
|
||||
'#CCCC00',
|
||||
'#CCCC33',
|
||||
'#FF0000',
|
||||
'#FF0033',
|
||||
'#FF0066',
|
||||
'#FF0099',
|
||||
'#FF00CC',
|
||||
'#FF00FF',
|
||||
'#FF3300',
|
||||
'#FF3333',
|
||||
'#FF3366',
|
||||
'#FF3399',
|
||||
'#FF33CC',
|
||||
'#FF33FF',
|
||||
'#FF6600',
|
||||
'#FF6633',
|
||||
'#FF9900',
|
||||
'#FF9933',
|
||||
'#FFCC00',
|
||||
'#FFCC33'
|
||||
];
|
||||
|
||||
/**
|
||||
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
||||
* and the Firebug extension (any Firefox version) are known
|
||||
* to support "%c" CSS customizations.
|
||||
*
|
||||
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
function useColors() {
|
||||
// NB: In an Electron preload script, document will be defined but not fully
|
||||
// initialized. Since we know we're in Chrome, we'll just detect this case
|
||||
// explicitly
|
||||
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Internet Explorer and Edge do not support colors.
|
||||
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let m;
|
||||
|
||||
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
||||
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
||||
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
||||
// Is firebug? http://stackoverflow.com/a/398120/376773
|
||||
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
||||
// Is firefox >= v31?
|
||||
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
||||
(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
|
||||
// Double check webkit in userAgent just in case we are in a worker
|
||||
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
||||
}
|
||||
|
||||
/**
|
||||
* Colorize log arguments if enabled.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function formatArgs(args) {
|
||||
args[0] = (this.useColors ? '%c' : '') +
|
||||
this.namespace +
|
||||
(this.useColors ? ' %c' : ' ') +
|
||||
args[0] +
|
||||
(this.useColors ? '%c ' : ' ') +
|
||||
'+' + module.exports.humanize(this.diff);
|
||||
|
||||
if (!this.useColors) {
|
||||
return;
|
||||
}
|
||||
|
||||
const c = 'color: ' + this.color;
|
||||
args.splice(1, 0, c, 'color: inherit');
|
||||
|
||||
// The final "%c" is somewhat tricky, because there could be other
|
||||
// arguments passed either before or after the %c, so we need to
|
||||
// figure out the correct index to insert the CSS into
|
||||
let index = 0;
|
||||
let lastC = 0;
|
||||
args[0].replace(/%[a-zA-Z%]/g, match => {
|
||||
if (match === '%%') {
|
||||
return;
|
||||
}
|
||||
index++;
|
||||
if (match === '%c') {
|
||||
// We only are interested in the *last* %c
|
||||
// (the user may have provided their own)
|
||||
lastC = index;
|
||||
}
|
||||
});
|
||||
|
||||
args.splice(lastC, 0, c);
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes `console.debug()` when available.
|
||||
* No-op when `console.debug` is not a "function".
|
||||
* If `console.debug` is not available, falls back
|
||||
* to `console.log`.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
exports.log = console.debug || console.log || (() => {});
|
||||
|
||||
/**
|
||||
* Save `namespaces`.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api private
|
||||
*/
|
||||
function save(namespaces) {
|
||||
try {
|
||||
if (namespaces) {
|
||||
exports.storage.setItem('debug', namespaces);
|
||||
} else {
|
||||
exports.storage.removeItem('debug');
|
||||
}
|
||||
} catch (error) {
|
||||
// Swallow
|
||||
// XXX (@Qix-) should we be logging these?
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load `namespaces`.
|
||||
*
|
||||
* @return {String} returns the previously persisted debug modes
|
||||
* @api private
|
||||
*/
|
||||
function load() {
|
||||
let r;
|
||||
try {
|
||||
r = exports.storage.getItem('debug');
|
||||
} catch (error) {
|
||||
// Swallow
|
||||
// XXX (@Qix-) should we be logging these?
|
||||
}
|
||||
|
||||
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
||||
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
||||
r = process.env.DEBUG;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Localstorage attempts to return the localstorage.
|
||||
*
|
||||
* This is necessary because safari throws
|
||||
* when a user disables cookies/localstorage
|
||||
* and you attempt to access it.
|
||||
*
|
||||
* @return {LocalStorage}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function localstorage() {
|
||||
try {
|
||||
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
||||
// The Browser also has localStorage in the global context.
|
||||
return localStorage;
|
||||
} catch (error) {
|
||||
// Swallow
|
||||
// XXX (@Qix-) should we be logging these?
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = require('./common')(exports);
|
||||
|
||||
const {formatters} = module.exports;
|
||||
|
||||
/**
|
||||
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
||||
*/
|
||||
|
||||
formatters.j = function (v) {
|
||||
try {
|
||||
return JSON.stringify(v);
|
||||
} catch (error) {
|
||||
return '[UnexpectedJSONParseError]: ' + error.message;
|
||||
}
|
||||
};
|
274
uniapp04/node_modules/debug/src/common.js
generated
vendored
Normal file
274
uniapp04/node_modules/debug/src/common.js
generated
vendored
Normal file
|
@ -0,0 +1,274 @@
|
|||
|
||||
/**
|
||||
* This is the common logic for both the Node.js and web browser
|
||||
* implementations of `debug()`.
|
||||
*/
|
||||
|
||||
function setup(env) {
|
||||
createDebug.debug = createDebug;
|
||||
createDebug.default = createDebug;
|
||||
createDebug.coerce = coerce;
|
||||
createDebug.disable = disable;
|
||||
createDebug.enable = enable;
|
||||
createDebug.enabled = enabled;
|
||||
createDebug.humanize = require('ms');
|
||||
createDebug.destroy = destroy;
|
||||
|
||||
Object.keys(env).forEach(key => {
|
||||
createDebug[key] = env[key];
|
||||
});
|
||||
|
||||
/**
|
||||
* The currently active debug mode names, and names to skip.
|
||||
*/
|
||||
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
|
||||
/**
|
||||
* Map of special "%n" handling functions, for the debug "format" argument.
|
||||
*
|
||||
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
||||
*/
|
||||
createDebug.formatters = {};
|
||||
|
||||
/**
|
||||
* Selects a color for a debug namespace
|
||||
* @param {String} namespace The namespace string for the debug instance to be colored
|
||||
* @return {Number|String} An ANSI color code for the given namespace
|
||||
* @api private
|
||||
*/
|
||||
function selectColor(namespace) {
|
||||
let hash = 0;
|
||||
|
||||
for (let i = 0; i < namespace.length; i++) {
|
||||
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
|
||||
hash |= 0; // Convert to 32bit integer
|
||||
}
|
||||
|
||||
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
||||
}
|
||||
createDebug.selectColor = selectColor;
|
||||
|
||||
/**
|
||||
* Create a debugger with the given `namespace`.
|
||||
*
|
||||
* @param {String} namespace
|
||||
* @return {Function}
|
||||
* @api public
|
||||
*/
|
||||
function createDebug(namespace) {
|
||||
let prevTime;
|
||||
let enableOverride = null;
|
||||
let namespacesCache;
|
||||
let enabledCache;
|
||||
|
||||
function debug(...args) {
|
||||
// Disabled?
|
||||
if (!debug.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const self = debug;
|
||||
|
||||
// Set `diff` timestamp
|
||||
const curr = Number(new Date());
|
||||
const ms = curr - (prevTime || curr);
|
||||
self.diff = ms;
|
||||
self.prev = prevTime;
|
||||
self.curr = curr;
|
||||
prevTime = curr;
|
||||
|
||||
args[0] = createDebug.coerce(args[0]);
|
||||
|
||||
if (typeof args[0] !== 'string') {
|
||||
// Anything else let's inspect with %O
|
||||
args.unshift('%O');
|
||||
}
|
||||
|
||||
// Apply any `formatters` transformations
|
||||
let index = 0;
|
||||
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
||||
// If we encounter an escaped % then don't increase the array index
|
||||
if (match === '%%') {
|
||||
return '%';
|
||||
}
|
||||
index++;
|
||||
const formatter = createDebug.formatters[format];
|
||||
if (typeof formatter === 'function') {
|
||||
const val = args[index];
|
||||
match = formatter.call(self, val);
|
||||
|
||||
// Now we need to remove `args[index]` since it's inlined in the `format`
|
||||
args.splice(index, 1);
|
||||
index--;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
|
||||
// Apply env-specific formatting (colors, etc.)
|
||||
createDebug.formatArgs.call(self, args);
|
||||
|
||||
const logFn = self.log || createDebug.log;
|
||||
logFn.apply(self, args);
|
||||
}
|
||||
|
||||
debug.namespace = namespace;
|
||||
debug.useColors = createDebug.useColors();
|
||||
debug.color = createDebug.selectColor(namespace);
|
||||
debug.extend = extend;
|
||||
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
|
||||
|
||||
Object.defineProperty(debug, 'enabled', {
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
get: () => {
|
||||
if (enableOverride !== null) {
|
||||
return enableOverride;
|
||||
}
|
||||
if (namespacesCache !== createDebug.namespaces) {
|
||||
namespacesCache = createDebug.namespaces;
|
||||
enabledCache = createDebug.enabled(namespace);
|
||||
}
|
||||
|
||||
return enabledCache;
|
||||
},
|
||||
set: v => {
|
||||
enableOverride = v;
|
||||
}
|
||||
});
|
||||
|
||||
// Env-specific initialization logic for debug instances
|
||||
if (typeof createDebug.init === 'function') {
|
||||
createDebug.init(debug);
|
||||
}
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
function extend(namespace, delimiter) {
|
||||
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
||||
newDebug.log = this.log;
|
||||
return newDebug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables a debug mode by namespaces. This can include modes
|
||||
* separated by a colon and wildcards.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api public
|
||||
*/
|
||||
function enable(namespaces) {
|
||||
createDebug.save(namespaces);
|
||||
createDebug.namespaces = namespaces;
|
||||
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
|
||||
let i;
|
||||
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
||||
const len = split.length;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (!split[i]) {
|
||||
// ignore empty strings
|
||||
continue;
|
||||
}
|
||||
|
||||
namespaces = split[i].replace(/\*/g, '.*?');
|
||||
|
||||
if (namespaces[0] === '-') {
|
||||
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
||||
} else {
|
||||
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable debug output.
|
||||
*
|
||||
* @return {String} namespaces
|
||||
* @api public
|
||||
*/
|
||||
function disable() {
|
||||
const namespaces = [
|
||||
...createDebug.names.map(toNamespace),
|
||||
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
||||
].join(',');
|
||||
createDebug.enable('');
|
||||
return namespaces;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given mode name is enabled, false otherwise.
|
||||
*
|
||||
* @param {String} name
|
||||
* @return {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
function enabled(name) {
|
||||
if (name[name.length - 1] === '*') {
|
||||
return true;
|
||||
}
|
||||
|
||||
let i;
|
||||
let len;
|
||||
|
||||
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
||||
if (createDebug.skips[i].test(name)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
||||
if (createDebug.names[i].test(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert regexp to namespace
|
||||
*
|
||||
* @param {RegExp} regxep
|
||||
* @return {String} namespace
|
||||
* @api private
|
||||
*/
|
||||
function toNamespace(regexp) {
|
||||
return regexp.toString()
|
||||
.substring(2, regexp.toString().length - 2)
|
||||
.replace(/\.\*\?$/, '*');
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerce `val`.
|
||||
*
|
||||
* @param {Mixed} val
|
||||
* @return {Mixed}
|
||||
* @api private
|
||||
*/
|
||||
function coerce(val) {
|
||||
if (val instanceof Error) {
|
||||
return val.stack || val.message;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* XXX DO NOT USE. This is a temporary stub function.
|
||||
* XXX It WILL be removed in the next major release.
|
||||
*/
|
||||
function destroy() {
|
||||
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
||||
}
|
||||
|
||||
createDebug.enable(createDebug.load());
|
||||
|
||||
return createDebug;
|
||||
}
|
||||
|
||||
module.exports = setup;
|
10
uniapp04/node_modules/debug/src/index.js
generated
vendored
Normal file
10
uniapp04/node_modules/debug/src/index.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Detect Electron renderer / nwjs process, which is node, but we should
|
||||
* treat as a browser.
|
||||
*/
|
||||
|
||||
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
||||
module.exports = require('./browser.js');
|
||||
} else {
|
||||
module.exports = require('./node.js');
|
||||
}
|
263
uniapp04/node_modules/debug/src/node.js
generated
vendored
Normal file
263
uniapp04/node_modules/debug/src/node.js
generated
vendored
Normal file
|
@ -0,0 +1,263 @@
|
|||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
const tty = require('tty');
|
||||
const util = require('util');
|
||||
|
||||
/**
|
||||
* This is the Node.js implementation of `debug()`.
|
||||
*/
|
||||
|
||||
exports.init = init;
|
||||
exports.log = log;
|
||||
exports.formatArgs = formatArgs;
|
||||
exports.save = save;
|
||||
exports.load = load;
|
||||
exports.useColors = useColors;
|
||||
exports.destroy = util.deprecate(
|
||||
() => {},
|
||||
'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
|
||||
);
|
||||
|
||||
/**
|
||||
* Colors.
|
||||
*/
|
||||
|
||||
exports.colors = [6, 2, 3, 4, 5, 1];
|
||||
|
||||
try {
|
||||
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
const supportsColor = require('supports-color');
|
||||
|
||||
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
||||
exports.colors = [
|
||||
20,
|
||||
21,
|
||||
26,
|
||||
27,
|
||||
32,
|
||||
33,
|
||||
38,
|
||||
39,
|
||||
40,
|
||||
41,
|
||||
42,
|
||||
43,
|
||||
44,
|
||||
45,
|
||||
56,
|
||||
57,
|
||||
62,
|
||||
63,
|
||||
68,
|
||||
69,
|
||||
74,
|
||||
75,
|
||||
76,
|
||||
77,
|
||||
78,
|
||||
79,
|
||||
80,
|
||||
81,
|
||||
92,
|
||||
93,
|
||||
98,
|
||||
99,
|
||||
112,
|
||||
113,
|
||||
128,
|
||||
129,
|
||||
134,
|
||||
135,
|
||||
148,
|
||||
149,
|
||||
160,
|
||||
161,
|
||||
162,
|
||||
163,
|
||||
164,
|
||||
165,
|
||||
166,
|
||||
167,
|
||||
168,
|
||||
169,
|
||||
170,
|
||||
171,
|
||||
172,
|
||||
173,
|
||||
178,
|
||||
179,
|
||||
184,
|
||||
185,
|
||||
196,
|
||||
197,
|
||||
198,
|
||||
199,
|
||||
200,
|
||||
201,
|
||||
202,
|
||||
203,
|
||||
204,
|
||||
205,
|
||||
206,
|
||||
207,
|
||||
208,
|
||||
209,
|
||||
214,
|
||||
215,
|
||||
220,
|
||||
221
|
||||
];
|
||||
}
|
||||
} catch (error) {
|
||||
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
||||
}
|
||||
|
||||
/**
|
||||
* Build up the default `inspectOpts` object from the environment variables.
|
||||
*
|
||||
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
||||
*/
|
||||
|
||||
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
||||
return /^debug_/i.test(key);
|
||||
}).reduce((obj, key) => {
|
||||
// Camel-case
|
||||
const prop = key
|
||||
.substring(6)
|
||||
.toLowerCase()
|
||||
.replace(/_([a-z])/g, (_, k) => {
|
||||
return k.toUpperCase();
|
||||
});
|
||||
|
||||
// Coerce string value into JS value
|
||||
let val = process.env[key];
|
||||
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
||||
val = true;
|
||||
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
||||
val = false;
|
||||
} else if (val === 'null') {
|
||||
val = null;
|
||||
} else {
|
||||
val = Number(val);
|
||||
}
|
||||
|
||||
obj[prop] = val;
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
/**
|
||||
* Is stdout a TTY? Colored output is enabled when `true`.
|
||||
*/
|
||||
|
||||
function useColors() {
|
||||
return 'colors' in exports.inspectOpts ?
|
||||
Boolean(exports.inspectOpts.colors) :
|
||||
tty.isatty(process.stderr.fd);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds ANSI color escape codes if enabled.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function formatArgs(args) {
|
||||
const {namespace: name, useColors} = this;
|
||||
|
||||
if (useColors) {
|
||||
const c = this.color;
|
||||
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
||||
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
||||
|
||||
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
||||
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
||||
} else {
|
||||
args[0] = getDate() + name + ' ' + args[0];
|
||||
}
|
||||
}
|
||||
|
||||
function getDate() {
|
||||
if (exports.inspectOpts.hideDate) {
|
||||
return '';
|
||||
}
|
||||
return new Date().toISOString() + ' ';
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
|
||||
*/
|
||||
|
||||
function log(...args) {
|
||||
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
|
||||
}
|
||||
|
||||
/**
|
||||
* Save `namespaces`.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api private
|
||||
*/
|
||||
function save(namespaces) {
|
||||
if (namespaces) {
|
||||
process.env.DEBUG = namespaces;
|
||||
} else {
|
||||
// If you set a process.env field to null or undefined, it gets cast to the
|
||||
// string 'null' or 'undefined'. Just delete instead.
|
||||
delete process.env.DEBUG;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load `namespaces`.
|
||||
*
|
||||
* @return {String} returns the previously persisted debug modes
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function load() {
|
||||
return process.env.DEBUG;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init logic for `debug` instances.
|
||||
*
|
||||
* Create a new `inspectOpts` object in case `useColors` is set
|
||||
* differently for a particular `debug` instance.
|
||||
*/
|
||||
|
||||
function init(debug) {
|
||||
debug.inspectOpts = {};
|
||||
|
||||
const keys = Object.keys(exports.inspectOpts);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = require('./common')(exports);
|
||||
|
||||
const {formatters} = module.exports;
|
||||
|
||||
/**
|
||||
* Map %o to `util.inspect()`, all on a single line.
|
||||
*/
|
||||
|
||||
formatters.o = function (v) {
|
||||
this.inspectOpts.colors = this.useColors;
|
||||
return util.inspect(v, this.inspectOpts)
|
||||
.split('\n')
|
||||
.map(str => str.trim())
|
||||
.join(' ');
|
||||
};
|
||||
|
||||
/**
|
||||
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
||||
*/
|
||||
|
||||
formatters.O = function (v) {
|
||||
this.inspectOpts.colors = this.useColors;
|
||||
return util.inspect(v, this.inspectOpts);
|
||||
};
|
22
uniapp04/node_modules/engine.io-client/LICENSE
generated
vendored
Normal file
22
uniapp04/node_modules/engine.io-client/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-present Guillermo Rauch and Socket.IO contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
331
uniapp04/node_modules/engine.io-client/README.md
generated
vendored
Normal file
331
uniapp04/node_modules/engine.io-client/README.md
generated
vendored
Normal file
|
@ -0,0 +1,331 @@
|
|||
|
||||
# Engine.IO client
|
||||
|
||||
[](https://github.com/socketio/engine.io-client/actions)
|
||||
[](http://badge.fury.io/js/engine.io-client)
|
||||
|
||||
This is the client for [Engine.IO](http://github.com/socketio/engine.io),
|
||||
the implementation of transport-based cross-browser/cross-device
|
||||
bi-directional communication layer for [Socket.IO](http://github.com/socketio/socket.io).
|
||||
|
||||
## How to use
|
||||
|
||||
### Standalone
|
||||
|
||||
You can find an `engine.io.js` file in this repository, which is a
|
||||
standalone build you can use as follows:
|
||||
|
||||
```html
|
||||
<script src="/path/to/engine.io.js"></script>
|
||||
<script>
|
||||
// eio = Socket
|
||||
const socket = eio('ws://localhost');
|
||||
socket.on('open', () => {
|
||||
socket.on('message', (data) => {});
|
||||
socket.on('close', () => {});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### With browserify
|
||||
|
||||
Engine.IO is a commonjs module, which means you can include it by using
|
||||
`require` on the browser and package using [browserify](http://browserify.org/):
|
||||
|
||||
1. install the client package
|
||||
|
||||
```bash
|
||||
$ npm install engine.io-client
|
||||
```
|
||||
|
||||
1. write your app code
|
||||
|
||||
```js
|
||||
const { Socket } = require('engine.io-client');
|
||||
const socket = new Socket('ws://localhost');
|
||||
socket.on('open', () => {
|
||||
socket.on('message', (data) => {});
|
||||
socket.on('close', () => {});
|
||||
});
|
||||
```
|
||||
|
||||
1. build your app bundle
|
||||
|
||||
```bash
|
||||
$ browserify app.js > bundle.js
|
||||
```
|
||||
|
||||
1. include on your page
|
||||
|
||||
```html
|
||||
<script src="/path/to/bundle.js"></script>
|
||||
```
|
||||
|
||||
### Sending and receiving binary
|
||||
|
||||
```html
|
||||
<script src="/path/to/engine.io.js"></script>
|
||||
<script>
|
||||
const socket = eio('ws://localhost/');
|
||||
socket.binaryType = 'blob';
|
||||
socket.on('open', () => {
|
||||
socket.send(new Int8Array(5));
|
||||
socket.on('message', (blob) => {});
|
||||
socket.on('close', () => {});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### Node.JS
|
||||
|
||||
Add `engine.io-client` to your `package.json` and then:
|
||||
|
||||
```js
|
||||
const { Socket } = require('engine.io-client');
|
||||
const socket = new Socket('ws://localhost');
|
||||
socket.on('open', () => {
|
||||
socket.on('message', (data) => {});
|
||||
socket.on('close', () => {});
|
||||
});
|
||||
```
|
||||
|
||||
### Node.js with certificates
|
||||
```js
|
||||
const opts = {
|
||||
key: fs.readFileSync('test/fixtures/client.key'),
|
||||
cert: fs.readFileSync('test/fixtures/client.crt'),
|
||||
ca: fs.readFileSync('test/fixtures/ca.crt')
|
||||
};
|
||||
|
||||
const { Socket } = require('engine.io-client');
|
||||
const socket = new Socket('ws://localhost', opts);
|
||||
socket.on('open', () => {
|
||||
socket.on('message', (data) => {});
|
||||
socket.on('close', () => {});
|
||||
});
|
||||
```
|
||||
|
||||
### Node.js with extraHeaders
|
||||
```js
|
||||
const opts = {
|
||||
extraHeaders: {
|
||||
'X-Custom-Header-For-My-Project': 'my-secret-access-token',
|
||||
'Cookie': 'user_session=NI2JlCKF90aE0sJZD9ZzujtdsUqNYSBYxzlTsvdSUe35ZzdtVRGqYFr0kdGxbfc5gUOkR9RGp20GVKza; path=/; expires=Tue, 07-Apr-2015 18:18:08 GMT; secure; HttpOnly'
|
||||
}
|
||||
};
|
||||
|
||||
const { Socket } = require('engine.io-client');
|
||||
const socket = new Socket('ws://localhost', opts);
|
||||
socket.on('open', () => {
|
||||
socket.on('message', (data) => {});
|
||||
socket.on('close', () => {});
|
||||
});
|
||||
```
|
||||
|
||||
In the browser, the [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object does not support additional headers.
|
||||
In case you want to add some headers as part of some authentication mechanism, you can use the `transportOptions` attribute.
|
||||
Please note that in this case the headers won't be sent in the WebSocket upgrade request.
|
||||
|
||||
```js
|
||||
// WILL NOT WORK in the browser
|
||||
const socket = new Socket('http://localhost', {
|
||||
extraHeaders: {
|
||||
'X-Custom-Header-For-My-Project': 'will not be sent'
|
||||
}
|
||||
});
|
||||
// WILL NOT WORK
|
||||
const socket = new Socket('http://localhost', {
|
||||
transports: ['websocket'], // polling is disabled
|
||||
transportOptions: {
|
||||
polling: {
|
||||
extraHeaders: {
|
||||
'X-Custom-Header-For-My-Project': 'will not be sent'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// WILL WORK
|
||||
const socket = new Socket('http://localhost', {
|
||||
transports: ['polling', 'websocket'],
|
||||
transportOptions: {
|
||||
polling: {
|
||||
extraHeaders: {
|
||||
'X-Custom-Header-For-My-Project': 'will be used'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Lightweight
|
||||
- Runs on browser and node.js seamlessly
|
||||
- Transports are independent of `Engine`
|
||||
- Easy to debug
|
||||
- Easy to unit test
|
||||
- Runs inside HTML5 WebWorker
|
||||
- Can send and receive binary data
|
||||
- Receives as ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer
|
||||
in Node
|
||||
- When XHR2 or WebSockets are used, binary is emitted directly. Otherwise
|
||||
binary is encoded into base64 strings, and decoded when binary types are
|
||||
supported.
|
||||
- With browsers that don't support ArrayBuffer, an object { base64: true,
|
||||
data: dataAsBase64String } is emitted on the `message` event.
|
||||
|
||||
## API
|
||||
|
||||
### Socket
|
||||
|
||||
The client class. Mixes in [Emitter](http://github.com/component/emitter).
|
||||
Exposed as `eio` in the browser standalone build.
|
||||
|
||||
#### Properties
|
||||
|
||||
- `protocol` _(Number)_: protocol revision number
|
||||
- `binaryType` _(String)_ : can be set to 'arraybuffer' or 'blob' in browsers,
|
||||
and `buffer` or `arraybuffer` in Node. Blob is only used in browser if it's
|
||||
supported.
|
||||
|
||||
#### Events
|
||||
|
||||
- `open`
|
||||
- Fired upon successful connection.
|
||||
- `message`
|
||||
- Fired when data is received from the server.
|
||||
- **Arguments**
|
||||
- `String` | `ArrayBuffer`: utf-8 encoded data or ArrayBuffer containing
|
||||
binary data
|
||||
- `close`
|
||||
- Fired upon disconnection. In compliance with the WebSocket API spec, this event may be
|
||||
fired even if the `open` event does not occur (i.e. due to connection error or `close()`).
|
||||
- `error`
|
||||
- Fired when an error occurs.
|
||||
- `flush`
|
||||
- Fired upon completing a buffer flush
|
||||
- `drain`
|
||||
- Fired after `drain` event of transport if writeBuffer is empty
|
||||
- `upgradeError`
|
||||
- Fired if an error occurs with a transport we're trying to upgrade to.
|
||||
- `upgrade`
|
||||
- Fired upon upgrade success, after the new transport is set
|
||||
- `ping`
|
||||
- Fired upon receiving a ping packet.
|
||||
- `pong`
|
||||
- Fired upon _flushing_ a pong packet (ie: actual packet write out)
|
||||
|
||||
#### Methods
|
||||
|
||||
- **constructor**
|
||||
- Initializes the client
|
||||
- **Parameters**
|
||||
- `String` uri
|
||||
- `Object`: optional, options object
|
||||
- **Options**
|
||||
- `agent` (`http.Agent`): `http.Agent` to use, defaults to `false` (NodeJS only)
|
||||
- `upgrade` (`Boolean`): defaults to true, whether the client should try
|
||||
to upgrade the transport from long-polling to something better.
|
||||
- `forceBase64` (`Boolean`): forces base 64 encoding for polling transport even when XHR2 responseType is available and WebSocket even if the used standard supports binary.
|
||||
- `withCredentials` (`Boolean`): defaults to `false`, whether to include credentials (cookies, authorization headers, TLS client certificates, etc.) with cross-origin XHR polling requests.
|
||||
- `timestampRequests` (`Boolean`): whether to add the timestamp with each
|
||||
transport request. Note: polling requests are always stamped unless this
|
||||
option is explicitly set to `false` (`false`)
|
||||
- `timestampParam` (`String`): timestamp parameter (`t`)
|
||||
- `path` (`String`): path to connect to, default is `/engine.io`
|
||||
- `transports` (`Array`): a list of transports to try (in order).
|
||||
Defaults to `['polling', 'websocket', 'webtransport']`. `Engine`
|
||||
always attempts to connect directly with the first one, provided the
|
||||
feature detection test for it passes.
|
||||
- `transportOptions` (`Object`): hash of options, indexed by transport name, overriding the common options for the given transport
|
||||
- `rememberUpgrade` (`Boolean`): defaults to false.
|
||||
If true and if the previous websocket connection to the server succeeded,
|
||||
the connection attempt will bypass the normal upgrade process and will initially
|
||||
try websocket. A connection attempt following a transport error will use the
|
||||
normal upgrade process. It is recommended you turn this on only when using
|
||||
SSL/TLS connections, or if you know that your network does not block websockets.
|
||||
- `pfx` (`String`|`Buffer`): Certificate, Private key and CA certificates to use for SSL. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `key` (`String`): Private key to use for SSL. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `passphrase` (`String`): A string of passphrase for the private key or pfx. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `cert` (`String`): Public x509 certificate to use. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `ca` (`String`|`Array`): An authority certificate or array of authority certificates to check the remote host against.. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `ciphers` (`String`): A string describing the ciphers to use or exclude. Consult the [cipher format list](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT) for details on the format. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `rejectUnauthorized` (`Boolean`): If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `perMessageDeflate` (`Object|Boolean`): parameters of the WebSocket permessage-deflate extension
|
||||
(see [ws module](https://github.com/einaros/ws) api docs). Set to `false` to disable. (`true`)
|
||||
- `threshold` (`Number`): data is compressed only if the byte size is above this value. This option is ignored on the browser. (`1024`)
|
||||
- `extraHeaders` (`Object`): Headers that will be passed for each request to the server (via xhr-polling and via websockets). These values then can be used during handshake or for special proxies. Can only be used in Node.js client environment.
|
||||
- `localAddress` (`String`): the local IP address to connect to
|
||||
- `autoUnref` (`Boolean`): whether the transport should be `unref`'d upon creation. This calls `unref` on the underlying timers and sockets so that the program is allowed to exit if they are the only timers/sockets in the event system (Node.js only)
|
||||
- `useNativeTimers` (`Boolean`): Whether to always use the native timeouts. This allows the client to reconnect when the native timeout functions are overridden, such as when mock clocks are installed with [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers).
|
||||
- **Polling-only options**
|
||||
- `requestTimeout` (`Number`): Timeout for xhr-polling requests in milliseconds (`0`)
|
||||
- **Websocket-only options**
|
||||
- `protocols` (`Array`): a list of subprotocols (see [MDN reference](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Subprotocols))
|
||||
- `closeOnBeforeunload` (`Boolean`): whether to silently close the connection when the [`beforeunload`](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event) event is emitted in the browser (defaults to `false`)
|
||||
- `send`
|
||||
- Sends a message to the server
|
||||
- **Parameters**
|
||||
- `String` | `ArrayBuffer` | `ArrayBufferView` | `Blob`: data to send
|
||||
- `Object`: optional, options object
|
||||
- `Function`: optional, callback upon `drain`
|
||||
- **Options**
|
||||
- `compress` (`Boolean`): whether to compress sending data. This option is ignored and forced to be `true` on the browser. (`true`)
|
||||
- `close`
|
||||
- Disconnects the client.
|
||||
|
||||
### Transport
|
||||
|
||||
The transport class. Private. _Inherits from EventEmitter_.
|
||||
|
||||
#### Events
|
||||
|
||||
- `poll`: emitted by polling transports upon starting a new request
|
||||
- `pollComplete`: emitted by polling transports upon completing a request
|
||||
- `drain`: emitted by polling transports upon a buffer drain
|
||||
|
||||
## Tests
|
||||
|
||||
`engine.io-client` is used to test
|
||||
[engine](http://github.com/socketio/engine.io). Running the `engine.io`
|
||||
test suite ensures the client works and vice-versa.
|
||||
|
||||
Browser tests are run using [zuul](https://github.com/defunctzombie/zuul). You can
|
||||
run the tests locally using the following command.
|
||||
|
||||
```
|
||||
./node_modules/.bin/zuul --local 8080 -- test/index.js
|
||||
```
|
||||
|
||||
Additionally, `engine.io-client` has a standalone test suite you can run
|
||||
with `make test` which will run node.js and browser tests. You must have zuul setup with
|
||||
a saucelabs account.
|
||||
|
||||
## Support
|
||||
|
||||
The support channels for `engine.io-client` are the same as `socket.io`:
|
||||
- irc.freenode.net **#socket.io**
|
||||
- [Google Groups](http://groups.google.com/group/socket_io)
|
||||
- [Website](http://socket.io)
|
||||
|
||||
## Development
|
||||
|
||||
To contribute patches, run tests or benchmarks, make sure to clone the
|
||||
repository:
|
||||
|
||||
```bash
|
||||
git clone git://github.com/socketio/engine.io-client.git
|
||||
```
|
||||
|
||||
Then:
|
||||
|
||||
```bash
|
||||
cd engine.io-client
|
||||
npm install
|
||||
```
|
||||
|
||||
See the `Tests` section above for how to run tests before submitting any patches.
|
||||
|
||||
## License
|
||||
|
||||
MIT - Copyright (c) 2014 Automattic, Inc.
|
3
uniapp04/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts
generated
vendored
Normal file
3
uniapp04/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Socket } from "./socket.js";
|
||||
declare const _default: (uri: any, opts: any) => Socket;
|
||||
export default _default;
|
4
uniapp04/node_modules/engine.io-client/build/cjs/browser-entrypoint.js
generated
vendored
Normal file
4
uniapp04/node_modules/engine.io-client/build/cjs/browser-entrypoint.js
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const socket_js_1 = require("./socket.js");
|
||||
exports.default = (uri, opts) => new socket_js_1.Socket(uri, opts);
|
1
uniapp04/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts
generated
vendored
Normal file
1
uniapp04/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare const hasCORS: boolean;
|
14
uniapp04/node_modules/engine.io-client/build/cjs/contrib/has-cors.js
generated
vendored
Normal file
14
uniapp04/node_modules/engine.io-client/build/cjs/contrib/has-cors.js
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hasCORS = void 0;
|
||||
// imported from https://github.com/component/has-cors
|
||||
let value = false;
|
||||
try {
|
||||
value = typeof XMLHttpRequest !== 'undefined' &&
|
||||
'withCredentials' in new XMLHttpRequest();
|
||||
}
|
||||
catch (err) {
|
||||
// if XMLHttp support is disabled in IE then it will throw
|
||||
// when trying to create
|
||||
}
|
||||
exports.hasCORS = value;
|
15
uniapp04/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts
generated
vendored
Normal file
15
uniapp04/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* Compiles a querystring
|
||||
* Returns string representation of the object
|
||||
*
|
||||
* @param {Object}
|
||||
* @api private
|
||||
*/
|
||||
export declare function encode(obj: any): string;
|
||||
/**
|
||||
* Parses a simple querystring into an object
|
||||
*
|
||||
* @param {String} qs
|
||||
* @api private
|
||||
*/
|
||||
export declare function decode(qs: any): {};
|
38
uniapp04/node_modules/engine.io-client/build/cjs/contrib/parseqs.js
generated
vendored
Normal file
38
uniapp04/node_modules/engine.io-client/build/cjs/contrib/parseqs.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
"use strict";
|
||||
// imported from https://github.com/galkn/querystring
|
||||
/**
|
||||
* Compiles a querystring
|
||||
* Returns string representation of the object
|
||||
*
|
||||
* @param {Object}
|
||||
* @api private
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.encode = encode;
|
||||
exports.decode = decode;
|
||||
function encode(obj) {
|
||||
let str = '';
|
||||
for (let i in obj) {
|
||||
if (obj.hasOwnProperty(i)) {
|
||||
if (str.length)
|
||||
str += '&';
|
||||
str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
/**
|
||||
* Parses a simple querystring into an object
|
||||
*
|
||||
* @param {String} qs
|
||||
* @api private
|
||||
*/
|
||||
function decode(qs) {
|
||||
let qry = {};
|
||||
let pairs = qs.split('&');
|
||||
for (let i = 0, l = pairs.length; i < l; i++) {
|
||||
let pair = pairs[i].split('=');
|
||||
qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
|
||||
}
|
||||
return qry;
|
||||
}
|
1
uniapp04/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts
generated
vendored
Normal file
1
uniapp04/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare function parse(str: string): any;
|
67
uniapp04/node_modules/engine.io-client/build/cjs/contrib/parseuri.js
generated
vendored
Normal file
67
uniapp04/node_modules/engine.io-client/build/cjs/contrib/parseuri.js
generated
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.parse = parse;
|
||||
// imported from https://github.com/galkn/parseuri
|
||||
/**
|
||||
* Parses a URI
|
||||
*
|
||||
* Note: we could also have used the built-in URL object, but it isn't supported on all platforms.
|
||||
*
|
||||
* See:
|
||||
* - https://developer.mozilla.org/en-US/docs/Web/API/URL
|
||||
* - https://caniuse.com/url
|
||||
* - https://www.rfc-editor.org/rfc/rfc3986#appendix-B
|
||||
*
|
||||
* History of the parse() method:
|
||||
* - first commit: https://github.com/socketio/socket.io-client/commit/4ee1d5d94b3906a9c052b459f1a818b15f38f91c
|
||||
* - export into its own module: https://github.com/socketio/engine.io-client/commit/de2c561e4564efeb78f1bdb1ba39ef81b2822cb3
|
||||
* - reimport: https://github.com/socketio/engine.io-client/commit/df32277c3f6d622eec5ed09f493cae3f3391d242
|
||||
*
|
||||
* @author Steven Levithan <stevenlevithan.com> (MIT license)
|
||||
* @api private
|
||||
*/
|
||||
const re = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
|
||||
const parts = [
|
||||
'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'
|
||||
];
|
||||
function parse(str) {
|
||||
if (str.length > 8000) {
|
||||
throw "URI too long";
|
||||
}
|
||||
const src = str, b = str.indexOf('['), e = str.indexOf(']');
|
||||
if (b != -1 && e != -1) {
|
||||
str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);
|
||||
}
|
||||
let m = re.exec(str || ''), uri = {}, i = 14;
|
||||
while (i--) {
|
||||
uri[parts[i]] = m[i] || '';
|
||||
}
|
||||
if (b != -1 && e != -1) {
|
||||
uri.source = src;
|
||||
uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');
|
||||
uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');
|
||||
uri.ipv6uri = true;
|
||||
}
|
||||
uri.pathNames = pathNames(uri, uri['path']);
|
||||
uri.queryKey = queryKey(uri, uri['query']);
|
||||
return uri;
|
||||
}
|
||||
function pathNames(obj, path) {
|
||||
const regx = /\/{2,9}/g, names = path.replace(regx, "/").split("/");
|
||||
if (path.slice(0, 1) == '/' || path.length === 0) {
|
||||
names.splice(0, 1);
|
||||
}
|
||||
if (path.slice(-1) == '/') {
|
||||
names.splice(names.length - 1, 1);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
function queryKey(uri, query) {
|
||||
const data = {};
|
||||
query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) {
|
||||
if ($1) {
|
||||
data[$1] = $2;
|
||||
}
|
||||
});
|
||||
return data;
|
||||
}
|
4
uniapp04/node_modules/engine.io-client/build/cjs/globals.d.ts
generated
vendored
Normal file
4
uniapp04/node_modules/engine.io-client/build/cjs/globals.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
export declare const nextTick: (cb: any, setTimeoutFn: any) => any;
|
||||
export declare const globalThisShim: any;
|
||||
export declare const defaultBinaryType = "arraybuffer";
|
||||
export declare function createCookieJar(): void;
|
26
uniapp04/node_modules/engine.io-client/build/cjs/globals.js
generated
vendored
Normal file
26
uniapp04/node_modules/engine.io-client/build/cjs/globals.js
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.defaultBinaryType = exports.globalThisShim = exports.nextTick = void 0;
|
||||
exports.createCookieJar = createCookieJar;
|
||||
exports.nextTick = (() => {
|
||||
const isPromiseAvailable = typeof Promise === "function" && typeof Promise.resolve === "function";
|
||||
if (isPromiseAvailable) {
|
||||
return (cb) => Promise.resolve().then(cb);
|
||||
}
|
||||
else {
|
||||
return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);
|
||||
}
|
||||
})();
|
||||
exports.globalThisShim = (() => {
|
||||
if (typeof self !== "undefined") {
|
||||
return self;
|
||||
}
|
||||
else if (typeof window !== "undefined") {
|
||||
return window;
|
||||
}
|
||||
else {
|
||||
return Function("return this")();
|
||||
}
|
||||
})();
|
||||
exports.defaultBinaryType = "arraybuffer";
|
||||
function createCookieJar() { }
|
21
uniapp04/node_modules/engine.io-client/build/cjs/globals.node.d.ts
generated
vendored
Normal file
21
uniapp04/node_modules/engine.io-client/build/cjs/globals.node.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
export declare const nextTick: (callback: Function, ...args: any[]) => void;
|
||||
export declare const globalThisShim: typeof globalThis;
|
||||
export declare const defaultBinaryType = "nodebuffer";
|
||||
export declare function createCookieJar(): CookieJar;
|
||||
interface Cookie {
|
||||
name: string;
|
||||
value: string;
|
||||
expires?: Date;
|
||||
}
|
||||
/**
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie
|
||||
*/
|
||||
export declare function parse(setCookieString: string): Cookie;
|
||||
export declare class CookieJar {
|
||||
private _cookies;
|
||||
parseCookies(values: string[]): void;
|
||||
get cookies(): IterableIterator<[string, Cookie]>;
|
||||
addCookies(xhr: any): void;
|
||||
appendCookies(headers: Headers): void;
|
||||
}
|
||||
export {};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user