import { DiscreteRoot } from "../../types.ts"; import { DeepSignal } from "@ng-org/alien-deepsignals"; /** * Svelte 5 hook to subscribe to existing discrete (JSON) CRDT documents. * You can modify the returned object like any other JSON object. Changes are immediately * reflected in the CRDT. * * Establishes a 2-way binding: Modifications to the object are immediately committed, * changes coming from the engine (or other components) cause an immediate rerender. * * In comparison to {@link svelteUseShape}, discrete CRDTs are untyped. * You can put any JSON data inside and need to validate the schema yourself. * * @param documentIdOrPromise The NURI of the CRDT document or a promise to that. * @returns The reactive JSON object of the CRDT document. * *@example * ```svelte * * *
*
*
*
* ``` * * --- * In the ExpenseCard component: * ```svelte * let { * expense = $bindable(), * }: { expense: Expense; } = $props(); * * *
* *
* ``` */ export declare function useDiscrete(documentIdOrPromise: string | Promise | undefined): { doc: DeepSignal; }; //# sourceMappingURL=useDiscrete.svelte.d.ts.map