go-captcha-vue 2.0.0-beta.1 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +113 -22
  3. package/dist/assets/icons/arrows-icon.vue.d.ts +3 -1
  4. package/dist/assets/icons/btn-default-icon.vue.d.ts +3 -1
  5. package/dist/assets/icons/btn-error-icon.vue.d.ts +3 -1
  6. package/dist/assets/icons/btn-success-icon.vue.d.ts +3 -1
  7. package/dist/assets/icons/btn-warn-icon.vue.d.ts +3 -1
  8. package/dist/assets/icons/close-icon.vue.d.ts +3 -1
  9. package/dist/assets/icons/loading-icon.vue.d.ts +3 -1
  10. package/dist/assets/icons/refresh-icon.vue.d.ts +3 -1
  11. package/dist/components/button/index.d.ts +5 -0
  12. package/dist/components/button/index.vue.d.ts +27 -24
  13. package/dist/components/button/meta/config.d.ts +2 -2
  14. package/dist/components/click/hooks/handler.d.ts +3 -3
  15. package/dist/components/click/index.vue.d.ts +32 -31
  16. package/dist/components/click/meta/config.d.ts +4 -2
  17. package/dist/components/click/meta/data.d.ts +2 -2
  18. package/dist/components/click/meta/event.d.ts +3 -3
  19. package/dist/components/rotate/hooks/handler.d.ts +4 -4
  20. package/dist/components/rotate/index.vue.d.ts +31 -31
  21. package/dist/components/rotate/meta/config.d.ts +3 -2
  22. package/dist/components/rotate/meta/data.d.ts +1 -1
  23. package/dist/components/rotate/meta/event.d.ts +1 -1
  24. package/dist/components/slide/hooks/handler.d.ts +4 -4
  25. package/dist/components/slide/index.vue.d.ts +31 -31
  26. package/dist/components/slide/meta/config.d.ts +3 -2
  27. package/dist/components/slide/meta/data.d.ts +2 -2
  28. package/dist/components/slide/meta/event.d.ts +3 -3
  29. package/dist/components/slide-region/hooks/handler.d.ts +4 -4
  30. package/dist/components/slide-region/index.vue.d.ts +31 -31
  31. package/dist/components/slide-region/meta/config.d.ts +3 -2
  32. package/dist/components/slide-region/meta/data.d.ts +2 -2
  33. package/dist/components/slide-region/meta/event.d.ts +3 -3
  34. package/dist/go-captcha-vue.es.js +814 -1249
  35. package/dist/go-captcha-vue.umd.js +8 -8
  36. package/dist/index.d.ts +8 -4
  37. package/dist/style.css +1 -1
  38. package/package.json +27 -13
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Awen <wengaolng@gmail.com>
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.
package/README.md CHANGED
@@ -1,23 +1,42 @@
1
1
  # Go Captcha Vue Package
2
2
 
3
+ <p> ⭐️ If it helps you, please give a star.</p>
4
+ <img src="http://47.104.180.148/go-captcha/go-captcha-v2.jpg" alt="Poster">
5
+
6
+
7
+ <br/>
8
+
9
+ | Vue Version | Go Captcha Version |
10
+ |:-----------------------|:------------------:|
11
+ | vue >= 2.7.14 && < 3.0 | go-captcha-vue@^1 |
12
+ | vue >= 3.0 | go-captcha-vue@^2 |
13
+
14
+ ## Install
3
15
  ```shell
4
- yarn add go-captcha-vue
16
+ # Greater than or equal to vue2.7.14 and less than vue3.0
17
+ yarn add go-captcha-vue@^1
5
18
  # or
6
- npm install go-captcha-vue
19
+ npm install go-captcha-vue@^1
7
20
  # or
8
- pnpm install go-captcha-vue
9
- ```
21
+ pnpm install go-captcha-vue@^1
10
22
 
11
- ## Use Go Captcha
12
- ```vue
23
+ ############################################
24
+ # Greater than vue3.0
25
+ yarn add go-captcha-vue@^2
26
+ # or
27
+ npm install go-captcha-vue@^2
28
+ # or
29
+ pnpm install go-captcha-vue@^2
30
+ ```
13
31
 
