import { CommentReply } from "timi-web"; /** * emits */ export interface Emits { (event: "cancel"): Promise; (event: "submit", reply: CommentReply): Promise; } export const useHandler = (emit: Emits) => { const onCancel = async () => await emit("cancel"); const onSubmit = async (reply: CommentReply) => await emit("submit", reply); return { onCancel, onSubmit }; };