import { computed , Ref } from 'vue' ; export function useSync < T , K extends keyof T & string , E extends ( event : `update:${ K }` , ... args : any [ ] ) => void > ( props , key , emit ) { return computed < T [ K ] > ( { get ( ) { return props [ key ] ; } , set ( newVal ) { emit ( `update:${ key }` as const , newVal ) ; } , } ) ; }