32
+ Use Go Captcha
33
+ ```ts
14
34
  import "go-captcha-vue/dist/style.css"
15
35
  import GoCaptcha from "go-captcha-vue"
16
36
 
17
37
  Vue.use(GoCaptcha)
18
38
  ```
19
39
 
20
-
21
40
  ## 🖖 Click Mode Captcha
22
41
  ```vue
23
42
  <gocaptcha-click
@@ -27,10 +46,10 @@ Vue.use(GoCaptcha)
27
46
  />
28
47
  ```
29
48
 
30
- ### params
49
+ ### Parameter Reference
31
50
  ```ts
32
51
  // config = {}
33
- interface Config {
52
+ interface ClickConfig {
34
53
  width?: number;
35
54
  height?: number;
36
55
  thumbWidth?: number;
@@ -38,20 +57,22 @@ interface Config {
38
57
  verticalPadding?: number;
39
58
  horizontalPadding?: number;
40
59
  showTheme?: boolean;
60
+ title?: string;
61
+ buttonText?: string;
41
62
  }
42
63
 
43
64
  // data = {}
44
- interface Data {
65
+ interface ClickData {
45
66
  image: string;
46
67
  thumb: string;
47
68
  }
48
69
 
49
70
  // events = {}
50
- interface Events {
71
+ interface ClickEvents {
51
72
  click?: (x: number, y: number) => void;
52
73
  refresh?: () => void;
53
74
  close?: () => void;
54
- confirm?: (dots: Array<CaptchaDot>) => boolean;
75
+ confirm?: (dots: Array<ClickDot>) => boolean;
55
76
  }
56
77
  ```
57
78
 
