Skip to content

Commit ddd7943

Browse files
authored
Merge pull request #1 from Lu-Jiejie/fix
fix: complete arguments for each event and export the types of props
2 parents 9b73592 + 190ad0d commit ddd7943

File tree

4 files changed

+27
-24
lines changed

4 files changed

+27
-24
lines changed

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/VueTypedJs/src/typed-component.config.ts

+20-20
Original file line numberDiff line numberDiff line change
@@ -105,44 +105,44 @@ export const getEventHandlers = (context: ComponentPublicInstance|null, _typedCo
105105

106106
let typedConfig = Object.assign({}, _typedConfig) as TypedOptions
107107

108-
typedConfig.onComplete = () => {
109-
context?.$emit('onComplete')
108+
typedConfig.onComplete = (...args) => {
109+
context?.$emit('onComplete',...args)
110110
}
111111

112-
typedConfig.preStringTyped = () => {
113-
context?.$emit('preStringTyped')
112+
typedConfig.preStringTyped = (...args) => {
113+
context?.$emit('preStringTyped',...args)
114114
}
115115

116-
typedConfig.onStringTyped = () => {
117-
context?.$emit('onStringTyped')
116+
typedConfig.onStringTyped = (...args) => {
117+
context?.$emit('onStringTyped',...args)
118118
}
119119

120-
typedConfig.onLastStringBackspaced = () => {
121-
context?.$emit('onLastStringBackspaced')
120+
typedConfig.onLastStringBackspaced = (...args) => {
121+
context?.$emit('onLastStringBackspaced',...args)
122122
}
123123

124-
typedConfig.onTypingPaused = () => {
125-
context?.$emit('onTypingPaused')
124+
typedConfig.onTypingPaused = (...args) => {
125+
context?.$emit('onTypingPaused',...args)
126126
}
127127

128-
typedConfig.onTypingResumed = () => {
129-
context?.$emit('onTypingResumed')
128+
typedConfig.onTypingResumed = (...args) => {
129+
context?.$emit('onTypingResumed',...args)
130130
}
131131

132-
typedConfig.onReset = () => {
133-
context?.$emit('onReset')
132+
typedConfig.onReset = (...args) => {
133+
context?.$emit('onReset',...args)
134134
}
135135

136-
typedConfig.onStop = () => {
137-
context?.$emit('onStop')
136+
typedConfig.onStop = (...args) => {
137+
context?.$emit('onStop',...args)
138138
}
139139

140-
typedConfig.onStart = () => {
141-
context?.$emit('onStart')
140+
typedConfig.onStart = (...args) => {
141+
context?.$emit('onStart',...args)
142142
}
143143

144-
typedConfig.onDestroy = () => {
145-
context?.$emit('onDestroy')
144+
typedConfig.onDestroy = (...args) => {
145+
context?.$emit('onDestroy',...args)
146146
}
147147

148148
return typedConfig

packages/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/// <reference types="typed.js" />
12
import { App } from 'vue';
23
export * from "./components";
4+
export type { TypedOptions } from 'typed.js';
35
declare const _default: {
46
install: (app: App) => void;
57
};

packages/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { App } from 'vue';
22
import components from "./components";
33

44
export * from "./components";
5+
export type { TypedOptions } from 'typed.js';
56

67
export default {
78
install: (app: App) => {

0 commit comments

Comments
 (0)