import { type Scope } from "../../types.ts"; import type { BaseType, ShapeType } from "@ng-org/shex-orm"; import { type UseDeepSignalResult } from "@ng-org/alien-deepsignals/svelte4"; /** Extended result including the originating root signal wrapper from shape logic. @ignore*/ export interface UseShapeStoreResult extends UseDeepSignalResult { root: any; } /** * Svelte 4 hook to subscribe to RDF data in the graph database using a shape, see {@link ShapeType}. * * Returns a {@link DeepSignalSet} store containing the objects matching the shape and that are within the scope. * Establishes a 2-way binding: Modifications to the object are immediately committed, * changes coming from the backend (or other components) cause an immediate rerender. * * @param shape The {@link ShapeType} the objects should have (generated by the shex-orm tool). * @param scope The {@link Scope} as graph string or scope object with graphs and subjects. * @returns A {@link DeepSignalSet} with the orm objects or an empty set, if still loading.\ * If the scope is explicitly set to `undefined`, an empty set is returned which errors * if you try to make modifications on it. * * @example * ```svelte * * *
*
* {# if expensesSorted.length === 0} *

* No expense yet. *

* {:else} * {#each expensesSorted as expense, index (expense['@id']) } * * {/each} * {/if} *
*
* ``` * * --- * In the ExpenseCard component: * ```svelte * * let { * expense = $bindable(), * }: { expense: Expense; } = $props(); * * *
* *
* ``` */ export declare function useShape(shape: ShapeType, scope: Scope | string | undefined): UseShapeStoreResult>; export default useShape; //# sourceMappingURL=useShape.svelte.d.ts.map