@@ -69,10 +90,10 @@ interface Events {
69
90
  :events="{}"
70
91
  />
71
92
  ```
72
- ### params
93
+ ### Parameter Reference
73
94
  ```ts
74
95
  // config = {}
75
- interface Config {
96
+ interface SlideConfig {
76
97
  width?: number;
77
98
  height?: number;
78
99
  thumbWidth?: number;
@@ -80,10 +101,11 @@ interface Config {
80
101
  verticalPadding?: number;
81
102
  horizontalPadding?: number;
82
103
  showTheme?: boolean;
104
+ title?: string;
83
105
  }
84
106
 
85
107
  // data = {}
86
- interface Data {
108
+ interface SlideData {
87
109
  thumbX: number;
88
110
  thumbY: number;
89
111
  thumbWidth: number;
@@ -93,14 +115,44 @@ interface Data {
93
115
  }
94
116
 
95
117
  // events = {}
96
- interface Events {
118
+ interface SlideEvents {
97
119
  move?: (x: number, y: number) => void;
98
120
  refresh?: () => void;
99
121
  close?: () => void;
100
- confirm?: (point: CaptchaPoint) => boolean;
122
+ confirm?: (point: SlidePoint) => boolean;
101
123
  }
102
124
  ```
125
+ ```ts
126
+ // config = {}
127
+ interface SlideRegionConfig {
128
+ width?: number;
129
+ height?: number;
130
+ thumbWidth?: number;
131
+ thumbHeight?: number;
132
+ verticalPadding?: number;
133
+ horizontalPadding?: number;
134
+ showTheme?: boolean;
135
+ title?: string;
136
+ }
103
137
 
138
+ // data = {}
139
+ interface SlideRegionData {
140
+ thumbX: number;
141
+ thumbY: number;
142
+ thumbWidth: number;
143
+ thumbHeight: number;
144
+ image: string;
145
+ thumb: string;
146
+ }
147
+
148
+ // events = {}
149
+ interface SlideRegionEvents {
150
+ move?: (x: number, y: number) => void;
151
+ refresh?: () => void;
152
+ close?: () => void;
153
+ confirm?: (point: SlideRegionPoint) => boolean;
154
+ }
155
+ ```
104
156
 
105
157
  ## 🖖 Rotate Mode Captcha
106
158
  ```vue
@@ -111,10 +163,10 @@ interface Events {
111
163
  />
112
164
  ```
113
165
 
114
- ### params
166
+ ### Parameter Reference
115
167
  ```ts
116
168
  // config = {}
117
- interface Config {
169
+ interface RotateConfig {
118
170
  width?: number;
119
171
  height?: number;
120
172
  thumbWidth?: number;
@@ -122,20 +174,59 @@ interface Config {
122
174
  verticalPadding?: number;
123
175
  horizontalPadding?: number;
124
176
  showTheme?: boolean;
177
+ title?: string;
125
178
  }
126
179
 
127
180
  // data = {}
128
- interface Data {
181
+ interface RotateData {
129
182
  angle: number;
130
183
  image: string;
131
184
  thumb: string;
132
185
  }
133
186
 
134
187
  // events = {}
135
- interface Events {
188
+ interface RotateEvents {
136
189
  rotate?: (angle: number) => void;
137
190
  refresh?: () => void;
138
191
  close?: () => void;
139
192
  confirm?: (angle: number) => boolean;
140
193
  }
141
- ```
194
+ ```
195
+
196
+
197
+ ## Button
198
+ ```vue
199
+ <gocaptcha-button @clickEvent="() => console.log('hello')"/>
200
+ ```
201
+
202
+ ### params
203
+ ```ts
204
+ interface $Attr {
205
+ config?: CaptchaConfig;
206
+ disabled?: boolean;
207
+ type?: "default" | "warn" | "error" | "success";
208
+ title?: string;
209
+ }
210
+
211
+ interface $Event {
212
+ clickEvent?: ()=>void; // event -> @clickEvent=""
213
+ }
214
+
215
+ export interface ButtonConfig {
216
+ width?: number;
217
+ height?: number;
218
+ verticalPadding?: number;
219
+ horizontalPadding?: number;
220
+ }
221
+
222
+ ```
223
+
224
+ <br/>
225
+
226
+ ## 🍹 Buy me a coffee
227
+ <div>
228
+ <a href="http://witkeycode.com/sponsor" target="_blank"><img src="http://47.104.180.148/payment-code/wxpay.png" alt="Buy Me A Coffee" style="width: 217px !important;" ></a>
229
+ <a href="http://witkeycode.com/sponsor" target="_blank"><img src="http://47.104.180.148/payment-code/alipay.png" alt="Buy Me A Coffee" style="width: 217px !important;" ></a>
230
+ </div>
231
+
232
+ <br/>
@@ -1,4 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
2
  click: (...args: any[]) => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onClick?: ((...args: any[]) => any) | undefined;
5
+ }, {}, {}>;
4
6
  export default _default;
@@ -1,4 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
2
  click: (...args: any[]) => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onClick?: ((...args: any[]) => any) | undefined;
5
+ }, {}, {}>;
4
6
  export default _default;
@@ -1,4 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
2
  click: (...args: any[]) => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onClick?: ((...args: any[]) => any) | undefined;
5
+ }, {}, {}>;
4
6
  export default _default;
@@ -1,4 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
2
  click: (...args: any[]) => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onClick?: ((...args: any[]) => any) | undefined;
5
+ }, {}, {}>;
4
6
  export default _default;
@@ -1,4 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
2
  click: (...args: any[]) => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onClick?: ((...args: any[]) => any) | undefined;
5
+ }, {}, {}>;
4
6
  export default _default;
@@ -1,4 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
2
  click: (...args: any[]) => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onClick?: ((...args: any[]) => any) | undefined;
5
+ }, {}, {}>;
4
6
  export default _default;
@@ -1,4 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
2
  click: (...args: any[]) => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onClick?: ((...args: any[]) => any) | undefined;
5
+ }, {}, {}>;
4
6
  export default _default;
@@ -1,4 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
2
  click: (...args: any[]) => void;
3
- }, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onClick?: ((...args: any[]) => any) | undefined;
5
+ }, {}, {}>;
4
6
  export default _default;
@@ -1,2 +1,7 @@
1
+ /**
2
+ * @Author Awen
3
+ * @Date 2024/06/01
4
+ * @Email wengaolng@gmail.com
5
+ **/
1
6
  import capt from './index.vue';
2
7
  export default capt;
@@ -1,37 +1,48 @@
1
- import { CaptchaConfig } from "./meta/config";
2
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
- config?: CaptchaConfig | undefined;
1
+ import { ButtonConfig } from "./meta/config";
2
+ import { ButtonType } from "@/components/button/meta/types";
3
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
4
+ config?: ButtonConfig | undefined;
4
5
  clickEvent?: (() => void) | undefined;
5
6
  disabled?: boolean | undefined;
6
- type?: "default" | "warn" | "error" | "success" | undefined;
7
+ type?: ButtonType | undefined;
7
8
  title?: string | undefined;
8
9
  }>, {
9
- config: () => CaptchaConfig;
10
+ config: () => ButtonConfig;
10
11
  disabled: boolean;
11
12
  type: string;
12
13
  title: string;
13
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
15
  "click-event": (...args: any[]) => void;
15
- }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
16
- config?: CaptchaConfig | undefined;
16
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
17
+ config?: ButtonConfig | undefined;
17
18
  clickEvent?: (() => void) | undefined;
18
19
  disabled?: boolean | undefined;
19
- type?: "default" | "warn" | "error" | "success" | undefined;
20
+ type?: ButtonType | undefined;
20
21
  title?: string | undefined;
21
22
  }>, {
22
- config: () => CaptchaConfig;
23
+ config: () => ButtonConfig;
23
24
  disabled: boolean;
24
25
  type: string;
25
26
  title: string;
26
- }>>>, {
27
+ }>>> & {
28
+ "onClick-event"?: ((...args: any[]) => any) | undefined;
29
+ }, {
27
30
  title: string;
28
- config: CaptchaConfig;
29
- type: "default" | "warn" | "error" | "success";
31
+ config: ButtonConfig;
32
+ type: ButtonType;
30
33
  disabled: boolean;
31
- }>;
34
+ }, {}>;
32
35
  export default _default;
