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<any, any, any> | EffectSchema.PropertySignature<any, any, any, any, any, any, any>;
type RelationKeys<T extends Record<string, SchemaBuilder>> = {
    [K in keyof T]: ReturnType<T[K]> extends AnyRelationSchema ? K : never;
}[keyof T];
declare const relationTotalCountSchema: EffectSchema.optional<typeof EffectSchema.Number>;
type RelationTotalCountSchema = typeof relationTotalCountSchema;
type RelationTotalCountFields<T extends Record<string, SchemaBuilder>> = {
    [K in RelationKeys<T> as `${Extract<K, string>}TotalCount`]: RelationTotalCountSchema;
};
export declare function Schema<const T extends Record<string, SchemaBuilder>, const P extends {
    [K in keyof T]: Parameters<T[K]>[0];
}>(schemaTypes: T, mapping: {
    types: Array<string>;
    properties: P;
}): EffectSchema.Struct<{
    [K in keyof T]: ReturnType<T[K]> & {
        id: string;
    };
} & RelationTotalCountFields<T>>;
export declare function encodeToGrc20Json<T extends object, E>(schema: EffectSchema.Schema<T, E>, value: T): Record<string, unknown>;
export declare function decodeFromGrc20Json<T extends object, E>(schema: EffectSchema.Schema<T, E>, grc20Data: Record<string, unknown>): T;
declare const EntityNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
    readonly _tag: "EntityNotFoundError";
} & Readonly<A>;
export declare class EntityNotFoundError extends EntityNotFoundError_base<{
    id: string;
    type: EffectSchema.Schema.AnyNoContext;
    cause?: unknown;
}> {
}
export {};
//# sourceMappingURL=schema.d.ts.map