import type { SingleKeyObject } from 'type-fest';
import type { DomainRecords, DomainRows, ExactRecords } from './index.ts';
type ProvidedDomainKeys = keyof DomainRecords & `${string}?`;
type DbDomainKeys = Exclude<keyof DomainRecords, ProvidedDomainKeys>;
type ProvidedExactKeys = keyof ExactRecords & `${string}?`;
type DbExactKeys = Exclude<keyof ExactRecords, ProvidedExactKeys>;
type KeyedDomainRecords = {
    [Domain in DbDomainKeys as `${string}${Domain}`]: GettablePossibleEmpty<DomainRecords[Domain]>;
};
type KeyedProvidedDomainRecords = {
    [Domain in ProvidedDomainKeys as `${string}${Domain}${string}`]: GettablePossibleEmpty<DomainRecords[Domain]>;
};
type StripColon<T extends string> = T extends `:${infer Rest}` ? Rest : T;
type DomainRowsRecords = {
    [Domain in DbDomainKeys as `[]${StripColon<Domain>}`]: GettablePossibleEmpty<DomainRows>;
};
type DbExactRecords = {
    [Name in DbExactKeys]: GettablePossibleEmpty<ExactRecords[Name]>;
};
type DbProvidedRecord = {
    [Name in ProvidedExactKeys as `${Name}${string}`]: GettablePossibleEmpty<ExactRecords[Name]>;
};
declare const emptyObjectSymbol: unique symbol;
export type EmptyObject = {
    [emptyObjectSymbol]?: never;
};
export interface Records extends KeyedDomainRecords, KeyedProvidedDomainRecords, DomainRowsRecords, DbExactRecords, DbProvidedRecord {
    [key: string]: unknown;
}
export type RecordNameToType<T extends string> = T extends keyof Records ? Records[T] : unknown;
export type DomainNameToType<T extends string> = T extends keyof DomainRecords ? DomainRecords[T] : unknown;
declare const providedRecordSymbol: unique symbol;
export type ProvidedRecord<T> = T & {
    [providedRecordSymbol]: never;
};
export type GettablePossibleEmpty<Data> = keyof Data extends never ? EmptyObject : // eslint-disable-next-line @typescript-eslint/no-explicit-any
Partial<Data> & {
    [key: string]: any;
} extends Data ? Data : SingleKeyObject<Data> extends never ? Data | EmptyObject : {
    [K in keyof Data]+?: Data[K];
};
export {};
