Skip to content

Commit a7769f8

Browse files
committed
refactor(artist): add types
1 parent 0571612 commit a7769f8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/misc/artist-ui/src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ interface ElProp {
2626
value: string;
2727
}
2828

29+
type Timer = (cb: () => void, interval: number, key: string) => void;
30+
31+
type InitHook = (store: { [key: string]: any }, timer: Timer) => void;
32+
2933
const defaultConfig = {
3034
collapseWhitespace: false,
3135
keepClosingSlash: true,
@@ -35,7 +39,7 @@ const defaultConfig = {
3539
export default class Artist {
3640
private store: { [key: string]: any };
3741
private config: Config = defaultConfig;
38-
private onInitHook: Function = () => {};
42+
private onInitHook: InitHook = () => {};
3943
private elements = {};
4044
private timers = {
4145
internal: {},
@@ -171,7 +175,7 @@ export default class Artist {
171175
this.rewriteScreen(output);
172176
}
173177

174-
onInit(fn: Function) {
178+
onInit(fn: InitHook) {
175179
this.onInitHook = fn;
176180
}
177181

0 commit comments

Comments
 (0)