UNPKG

@magnetarjs/plugin-vue3

Version:
24 lines (23 loc) 905 B
import type { Clauses, MagnetarPlugin } from '@magnetarjs/types'; export type Vue3StoreOptions = { /** * To support optimistic UI you need to provide a function that can generate unique IDs. * @example () => firestore.collection('random').doc().id */ generateRandomId: () => string; }; export type Vue3StoreModuleConfig = { path?: string; initialData?: { [key: string]: unknown; } | [string, { [key: string]: unknown; }][]; } & Clauses; export type MakeRestoreBackup = (collectionPath: string, docId: string) => void; /** * a Magnetar plugin is a single function that returns a `PluginInstance` * the plugin implements the logic for all actions that a can be called from a Magnetar module instance * each action must have the proper for both collection and doc type modules */ export declare const CreatePlugin: MagnetarPlugin<Vue3StoreOptions>;