import type { ComponentInternalInstance, Ref } from 'vue'; export default function (instance: ComponentInternalInstance, key: string): Ref { if (!instance.exposed || !(key in instance.exposed)) { throw new Error(`'${key}' was not exposed by the component.`); } return instance.exposed[key]; }