@hyext/builder-revues 1.5.9-alpha.0 → 1.5.10-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/index.js +43 -2
  2. package/package.json +6 -5
  3. package/static/.DS_Store +0 -0
  4. package/static/projects/.DS_Store +0 -0
  5. package/static/projects/empty/.eslintrc.js +31 -0
  6. package/static/projects/empty/app.js +2 -0
  7. package/static/projects/empty/app.json +11 -0
  8. package/static/projects/empty/app.wxss +10 -0
  9. package/static/projects/empty/components/navigation-bar/navigation-bar.js +105 -0
  10. package/static/projects/empty/components/navigation-bar/navigation-bar.json +5 -0
  11. package/static/projects/empty/components/navigation-bar/navigation-bar.wxml +64 -0
  12. package/static/projects/empty/components/navigation-bar/navigation-bar.wxss +96 -0
  13. package/static/projects/empty/pages/index/index.js +2 -0
  14. package/static/projects/empty/pages/index/index.json +5 -0
  15. package/static/projects/empty/pages/index/index.wxml +7 -0
  16. package/static/projects/empty/pages/index/index.wxss +10 -0
  17. package/static/projects/empty/project.config.json +25 -0
  18. package/static/projects/empty/sitemap.json +7 -0
  19. package/static/projects/ts/.DS_Store +0 -0
  20. package/static/projects/ts/.eslintrc.js +31 -0
  21. package/static/projects/ts/app.json +11 -0
  22. package/static/projects/ts/app.ts +8 -0
  23. package/static/projects/ts/app.wxss +10 -0
  24. package/static/projects/ts/components/navigation-bar/navigation-bar.js +105 -0
  25. package/static/projects/ts/components/navigation-bar/navigation-bar.json +5 -0
  26. package/static/projects/ts/components/navigation-bar/navigation-bar.wxml +64 -0
  27. package/static/projects/ts/components/navigation-bar/navigation-bar.wxss +96 -0
  28. package/static/projects/ts/pages/index/index.json +5 -0
  29. package/static/projects/ts/pages/index/index.ts +2 -0
  30. package/static/projects/ts/pages/index/index.wxml +7 -0
  31. package/static/projects/ts/pages/index/index.wxss +10 -0
  32. package/static/projects/ts/project.config.json +27 -0
  33. package/static/projects/ts/sitemap.json +7 -0
  34. package/static/projects/ts/tsconfig.json +26 -0
  35. package/static/projects/ts/typings/wechat-miniprogram/LICENSE +21 -0
  36. package/static/projects/ts/typings/wechat-miniprogram/README.md +15 -0
  37. package/static/projects/ts/typings/wechat-miniprogram/index.d.ts +143 -0
  38. package/static/projects/ts/typings/wechat-miniprogram/lib.wx.api.d.ts +22112 -0
  39. package/static/projects/ts/typings/wechat-miniprogram/lib.wx.app.d.ts +249 -0
  40. package/static/projects/ts/typings/wechat-miniprogram/lib.wx.behavior.d.ts +47 -0
  41. package/static/projects/ts/typings/wechat-miniprogram/lib.wx.cloud.d.ts +903 -0
  42. package/static/projects/ts/typings/wechat-miniprogram/lib.wx.component.d.ts +613 -0
  43. package/static/projects/ts/typings/wechat-miniprogram/lib.wx.event.d.ts +1413 -0
  44. package/static/projects/ts/typings/wechat-miniprogram/lib.wx.page.d.ts +246 -0
  45. package/static/projects/ts/typings/wechat-miniprogram/package.json +63 -0
  46. package/static/projects/ts/util.ts +3 -0
