import { Account, AnonymousJazzAgent, CoValueCreateOptions, RefsToResolve, RefsToResolveStrict, Settled, InstanceOfSchemaCoValuesMaybeLoaded, CoMapSchema, SnapshotRef, Resolved, InstanceOfSchema, AsLoaded } from "../../../internal.js"; import { SchemaPermissions } from "../schemaPermissions.js"; import { z } from "../zodReExport.js"; import { CoOptionalSchema } from "./CoOptionalSchema.js"; import { CoreCoValueSchema, CoreResolveQuery } from "./CoValueSchema.js"; type SnapshotRefInstanceMaybeLoaded = SnapshotRef>; type SnapshotRefMapSchema = CoMapSchema<{ ref: z.ZodString; cursor: z.ZodString; }>; /** * Core schema definition for a SnapshotRef CoValue. * * Contains the minimal shape information needed to hydrate a full {@link SnapshotRefSchema}. * * @category Schema */ export interface CoreSnapshotRefSchema extends CoreCoValueSchema { builtin: "SnapshotRef"; snapshotRefMapSchema: SnapshotRefMapSchema; innerSchema: S; cursorResolveQuery: R; } /** * Schema definition for a `SnapshotRef` CoValue. * * Provides methods to create, load, and configure SnapshotRef instances. * Use `co.snapshotRef(innerSchema)` to obtain a `SnapshotRefSchema`. * * @category Schema */ export declare class SnapshotRefSchema implements CoreSnapshotRefSchema { #private; private coValueClass; readonly collaborative: true; readonly builtin: "SnapshotRef"; /** The inner CoValue schema that SnapshotRef instances will reference. */ readonly innerSchema: S; /** The underlying CoMap schema used to persist the snapshot reference data. */ readonly snapshotRefMapSchema: SnapshotRefMapSchema; /** The resolve query applied when loading the snapshot's cursor. */ readonly cursorResolveQuery: CursorResolveQuery; /** * Default resolve query to be used when loading instances of this schema. * This resolve query will be used when no resolve query is provided to the load method. * @default true */ resolveQuery: DefaultResolveQuery; /** * Permissions to be used when creating or composing CoValues * @internal */ get permissions(): SchemaPermissions; /** @internal */ getValidationSchema: CoreCoValueSchema["getValidationSchema"]; /** @internal */ static _refMapSchema: CoMapSchema<{ ref: z.ZodString; cursor: z.ZodString; }> | undefined; /** @internal */ static get refMapSchema(): CoMapSchema<{ ref: z.ZodString; cursor: z.ZodString; }, unknown, import("../../../internal.js").Group | Account, true>; /** @internal */ constructor(coreSchema: CoreSnapshotRefSchema, coValueClass: typeof SnapshotRef); /** * Create a new `SnapshotRef` pointing to the given CoValue. * * The passed CoValue does not need to be fully loaded — the function will * deeply load and snapshot the structure based on the schema's `cursorResolveQuery`. * * The SnapshotRef will immediately be persisted and synced to connected peers. * * @category Creation */ create(value: AsLoaded>, options?: CoValueCreateOptions): Promise, CursorResolveQuery>>>>; load> = DefaultResolveQuery>(id: string, options?: { resolve?: RefsToResolveStrict, R>; loadAs?: Account | AnonymousJazzAgent; skipRetry?: boolean; }): Promise, R>>>; /** @internal */ getCoValueClass(): typeof SnapshotRef; /** * Mark this schema field as optional when used inside a CoMap schema. */ optional(): CoOptionalSchema; private copy; /** * Adds a default resolve query to be used when loading instances of this schema. * This resolve query will be used when no resolve query is provided to the load method. */ resolved> = true>(resolveQuery: RefsToResolveStrict, ResolveQuery>): SnapshotRefSchema; /** * Configure permissions to be used when creating or composing CoValues */ withPermissions(permissions: SchemaPermissions): SnapshotRefSchema; } /** @internal */ export declare function createCoreSnapshotRefSchema(schema: S, options?: { cursorResolve?: R; }): CoreSnapshotRefSchema; export {}; //# sourceMappingURL=SnapshotRefSchema.d.ts.map