import type * as Schema from '../../../schema'; import type * as Data from '../../../data'; import type * as UID from '../../../uid'; import type { Array, Constants, Guard, String, Cast, If, Extends, MatchFirst, Or, StrictEqual, IsNever } from '../../../utils'; import type { Params } from '..'; type Pagination = { page: number; pageSize: number; pageCount: number; total: number; }; export type AnyDocument = { documentId: string; id: Data.ID; } & { [key: string]: any; }; export type Result = never> = If, Schema.NonPopulatableAttributeNames>, ExtractPopulate>, AnyDocument>; export type Document = never> = If, Schema.NonPopulatableAttributeNames>, Guard.Never, Schema.PopulatableAttributeNames>>, AnyDocument>; export type PartialDocument = never> = Partial>; export type PaginatedResult = never> = { results: Document[]; pagination: Pagination; }; /** * Attribute.GetValues override with extended values * * TODO: Make it recursive for populatable fields */ export type GetValues = Schema.NonPopulatableAttributeNames, TPopulate extends Schema.AttributeNames = Schema.PopulatableAttributeNames> = If> extends infer TKeys extends Schema.AttributeNames ? Data.Entity : never, AnyDocument>; type ExtractFields | undefined> = Extract>, Or, StrictEqual>>, never ], [ Extends>, ParseStringFields>> ], [ Extends>, ParseStringFields>>, Params.Fields.StringNotation>> ] ]>, Schema.NonPopulatableAttributeNames>; type ParseStringFields> = MatchFirst<[ [ StrictEqual, Schema.NonPopulatableAttributeNames ], [ Extends>, TFields ], [ Extends, Array.Values, ','>> ] ]>; type ExtractPopulate | undefined> = Extract>, IsNever>, never ], [ Extends>, ParseStringPopulate>> ], [ Extends>, ParseStringPopulate>>, Params.Populate.StringNotation>> ], [ Extends>, ParseStringPopulate>> ] ]>, Schema.PopulatableAttributeNames>; type ParsePopulateDotNotation> = Cast, '.'>[0], Schema.PopulatableAttributeNames>; type ParseStringPopulate> = MatchFirst<[ [ StrictEqual, Schema.PopulatableAttributeNames ], [ Extends, ParsePopulateDotNotation, ','>>, Params.Populate.StringNotation>> ], [ Extends, ParsePopulateDotNotation ] ], TPopulate>; export {}; //# sourceMappingURL=index.d.ts.map