@@ -0,0 +1,105 @@
1
+ Component({
2
+ options: {
3
+ multipleSlots: true // 在组件定义时的选项中启用多slot支持
4
+ },
5
+ /**
6
+ * 组件的属性列表
7
+ */
8
+ properties: {
9
+ extClass: {
10
+ type: String,
11
+ value: ''
12
+ },
13
+ title: {
14
+ type: String,
15
+ value: ''
16
+ },
17
+ background: {
18
+ type: String,
19
+ value: ''
20
+ },
21
+ color: {
22
+ type: String,
23
+ value: ''
24
+ },
25
+ back: {
26
+ type: Boolean,
27
+ value: true
28
+ },
29
+ loading: {
30
+ type: Boolean,
31
+ value: false
32
+ },
33
+ homeButton: {
34
+ type: Boolean,
35
+ value: false,
36
+ },
37
+ animated: {
38
+ // 显示隐藏的时候opacity动画效果
39
+ type: Boolean,
40
+ value: true
41
+ },
42
+ show: {
43
+ // 显示隐藏导航,隐藏的时候navigation-bar的高度占位还在
44
+ type: Boolean,
45
+ value: true,
46
+ observer: '_showChange'
47
+ },
48
+ // back为true的时候,返回的页面深度
49
+ delta: {
50
+ type: Number,
51
+ value: 1
52
+ },
53
+ },
54
+ /**
55
+ * 组件的初始数据
56
+ */
57
+ data: {
58
+ displayStyle: ''
59
+ },
60
+ lifetimes: {
61
+ attached() {
62
+ const rect = wx.getMenuButtonBoundingClientRect()
63
+ wx.getSystemInfo({
64
+ success: (res) => {
65
+ const isAndroid = res.platform === 'android'
66
+ const isDevtools = res.platform === 'devtools'
67
+ this.setData({
68
+ ios: !isAndroid,
69
+ innerPaddingRight: `padding-right: ${res.windowWidth - rect.left}px`,
70
+ leftWidth: `width: ${res.windowWidth - rect.left }px`,
71
+ safeAreaTop: isDevtools || isAndroid ? `height: calc(var(--height) + ${res.safeArea.top}px); padding-top: ${res.safeArea.top}px` : ``
72
+ })
73
+ }
74
+ })
75
+ },
76
+ },
77
+ /**
78
+ * 组件的方法列表
79
+ */
80
+ methods: {
81
+ _showChange(show) {
82
+ const animated = this.data.animated
83
+ let displayStyle = ''
84
+ if (animated) {
85
+ displayStyle = `opacity: ${
86
+ show ? '1' : '0'
87
+ };transition:opacity 0.5s;`
88
+ } else {
89
+ displayStyle = `display: ${show ? '' : 'none'}`
90
+ }
91
+ this.setData({
92
+ displayStyle
93
+ })
94
+ },
95
+ back() {
96
+ const data = this.data
97
+ if (data.delta) {
98
+ wx.navigateBack({
99
+ delta: data.delta
100
+ })
101
+ }
102
+ this.triggerEvent('back', { delta: data.delta }, {})
103
+ }
104
+ },
105
+ })
@@ -0,0 +1,5 @@
1
+ {
2
+ "component": true,
3
+ "styleIsolation": "apply-shared",
4
+ "usingComponents": {}
5
+ }
@@ -0,0 +1,64 @@
1
+ <view class="weui-navigation-bar {{extClass}}">
2
+ <view class="weui-navigation-bar__inner {{ios ? 'ios' : 'android'}}" style="color: {{color}}; background: {{background}}; {{displayStyle}}; {{innerPaddingRight}}; {{safeAreaTop}};">
3
+
4
+ <!-- 左侧按钮 -->
5
+ <view class='weui-navigation-bar__left' style="{{leftWidth}};">
6
+ <block wx:if="{{back || homeButton}}">
7
+ <!-- 返回上一页 -->
8
+ <block wx:if="{{back}}">
9
+ <view class="weui-navigation-bar__buttons weui-navigation-bar__buttons_goback">
10
+ <view
11
+ bindtap="back"
12
+ class="weui-navigation-bar__btn_goback_wrapper"
13
+ hover-class="weui-active"
14
+ hover-stay-time="100"
15
+ aria-role="button"
16
+ aria-label="返回"
17
+ >
18
+ <view class="weui-navigation-bar__button weui-navigation-bar__btn_goback"></view>
19
+ </view>
20
+ </view>
21
+ </block>
22
+ <!-- 返回首页 -->
23
+ <block wx:if="{{homeButton}}">
24
+ <view class="weui-navigation-bar__buttons weui-navigation-bar__buttons_home">
25
+ <view
26
+ bindtap="home"
27
+ class="weui-navigation-bar__btn_home_wrapper"
28
+ hover-class="weui-active"
29
+ aria-role="button"
30
+ aria-label="首页"
31
+ >
32
+ <view class="weui-navigation-bar__button weui-navigation-bar__btn_home"></view>
33
+ </view>
34
+ </view>
35
+ </block>
36
+ </block>
37
+ <block wx:else>
38
+ <slot name="left"></slot>
39
+ </block>
40
+ </view>
41
+
42
+ <!-- 标题 -->
43
+ <view class='weui-navigation-bar__center'>
44
+ <view wx:if="{{loading}}" class="weui-navigation-bar__loading" aria-role="alert">
45
+ <view
46
+ class="weui-loading"
47
+ aria-role="img"
48
+ aria-label="加载中"
49
+ ></view>
50
+ </view>
51
+ <block wx:if="{{title}}">
52
+ <text>{{title}}</text>
53
+ </block>
54
+ <block wx:else>
55
+ <slot name="center"></slot>
56
+ </block>
57
+ </view>
58
+
59
+ <!-- 右侧留空 -->
60
+ <view class='weui-navigation-bar__right'>
61
+ <slot name="right"></slot>
62
+ </view>
63
+ </view>
64
+ </view>
@@ -0,0 +1,96 @@
1
+ .weui-navigation-bar {
2
+ --weui-FG-0:rgba(0,0,0,.9);
3
+ --height: 44px;
4
+ --left: 16px;
5
+ }
6
+ .weui-navigation-bar .android {
7
+ --height: 48px;
8
+ }
9
+
10
+ .weui-navigation-bar {
11
+ overflow: hidden;
12
+ color: var(--weui-FG-0);
13
+ flex: none;
14
+ }
15
+
16
+ .weui-navigation-bar__inner {
17
+ position: relative;
18
+ top: 0;
19
+ left: 0;
20
+ height: calc(var(--height) + env(safe-area-inset-top));
21
+ display: flex;
22
+ flex-direction: row;
23
+ align-items: center;
24
+ justify-content: center;
25
+ padding-top: env(safe-area-inset-top);
26
+ width: 100%;
27
+ box-sizing: border-box;
28
+ }
29
+
30
+ .weui-navigation-bar__left {
31
+ position: relative;
32
+ padding-left: var(--left);
33
+ display: flex;
34
+ flex-direction: row;
35
+ align-items: flex-start;
36
+ height: 100%;
37
+ box-sizing: border-box;
38
+ }
39
+
40
+ .weui-navigation-bar__btn_goback_wrapper {
41
+ padding: 11px 18px 11px 16px;
42
+ margin: -11px -18px -11px -16px;
43
+ }
44
+
45
+ .weui-navigation-bar__btn_goback_wrapper.weui-active {
46
+ opacity: 0.5;
47
+ }
48
+
49
+ .weui-navigation-bar__btn_goback {
50
+ font-size: 12px;
51
+ width: 12px;
52
+ height: 24px;
53
+ -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;
54
+ mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E") no-repeat 50% 50%;
55
+ -webkit-mask-size: cover;
56
+ mask-size: cover;
57
+ background-color: var(--weui-FG-0);
58
+ }
59
+
60
+ .weui-navigation-bar__center {
61
+ font-size: 17px;
62
+ text-align: center;
63
+ position: relative;
64
+ display: flex;
65
+ flex-direction: row;
66
+ align-items: center;
67
+ justify-content: center;
68
+ font-weight: bold;
69
+ flex: 1;
70
+ height: 100%;
71
+ }
72
+
73
+ .weui-navigation-bar__loading {
74
+ margin-right: 4px;
75
+ align-items: center;
76
+ }
77
+
78
+ .weui-loading {
79
+ font-size: 16px;
80
+ width: 16px;
81
+ height: 16px;
82
+ display: block;
83
+ background: transparent url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='80px' height='80px' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23606060' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23606060' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23606060' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A") no-repeat;
84
+ background-size: 100%;
85
+ margin-left: 0;
86
+ animation: loading linear infinite 1s;
87
+ }
88
+
89
+ @keyframes loading {
90
+ from {
91
+ transform: rotate(0);
92
+ }
93
+ to {
94
+ transform: rotate(360deg);
95
+ }
96
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "usingComponents": {
3
+ "navigation-bar": "/components/navigation-bar/navigation-bar"
4
+ }
5
+ }
@@ -0,0 +1,2 @@
1
+ // index.js
2
+ Page({})
@@ -0,0 +1,7 @@
1
+ <!--index.wxml-->
2
+ <navigation-bar title="Weixin" back="{{false}}" color="black" background="#FFF"></navigation-bar>
3
+ <scroll-view class="scrollarea" scroll-y type="list">
4
+ <view class="container">
5
+ Weixin
6
+ </view>
7
+ </scroll-view>
@@ -0,0 +1,10 @@
1
+ /**index.wxss**/
2
+ page {
3
+ height: 100vh;
4
+ display: flex;
5
+ flex-direction: column;
6
+ }
7
+ .scrollarea {
8
+ flex: 1;
9
+ overflow-y: hidden;
10
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "appid": "touris",
3
+ "compileType": "miniprogram",
4
+ "packOptions": {
5
+ "ignore": [],
6
+ "include": []
7
+ },
8
+ "builder": {
9
+ "name": "@hyext/builder-revues",
10
+ "config": {
11
+ "https": true,
12
+ "port": 18080,
13
+ "host": "localhost",
14
+ "supportExtTypes": [
15
+ "app_panel_h5",
16
+ "web_video_com",
17
+ "pc_panel"
18
+ ]
19
+ }
20
+ },
21
+ "setting": {
22
+ "useCompilerPlugins": [
23
+ "typescript"
24
+ ]
25
+ },
26
+ "condition": {}
27
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
3
+ "rules": [{
4
+ "action": "allow",
5
+ "page": "*"
6
+ }]
7
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "rootDir": ".",
4
+ "outDir": "dist",
5
+ "moduleResolution": "node",
6
+ "target": "esnext",
7
+ "module": "ES2015",
8
+ "lib": ["es6"],
9
+ "esModuleInterop": true,
10
+ "strictPropertyInitialization": false,
11
+ "strict": true,
12
+ "preserveSymlinks": true,
13
+ "declaration": true,
14
+ "allowSyntheticDefaultImports": true,
15
+ "experimentalDecorators": true,
16
+ "emitDecoratorMetadata": false,
17
+ "typeRoots": ["node_modules/@types", "typings"],
18
+ "resolveJsonModule": true,
19
+ "allowJs": true,
20
+ "noImplicitAny": true,
21
+ "isolatedModules": true,
22
+ "noEmit": true
23
+ },
24
+ "include": ["src/**/*.ts", "src/**/*.tsx", "node_modules/@hyext/ext-sdk-hy/types.d.ts"],
25
+ "exclude": ["release/"]
26
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
@@ -0,0 +1,15 @@
1
+ # Installation
2
+ > `npm install --save @types/wechat-miniprogram`
3
+
4
+ # Summary
5
+ This package contains type definitions for wechat-miniprogram (https://developers.weixin.qq.com/miniprogram/dev/api/).
6
+
7
+ # Details
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wechat-miniprogram.
9
+
10
+ ### Additional Details
11
+ * Last updated: Mon, 20 Nov 2023 23:36:24 GMT
12
+ * Dependencies: none
13
+
14
+ # Credits
15
+ These definitions were written by [Wechat Miniprogram](https://github.com/wechat-miniprogram), [SgLy](https://github.com/SgLy), and [TtTRz](https://github.com/TtTRz).
@@ -0,0 +1,143 @@
1
+ /// <reference path="./lib.wx.app.d.ts" />
2
+ /// <reference path="./lib.wx.page.d.ts" />
3
+ /// <reference path="./lib.wx.api.d.ts" />
4
+ /// <reference path="./lib.wx.cloud.d.ts" />
5
+ /// <reference path="./lib.wx.component.d.ts" />
6
+ /// <reference path="./lib.wx.behavior.d.ts" />
7
+ /// <reference path="./lib.wx.event.d.ts" />
8
+
9
+ declare namespace WechatMiniprogram {
10
+ type IAnyObject = Record<string, any>;
11
+ type Optional<F> = F extends (arg: infer P) => infer R ? (arg?: P) => R : F;
12
+ type OptionalInterface<T> = { [K in keyof T]: Optional<T[K]> };
13
+ interface AsyncMethodOptionLike {
14
+ success?: ((...args: any[]) => void) | undefined;
15
+ }
16
+ type PromisifySuccessResult<
17
+ P,
18
+ T extends AsyncMethodOptionLike,
19
+ > = P extends { success: any } ? void
20
+ : P extends { fail: any } ? void
21
+ : P extends { complete: any } ? void
22
+ : Promise<Parameters<Exclude<T["success"], undefined>>[0]>;
23
+ interface Console {
24
+ /** [console.debug()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.debug.html)
25
+ *
26
+ * 向调试面板中打印 debug 日志 */
27
+ debug(
28
+ /** 日志内容,可以有任意多个。 */
29
+ ...args: any[]
30
+ ): void;
31
+ /** [console.error()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.error.html)
32
+ *
33
+ * 向调试面板中打印 error 日志 */
34
+ error(
35
+ /** 日志内容,可以有任意多个。 */
36
+ ...args: any[]
37
+ ): void;
38
+ /** [console.group(string label)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.group.html)
39
+ *
40
+ * 在调试面板中创建一个新的分组。随后输出的内容都会被添加一个缩进,表示该内容属于当前分组。调用 [console.groupEnd](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.groupEnd.html)之后分组结束。
41
+ *
42
+ * **注意**
43
+ *
44
+ * 仅在工具中有效,在 vConsole 中为空函数实现。 */
45
+ group(
46
+ /** 分组标记,可选。 */
47
+ label?: string,
48
+ ): void;
49
+ /** [console.groupEnd()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.groupEnd.html)
50
+ *
51
+ * 结束由 [console.group](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.group.html) 创建的分组
52
+ *
53
+ * **注意**
54
+ *
55
+ * 仅在工具中有效,在 vConsole 中为空函数实现。 */
56
+ groupEnd(): void;
57
+ /** [console.info()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.info.html)
58
+ *
59
+ * 向调试面板中打印 info 日志 */
60
+ info(
61
+ /** 日志内容,可以有任意多个。 */
62
+ ...args: any[]
63
+ ): void;
64
+ /** [console.log()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.log.html)
65
+ *
66
+ * 向调试面板中打印 log 日志 */
67
+ log(
68
+ /** 日志内容,可以有任意多个。 */
69
+ ...args: any[]
70
+ ): void;
71
+ /** [console.warn()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.warn.html)
72
+ *
73
+ * 向调试面板中打印 warn 日志 */
74
+ warn(
75
+ /** 日志内容,可以有任意多个。 */
76
+ ...args: any[]
77
+ ): void;
78
+ }
79
+ }
80
+
81
+ declare let console: WechatMiniprogram.Console;
82
+
83
+ declare let wx: WechatMiniprogram.Wx;
84
+ /** 引入模块。返回模块通过 `module.exports` 或 `exports` 暴露的接口。 */
85
+ declare function require(
86
+ /** 需要引入模块文件相对于当前文件的相对路径,或 npm 模块名,或 npm 模块路径。不支持绝对路径 */
87
+ module: string,
88
+ ): any;
89
+ /** 引入插件。返回插件通过 `main` 暴露的接口。 */
90
+ declare function requirePlugin(
91
+ /** 需要引入的插件的 alias */
92
+ module: string,
93
+ ): any;
94
+ /** 插件引入当前使用者小程序。返回使用者小程序通过 [插件配置中 `export` 暴露的接口](https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/using.html#%E5%AF%BC%E5%87%BA%E5%88%B0%E6%8F%92%E4%BB%B6)。
95
+ *
96
+ * 该接口只在插件中存在
97
+ *
98
+ * 最低基础库: `2.11.1` */
99
+ declare function requireMiniProgram(): any;
100
+ /** 当前模块对象 */
101
+ declare let module: {
102
+ /** 模块向外暴露的对象,使用 `require` 引用该模块时可以获取 */
103
+ exports: any;
104
+ };
105
+ /** `module.exports` 的引用 */
106
+ declare let exports: any;
107
+
108
+ /** [clearInterval(number intervalID)](https://developers.weixin.qq.com/miniprogram/dev/api/base/timer/clearInterval.html)
109
+ *
110
+ * 取消由 setInterval 设置的定时器。 */
111
+ declare function clearInterval(
112
+ /** 要取消的定时器的 ID */
113
+ intervalID: number,
114
+ ): void;
115
+ /** [clearTimeout(number timeoutID)](https://developers.weixin.qq.com/miniprogram/dev/api/base/timer/clearTimeout.html)
116
+ *
117
+ * 取消由 setTimeout 设置的定时器。 */
118
+ declare function clearTimeout(
119
+ /** 要取消的定时器的 ID */
120
+ timeoutID: number,
121
+ ): void;
122
+ /** [number setInterval(function callback, number delay, any rest)](https://developers.weixin.qq.com/miniprogram/dev/api/base/timer/setInterval.html)
123
+ *
124
+ * 设定一个定时器。按照指定的周期(以毫秒计)来执行注册的回调函数 */
125
+ declare function setInterval(
126
+ /** 回调函数 */
127
+ callback: (...args: any[]) => any,
128
+ /** 执行回调函数之间的时间间隔,单位 ms。 */
129
+ delay?: number,
130
+ /** param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */
131
+ rest?: any,
132
+ ): number;
133
+ /** [number setTimeout(function callback, number delay, any rest)](https://developers.weixin.qq.com/miniprogram/dev/api/base/timer/setTimeout.html)
134
+ *
135
+ * 设定一个定时器。在定时到期以后执行注册的回调函数 */
136
+ declare function setTimeout(
137
+ /** 回调函数 */
138
+ callback: (...args: any[]) => any,
139
+ /** 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 */
140
+ delay?: number,
141
+ /** param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */
142
+ rest?: any,
143
+ ): number;