import { Plugin } from 'vite'; import { Ref } from 'vue'; interface ServerRefOptions> { state?: T; /** * Milliseconds to debounce the server ref updates. * * @default 10 */ debounce?: number; /** * Default value for the client when the data is not presented. * * @default () => undefined */ defaultValue?: (key: string) => unknown; /** * Log info on the client */ debug?: boolean; /** * The vue entry name for the generated client code. * * @default 'vue' */ clientVue?: string; /** * Callback on server data change */ onChanged?: (name: K, data: T[K], patch: Partial | undefined, timestamp: number) => void; } interface ServerRefExtend { $syncDown: boolean; $syncUp: boolean; $onChange(fn: (data: T) => void): void; $onPatch(fn: (patch: Partial) => void): void; $patch(patch: Partial): Promise; } type ServerRef = Ref & ServerRefExtend; type ServerReactive = T & ServerRefExtend; declare function VitePluginServerRef(options?: ServerRefOptions): Plugin; export { type ServerReactive, type ServerRef, type ServerRefExtend, type ServerRefOptions, VitePluginServerRef as default };