/** * When dealing with shapes (RDF-based graph database ORMs): * The scope of a shape request. * In most cases, it is recommended to use a narrow scope for performance. * You can filter results by `subjects` and `graphs`. Only objects in that scope will be returned. * * @example * ```typescript * // Contains all expense objects with `@id` or and `@graph` or * const expenses: DeepSignal> = useShape(ExpenseShape, * {graphs: ["", ""], * subjects: ["", ""]}); * ``` */ export type Scope = { /** * The graphs to filter for. If an array is provided, the union of all graphs is considered. * * - Set value to `["did:ng:i"]` or `[""]` for whole dataset. * - Setting value to `[]` or leaving it `undefined`, no objects are returned. */ graphs?: string[] | string; /** * Subjects to filter for. Set to `[]` or leave it `undefined` for no filtering. */ subjects?: string[]; }; /** * Converts undefined to [] and for graphs "" to "did:ng:i". If scope is string, it means {graphs: [\], subjects: []}. * @ignore */ export declare const normalizeScope: (scope?: Scope | string | undefined) => NormalizedScope; export type NormalizedScope = { graphs: string[]; subjects: string[]; }; /** An allowed array in the CRDT. @ignore */ export interface DiscreteArray extends Array { } /** An allowed object in the CRDT. */ export interface DiscreteObject { [key: string]: DiscreteType; } /** An allowed type in the CRDT. */ export type DiscreteType = DiscreteArray | DiscreteObject | string | number | boolean; /** * The root array for reading and modifying the CRDT as a plain object. */ export type DiscreteRootArray = (DiscreteArray | string | number | boolean | (DiscreteObject & { readonly "@id": string; }))[]; /** * The root object for reading and modifying the CRDT as a plain object. */ export interface DiscreteRootObject { [key: string]: DiscreteObject | string | number | boolean | DiscreteRootArray; } /** A discrete document's root object, either an array or an object. */ export type DiscreteRoot = DiscreteRootArray | DiscreteRootObject; /** * The supported discrete (JSON) CRDTs. * Automerge and YMap require objects as roots. * YArray requires an array as root. */ export type DiscreteCrdt = "YMap" | "YArray" | "Automerge"; //# sourceMappingURL=types.d.ts.map