/** One stored document, as the owning plugin sees it. */ export interface PluginDocument { /** The plugin's own stable identifier for this document. */ key: string; data: T; updatedAt: string | Date; } export interface PluginStore { items: PluginDocument[]; isLoading: boolean; isError: unknown; /** One document by key, or undefined. */ get: (key: string) => PluginDocument | undefined; /** Create or replace a document. Keyed writes are upserts, not appends. */ put: (key: string, data: T) => Promise; remove: (key: string) => Promise; } /** * Storage a plugin owns, without a change to CDT's database. * * Scoped by organization (from the session, server-side), by plugin (from the plugin * scope, never a parameter, so no plugin can name another's namespace) and by * collection, which the plugin picks. `key` is the plugin's own identifier — use * something durable like an IFC GlobalId, since writing the same key replaces. * * ```tsx * const spaces = usePluginStore<{ programme: string; capacity: number }>('spaces') * await spaces.put(globalId, { programme: 'Office', capacity: 4 }) * ``` * * Core never inspects `data`, so `T` is a declaration rather than a guarantee — * read defensively if an older version of the plugin wrote a different shape. */ export declare function usePluginStore(collection: string): PluginStore; //# sourceMappingURL=store.d.ts.map