33
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
34
- declare type __VLS_TypePropsToRuntimeProps<T> = {
36
+ type __VLS_WithDefaults<P, D> = {
37
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
38
+ default: D[K];
39
+ }> : P[K];
40
+ };
41
+ type __VLS_Prettify<T> = {
42
+ [K in keyof T]: T[K];
43
+ } & {};
44
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
45
+ type __VLS_TypePropsToOption<T> = {
35
46
  [K in keyof T]-?: {} extends Pick<T, K> ? {
36
47
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
37
48
  } : {
@@ -39,11 +50,3 @@ declare type __VLS_TypePropsToRuntimeProps<T> = {
39
50
  required: true;
40
51
  };
41
52
  };
42
- declare type __VLS_WithDefaults<P, D> = {
43
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
44
- default: D[K];
45
- }> : P[K];
46
- };
47
- declare type __VLS_Prettify<T> = {
48
- [K in keyof T]: T[K];
49
- } & {};
@@ -3,10 +3,10 @@
3
3
  * @Date 2024/06/01
4
4
  * @Email wengaolng@gmail.com
5
5
  **/
6
- export interface CaptchaConfig {
6
+ export interface ButtonConfig {
7
7
  width?: number;
8
8
  height?: number;
9
9
  verticalPadding?: number;
10
10
  horizontalPadding?: number;
11
11
  }
12
- export declare const defaultConfig: () => CaptchaConfig;
12
+ export declare const defaultConfig: () => ButtonConfig;
@@ -1,6 +1,6 @@
1
- import { CaptchaData } from "../meta/data";
2
- import { CaptchaEvent } from "../meta/event";
3
- export declare function useHandler(_data: CaptchaData, event: CaptchaEvent): {
1
+ import { ClickData } from "../meta/data";
2
+ import { ClickEvent } from "../meta/event";
3
+ export declare function useHandler(_data: ClickData, event: ClickEvent): {
4
4
  dots: {
5
5
  list: {
6
6
  key: number;
@@ -1,30 +1,39 @@
1
- import { CaptchaConfig } from "./meta/config";
2
- import { CaptchaData } from "./meta/data";
3
- import { CaptchaEvent } from "./meta/event";
4
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
- config?: CaptchaConfig | undefined;
6
- events?: CaptchaEvent | undefined;
7
- data: CaptchaData;
1
+ import { ClickConfig } from "./meta/config";
2
+ import { ClickData } from "./meta/data";
3
+ import { ClickEvent } from "./meta/event";
4
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
5
+ config?: ClickConfig | undefined;
6
+ events?: ClickEvent | undefined;
7
+ data: ClickData;
8
8
  }>, {
9
- config: () => CaptchaConfig;
10
- events: () => CaptchaEvent;
11
- data: () => CaptchaData;
12
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
13
- config?: CaptchaConfig | undefined;
14
- events?: CaptchaEvent | undefined;
15
- data: CaptchaData;
9
+ config: () => ClickConfig;
10
+ events: () => ClickEvent;
11
+ data: () => ClickData;
12
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
13
+ config?: ClickConfig | undefined;
14
+ events?: ClickEvent | undefined;
15
+ data: ClickData;
16
16
  }>, {
17
- config: () => CaptchaConfig;
18
- events: () => CaptchaEvent;
19
- data: () => CaptchaData;
17
+ config: () => ClickConfig;
18
+ events: () => ClickEvent;
19
+ data: () => ClickData;
20
20
  }>>>, {
21
- data: CaptchaData;
22
- config: CaptchaConfig;
23
- events: CaptchaEvent;
24
- }>;
21
+ data: ClickData;
22
+ config: ClickConfig;
23
+ events: ClickEvent;
24
+ }, {}>;
25
25
  export default _default;
26
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
27
- declare type __VLS_TypePropsToRuntimeProps<T> = {
26
+
27
+ type __VLS_WithDefaults<P, D> = {
28
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
29
+ default: D[K];
30
+ }> : P[K];
31
+ };
32
+ type __VLS_Prettify<T> = {
33
+ [K in keyof T]: T[K];
34
+ } & {};
35
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
36
+ type __VLS_TypePropsToOption<T> = {
28
37
  [K in keyof T]-?: {} extends Pick<T, K> ? {
29
38
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
30
39
  } : {
@@ -32,11 +41,3 @@ declare type __VLS_TypePropsToRuntimeProps<T> = {
32
41
  required: true;
33
42
  };
34
43
  };
35
- declare type __VLS_WithDefaults<P, D> = {
36
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
37
- default: D[K];
38
- }> : P[K];
39
- };
40
- declare type __VLS_Prettify<T> = {
41
- [K in keyof T]: T[K];
42
- } & {};
@@ -3,7 +3,7 @@
3
3
  * @Date 2024/06/01
4
4
  * @Email wengaolng@gmail.com
5
5
  **/
6
- export interface CaptchaConfig {
6
+ export interface ClickConfig {
7
7
  width?: number;
8
8
  height?: number;
9
9
  thumbWidth?: number;
@@ -11,5 +11,7 @@ export interface CaptchaConfig {
11
11
  verticalPadding?: number;
12
12
  horizontalPadding?: number;
13
13
  showTheme?: boolean;
14
+ title?: string;
15
+ buttonText?: string;
14
16
  }
15
- export declare const defaultConfig: () => CaptchaConfig;
17
+ export declare const defaultConfig: () => ClickConfig;
@@ -3,11 +3,11 @@
3
3
  * @Date 2024/05/25
4
4
  * @Email wengaolng@gmail.com
5
5
  **/
6
- export interface CaptchaData {
6
+ export interface ClickData {
7
7
  image: string;
8
8
  thumb: string;
9
9
  }
10
- export interface CaptchaDot {
10
+ export interface ClickDot {
11
11
  key: number;
12
12
  index: number;
13
13
  x: number;
@@ -3,11 +3,11 @@
3
3
  * @Date 2024/05/25
4
4
  * @Email wengaolng@gmail.com
5
5
  **/
6
- import { CaptchaDot } from "./data";
7
- export interface CaptchaEvent {
6
+ import type { ClickDot } from "./data";
7
+ export interface ClickEvent {
8
8
  click?: (x: number, y: number) => void;
9
9
  callback?: () => void;
10
10
  refresh?: () => void;
11
11
  close?: () => void;
12
- confirm?: (dots: Array<CaptchaDot>, clear: (fn: Function) => void) => void;
12
+ confirm?: (dots: Array<ClickDot>, clear: (fn: Function) => void) => void;
13
13
  }
@@ -1,7 +1,7 @@
1
- import { CaptchaData } from "../meta/data";
2
- import { CaptchaEvent } from "../meta/event";
3
- import { Ref } from "vue/types/v3-generated";
4
- export declare function useHandler(data: CaptchaData, event: CaptchaEvent, dragBlockRef: Ref, dragBarRef: Ref): {
1
+ import { RotateData } from "../meta/data";
2
+ import { RotateEvent } from "../meta/event";
3
+ import { Ref } from "vue";
4
+ export declare function useHandler(data: RotateData, event: RotateEvent, dragBlockRef: Ref, dragBarRef: Ref): {
5
5
  state: {
6
6
  dragLeft: number;
7
7
  thumbAngle: number;
@@ -1,30 +1,38 @@
1
- import { CaptchaConfig } from "./meta/config";
2
- import { CaptchaData } from "./meta/data";
3
- import { CaptchaEvent } from "./meta/event";
4
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
- config?: CaptchaConfig | undefined;
6
- events?: CaptchaEvent | undefined;
7
- data: CaptchaData;
1
+ import { RotateConfig } from "./meta/config";
2
+ import { RotateData } from "./meta/data";
3
+ import { RotateEvent } from "./meta/event";
4
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
5
+ config?: RotateConfig | undefined;
6
+ events?: RotateEvent | undefined;
7
+ data: RotateData;
8
8
  }>, {
9
- config: () => CaptchaConfig;
10
- events: () => CaptchaEvent;
11
- data: () => CaptchaData;
12
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
13
- config?: CaptchaConfig | undefined;
14
- events?: CaptchaEvent | undefined;
15
- data: CaptchaData;
9
+ config: () => RotateConfig;
10
+ events: () => RotateEvent;
11
+ data: () => RotateData;
12
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
13
+ config?: RotateConfig | undefined;
14
+ events?: RotateEvent | undefined;
15
+ data: RotateData;
16
16
  }>, {
17
- config: () => CaptchaConfig;
18
- events: () => CaptchaEvent;
19
- data: () => CaptchaData;
17
+ config: () => RotateConfig;
18
+ events: () => RotateEvent;
19
+ data: () => RotateData;
20
20
  }>>>, {
21
- data: CaptchaData;
22
- config: CaptchaConfig;
23
- events: CaptchaEvent;
24
- }>;
21
+ data: RotateData;
22
+ config: RotateConfig;
23
+ events: RotateEvent;
24
+ }, {}>;
25
25
  export default _default;
26
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
27
- declare type __VLS_TypePropsToRuntimeProps<T> = {
26
+ type __VLS_WithDefaults<P, D> = {
27
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
28
+ default: D[K];
29
+ }> : P[K];
30
+ };
31
+ type __VLS_Prettify<T> = {
32
+ [K in keyof T]: T[K];
33
+ } & {};
34
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
35
+ type __VLS_TypePropsToOption<T> = {
28
36
  [K in keyof T]-?: {} extends Pick<T, K> ? {
29
37
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
30
38
  } : {
@@ -32,11 +40,3 @@ declare type __VLS_TypePropsToRuntimeProps<T> = {
32
40
  required: true;
33
41
  };
34
42
  };
35
- declare type __VLS_WithDefaults<P, D> = {
36
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
37
- default: D[K];
38
- }> : P[K];
39
- };
40
- declare type __VLS_Prettify<T> = {
41
- [K in keyof T]: T[K];
42
- } & {};