Skip to content

Commit

Permalink
feat(ts): Improve useDialogPluginComponent emits types (#11325)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufkandemir committed Nov 13, 2021
1 parent 0b7939f commit f12556b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions ui/src/composables/use-dialog-plugin-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function useDialogPluginComponent () {
}
}

// Don't forget to update the types in "ui/types/composables.d.ts"
const emits = [ 'ok', 'hide' ]

useDialogPluginComponent.emits = emits
Expand Down
6 changes: 5 additions & 1 deletion ui/types/composables.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ interface useDialogPluginComponent {
onDialogOK: (payload?: any) => void;
onDialogCancel: () => void;
};
emits: string[];
emits: ['ok', 'hide'];
emitsObject: {
ok: () => true;
hide: () => true;
}
}

export const useDialogPluginComponent: useDialogPluginComponent;
Expand Down

0 comments on commit f12556b

Please sign in to comment.