mp-weixin-back 0.0.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.
package/.editorconfig ADDED
@@ -0,0 +1,25 @@
1
+
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ # 缩进大小=2
7
+ indent_size = 2
8
+
9
+ end_of_line = lf
10
+ # 字符集=utf-8
11
+ charset = utf-8
12
+ # 删除行尾空格 = 是
13
+ trim_trailing_whitespace = true
14
+ # 插入最后一行=真
15
+ insert_final_newline = true
16
+
17
+ [*.md]
18
+ # 删除行尾空格 = 否
19
+ trim_trailing_whitespace = false
20
+
21
+ [package.json]
22
+ # 缩进样式=空格
23
+ indent_style = space
24
+ # 缩进大小=2
25
+ indent_size = 2
package/.prettierrc.js ADDED
@@ -0,0 +1,8 @@
1
+ // .prettierrc.js 文件
2
+ module.exports = {
3
+ printWidth: 100,
4
+ tabWidth: 2,
5
+ useTabs: false,
6
+ semi: false,
7
+ singleQuote: true,
8
+ };
package/client.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ declare module 'mp-weixin-back-helper' {
2
+ type Config = {
3
+ /**
4
+ * 是否阻止默认的回退事件,默认为 false
5
+ */
6
+ preventDefault: boolean
7
+ /**
8
+ * 阻止次数,默认是 `1`
9
+ */
10
+ frequency: number
11
+ }
12
+
13
+ function onPageBack(
14
+ callback:() => void,
15
+ params: Partial<Config>
16
+ )
17
+
18
+ export default onPageBack
19
+ }
@@ -0,0 +1,27 @@
1
+ import { Plugin } from 'vite';
2
+
3
+ type UserOptions = Partial<Config>;
4
+ type Config = {
5
+ /**
6
+ * 是否阻止默认的回退事件,默认为 false
7
+ */
8
+ preventDefault: boolean;
9
+ /**
10
+ * 阻止次数,默认是 `1`
11
+ */
12
+ frequency: number;
13
+ /**
14
+ * 页面回退时触发
15
+ */
16
+ onPageBack?: (params: BackParams) => void;
17
+ };
18
+ type BackParams = {
19
+ /**
20
+ * 当前页面路径
21
+ */
22
+ page: string;
23
+ };
24
+
25
+ declare function MpBackPlugin(userOptions?: UserOptions): Plugin;
26
+
27
+ export { MpBackPlugin as default };
@@ -0,0 +1,27 @@
1
+ import { Plugin } from 'vite';
2
+
3
+ type UserOptions = Partial<Config>;
4
+ type Config = {
5
+ /**
6
+ * 是否阻止默认的回退事件,默认为 false
7
+ */
8
+ preventDefault: boolean;
9
+ /**
10
+ * 阻止次数,默认是 `1`
11
+ */
12
+ frequency: number;
13
+ /**
14
+ * 页面回退时触发
15
+ */
16
+ onPageBack?: (params: BackParams) => void;
17
+ };
18
+ type BackParams = {
19
+ /**
20
+ * 当前页面路径
21
+ */
22
+ page: string;
23
+ };
24
+
25
+ declare function MpBackPlugin(userOptions?: UserOptions): Plugin;
26
+
27
+ export { MpBackPlugin as default };