import * as EffectSchema from 'effect/Schema'; import type { AnyRelationSchema } from '../type/type.js'; /** * Entity function for creating schemas with a nicer API. * Takes a schema configuration object and a property ID mapping object. * * @example * ```typescript * const User = Entity.Schema({ * name: Type.String, * age: Type.Number, * }, { * name: "grc-20-id", * age: "grc-20-id" * }); * ``` */ type SchemaBuilder = (propertyId: any) => EffectSchema.Schema | EffectSchema.PropertySignature; type RelationKeys> = { [K in keyof T]: ReturnType extends AnyRelationSchema ? K : never; }[keyof T]; declare const relationTotalCountSchema: EffectSchema.optional; type RelationTotalCountSchema = typeof relationTotalCountSchema; type RelationTotalCountFields> = { [K in RelationKeys as `${Extract}TotalCount`]: RelationTotalCountSchema; }; export declare function Schema, const P extends { [K in keyof T]: Parameters[0]; }>(schemaTypes: T, mapping: { types: Array; properties: P; }): EffectSchema.Struct<{ [K in keyof T]: ReturnType & { id: string; }; } & RelationTotalCountFields>; export declare function encodeToGrc20Json(schema: EffectSchema.Schema, value: T): Record; export declare function decodeFromGrc20Json(schema: EffectSchema.Schema, grc20Data: Record): T; declare const EntityNotFoundError_base: new = {}>(args: import("effect/Types").Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & { readonly _tag: "EntityNotFoundError"; } & Readonly; export declare class EntityNotFoundError extends EntityNotFoundError_base<{ id: string; type: EffectSchema.Schema.AnyNoContext; cause?: unknown; }> { } export {}; //# sourceMappingURL=schema.d.ts.map