import type { Params } from './index'; import type * as Schema from '../../schema'; import type * as Data from '../../data'; import type { Array, Constants, Guard, String, Cast, If, MatchFirst, StrictEqual, Or, Extends, IsNever } from '../../utils'; import type * as UID from '../../uid'; type Pagination = { page: number; pageSize: number; pageCount: number; total: number; }; type AnyEntity = { id: Params.Attribute.ID; } & { [key: string]: any; }; export type Result = never> = If, Schema.NonPopulatableAttributeNames>, ExtractPopulate>, AnyEntity>; export type Entity = never> = If, Schema.NonPopulatableAttributeNames>, Guard.Never, Schema.PopulatableAttributeNames>>, AnyEntity>; export type PartialEntity = never> = Partial>; export type PaginatedResult = never> = { results: Entity[]; 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, AnyEntity>; type ExtractFields | undefined> = Extract>, Or, StrictEqual>>, never ], [ Extends>, ParseStringFields>> ] ], [ Extends>, ParseStringFields>>, Params.Fields.StringNotation>> ]>, Schema.NonPopulatableAttributeNames>; type ParseStringFields> = TFields; type ExtractPopulate | undefined> = Extract>, IsNever>, never ], [ Extends>, ParseStringPopulate>> ], [ Extends>, ParseStringPopulate>>, Params.Populate.StringNotation>> ], [ Extends>, ParseStringPopulate>> ] ]>, Schema.NonPopulatableAttributeNames>; type ParsePopulateDotNotation> = Cast, '.'>[0], Schema.PopulatableAttributeNames>; type ParseStringPopulate> = MatchFirst<[ [ StrictEqual, Schema.PopulatableAttributeNames ], [ Extends, ParsePopulateDotNotation, ','>>, Params.Populate.StringNotation>> ], [ Extends, ParsePopulateDotNotation ] ], TPopulate>; export {}; //# sourceMappingURL=result.d.ts.map