import type { AggregationOperation, Aggregator, DateOperation, Operator, PlainPage, RecordData } from '@forestadmin/datasource-toolkit'; type RecursivePartial = { [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends object ? RecursivePartial : T[P]; }; /** Global schema which is generated by agent */ export type TSchema = Record; /** Collection name */ export type TCollectionName = Extract; /** Column name (no relations) */ export type TColumnName> = Extract; /** * Column name and Relation name * It only returns the relation name, excluding the related fields, in contrast to TFieldName. * */ export type TColumnNameAndRelationName> = Extract; /** Field name (with relations) */ export type TFieldName> = Extract; /** Type of a given field */ export type TFieldType = TCollectionName, C extends TFieldName = TFieldName> = (S[N]['plain'] & S[N]['flat'])[C]; /** Row type only with columns (all required) */ export type TSimpleRow = TCollectionName> = S[N]['plain']; /** Row type only with columns (all optional) */ export type TPartialSimpleRow = TCollectionName> = RecursivePartial>; /** Row type with columns and relationships (all required) */ export type TRow = TCollectionName> = S[N]['plain'] & S[N]['nested']; /** Row type with columns and relationships (all optional) */ export type TPartialRow = TCollectionName> = RecursivePartial>; export type TPartialFlatRow = TCollectionName> = RecursivePartial; export type TConditionTreeLeaf = TCollectionName> = { field: TFieldName; operator: Operator; value?: unknown; }; export type TConditionTreeBranch = TCollectionName> = { aggregator: Aggregator; conditions: Array | TConditionTreeLeaf>; }; export type TConditionTree = TCollectionName> = TConditionTreeBranch | TConditionTreeLeaf; export type TPaginatedFilter = TCollectionName> = TFilter & { sort?: Array>; page?: PlainPage; }; export type TSortClause = TCollectionName> = { field: TFieldName; ascending: boolean; }; export type TAggregateResult = TCollectionName> = { value: unknown; group: TPartialFlatRow; }; export interface TAggregation = TCollectionName> { field?: TFieldName; operation: AggregationOperation; groups?: Array<{ field: TFieldName; operation?: DateOperation; }>; } export type TFilter = TCollectionName> = { conditionTree?: TConditionTree; search?: string; searchExtended?: boolean; segment?: string; }; export {}; //# sourceMappingURL=templates.d.ts.map