declare type RecordType = { _meta?: { query: any; }; }; declare type Values = T extends { [K in keyof T]: infer U; } ? U : never; declare type DataTypeExtractField = BaseType[Key] extends RecordType ? (null extends BaseType[Key] ? {} | null : {}) : BaseType[Key] extends RecordType[] ? {}[] : BaseType[Key]; declare type DataTypeExtractFieldsFromQuery = '*' extends Fields ? { [key in Exclude]: DataTypeExtractField; } : { [key in Fields & keyof (BaseType)]: DataTypeExtractField; }; interface ExtraFieldErrorType { error: 'extraFieldError'; } declare type DataTypeExtractFromQueryHash = '*' extends keyof QueryType ? { [key in Exclude<(keyof BaseType) | (keyof QueryType), '_meta' | '_params' | '*'>]: (key extends keyof BaseType ? (key extends keyof QueryType ? (QueryType[key] extends true ? DataTypeExtractField : DataTypeFromQuery) : DataTypeExtractField) : ExtraFieldErrorType); } : { [key in keyof QueryType]: (key extends keyof BaseType ? (QueryType[key] extends true ? DataTypeExtractField : DataTypeFromQuery) : ExtraFieldErrorType); }; declare type _DataTypeFromQuery = QueryType extends keyof BaseType | '*' ? DataTypeExtractFieldsFromQuery : QueryType extends Readonly<(keyof BaseType | '*')[]> ? DataTypeExtractFieldsFromQuery> : QueryType extends { as: string; } ? { error: 'type for alias field is not supported'; } | undefined : DataTypeExtractFromQueryHash; export declare type DataTypeFromQuery = BaseType extends any[] ? CheckAttributesField[] : null extends BaseType ? CheckAttributesField | null : CheckAttributesField; declare type CheckAttributesField = Q extends { attributes: infer R; } ? _DataTypeFromQuery : _DataTypeFromQuery; declare type IsAnyCompareLeftType = { __any: never; }; declare type CollectExtraFields = IsAnyCompareLeftType extends Type ? null : Type extends ExtraFieldErrorType ? Path : Type extends (infer R)[] ? _CollectExtraFields : Type extends object ? _CollectExtraFields : null; declare type _CollectExtraFields = keyof (Type) extends never ? null : Values<{ [key in keyof Type]: CollectExtraFields; }>; declare type SelectString = T extends string ? T : never; declare type _ValidateDataTypeExtraFileds = SelectString> extends never ? Type : { error: { extraFields: SelectString>; }; }; declare type ValidateDataTypeExtraFileds = _ValidateDataTypeExtraFileds, Type>; declare type RequestBase = { api: string; query: any; params?: any; _meta?: { data: any; }; }; declare type DataTypeBaseFromRequestType = R extends { _meta?: { data: infer DataType; }; } ? DataType : never; export declare type DataTypeFromRequest = ValidateDataTypeExtraFileds, R['query']>>; export {};