import { ID } from "../../types/index.mjs"; import { MaybeRefOrGetter, Ref } from "vue"; //#region src/composables/useProxyModel/index.d.ts interface ProxyModelOptions { multiple?: MaybeRefOrGetter; transformIn?: (val: unknown) => unknown; transformOut?: (val: unknown) => unknown; } /** * Minimal interface for useProxyModel's context parameter. * Both ModelContext (Set-based) and SliderContext (Array-based) satisfy this. */ interface ProxyModelTarget { selectedValues: { readonly value: Iterable; }; apply: (values: unknown[], options?: { multiple?: boolean; }) => void; select?: (id: string | number) => void; browse?: (value: never) => readonly ID[] | undefined; multiple?: MaybeRefOrGetter; on?: (event: string, cb: (data: unknown) => void) => void; off?: (event: string, cb: (data: unknown) => void) => void; } /** * Syncs a ref with a model context bidirectionally. * * @param context The model context to bind to. * @param model The ref to sync. * @param options The options for the proxy model. * @returns A function to stop the sync. * * @see https://0.vuetifyjs.com/composables/reactivity/use-proxy-model * * @example * ```ts * import { createSelection, useProxyModel } from '@vuetify/v0' * * const model = ref() * const registry = createSelection({ events: true }) * registry.onboard([ * { id: 'item-1', value: 'Item 1' }, * { id: 'item-2', value: 'Item 2' }, * ]) * * const stop = useProxyModel(registry, model) * ``` */ declare function useProxyModel(context: ProxyModelTarget, model: Ref, options?: ProxyModelOptions): () => void; //#endregion export { ProxyModelOptions, ProxyModelTarget, useProxyModel };