import type { ShallowMerge } from '../typescript';
import { type ModelLabels } from './labels';
import { type InferModelInput } from './model';
import { type IAnyMixin, type IMixin, type IMixinHelper, type IMixinInput, type InferMixinInput } from './schema-mixin';
export type Subset<T> = {
    [K in keyof T]?: T[K];
};
export type Simplify<T> = {
    [K in keyof T]: T[K];
} & {};
export type MergeMixins<TA extends IAnyMixin | undefined, TB extends IAnyMixin> = Simplify<TA extends IAnyMixin ? ShallowMerge<TA, TB> : TB>;
export declare function getReadHelpers<TName extends Readonly<string>>(h: IMixinHelper<TName>): {
    detail: {
        name: TName;
    };
    lookup: {
        name: `${TName}Lookup`;
    };
};
declare const readMixin: <TName extends Readonly<string>>(h: IMixinHelper<TName>) => {
    detail: {
        name: `${TName}Detail`;
    };
    lookup: {
        name: `${TName}Lookup`;
    };
};
export type ReadMixin<TName extends Readonly<string>> = ReturnType<typeof readMixin<TName>>;
declare const defaultMixin: <TName extends Readonly<string>>(h: IMixinHelper<TName>) => {};
export type DefaultMixin<TName extends Readonly<string>> = ReturnType<typeof defaultMixin<TName>>;
declare const searchMixin: <TName extends Readonly<string>>(h: IMixinHelper<TName>) => {
    summary: {
        name: `${TName}Summary`;
    };
    filters: {
        name: `${TName}Filters`;
    };
    sort: {
        name: `${TName}Sort`;
    };
};
export type SearchMixin<TName extends Readonly<string>> = ReturnType<typeof searchMixin<TName>>;
declare const writeMixin: <TName extends Readonly<string>>(h: IMixinHelper<TName>) => {
    input: {
        name: `${TName}Input`;
    };
};
export type WriteMixin<TName extends Readonly<string>> = ReturnType<typeof writeMixin<TName>>;
export type IModelNames<T extends object> = {
    [K in keyof T]: Readonly<string>;
};
export type InferPKeyBaseType<T extends IAnyMixin | undefined> = T extends IAnyMixin ? T['lookup'] extends object ? keyof InferModelInput<T['lookup']> | undefined : undefined : undefined;
export interface IModelEntityMetadata {
    primaryKey: string;
}
export declare class ModelSchema<TName extends Readonly<string> = Readonly<string>, T extends IAnyMixin | undefined = undefined, TEntityMeta extends IModelEntityMetadata | undefined = undefined> {
    static create<TName extends Readonly<string>>(name: TName): ModelSchema<TName>;
    readonly definition: Simplify<T>;
    readonly name: TName;
    protected readonly entityMetadata: TEntityMeta;
    constructor(name: TName, definition?: T, entityMetadata?: TEntityMeta);
    get labels(): ModelLabels;
    get helper(): IMixinHelper<TName>;
    custom<TInput extends IMixinInput>(input: TInput): ModelSchema<TName, MergeMixins<T, IMixin<TInput>>, TEntityMeta>;
    read<TInput extends InferMixinInput<ReadMixin<TName>>>(input: TInput): ModelSchema<TName, MergeMixins<T, IMixin<TInput>>, TEntityMeta>;
    search<TInput extends InferMixinInput<SearchMixin<TName>>>(input: TInput): ModelSchema<TName, MergeMixins<T, IMixin<TInput>>>;
    write<TInput extends InferMixinInput<WriteMixin<TName>>>(input: TInput): ModelSchema<TName, MergeMixins<T, IMixin<TInput>>>;
    entity<TEntityMeta extends {
        primaryKey: InferPKeyBaseType<T>;
    }>(meta: TEntityMeta): ModelSchema<TName, T, TEntityMeta extends IModelEntityMetadata ? TEntityMeta : undefined>;
    getEntityMetadata(): TEntityMeta;
}
export type AnyModelSchema = ModelSchema<any, any, any>;
export {};
//# sourceMappingURL=model-schema.d.ts.map