import type { AggregateResult, Aggregation, Caller, CollectionSchema, DataSourceDecorator, Filter, PaginatedFilter, Projection, RecordData } from '@forestadmin/datasource-toolkit'; import { CollectionDecorator } from '@forestadmin/datasource-toolkit'; /** * This decorator renames fields. * * It works on one side, by rewriting all references to fields in aggregations, filters, projections * and on the other, by rewriting records and aggregation results which are returned by the * subCollection. */ export default class RenameFieldCollectionDecorator extends CollectionDecorator { readonly dataSource: DataSourceDecorator; private readonly fromChildCollection; private readonly toChildCollection; /** Rename a field from the collection */ renameField(currentName: string, newName: string): void; protected refineSchema(childSchema: CollectionSchema): CollectionSchema; protected refineFilter(caller: Caller, filter?: PaginatedFilter): Promise; create(caller: Caller, records: RecordData[]): Promise; list(caller: Caller, filter: PaginatedFilter, projection: Projection): Promise; update(caller: Caller, filter: Filter, patch: RecordData): Promise; aggregate(caller: Caller, filter: Filter, aggregation: Aggregation, limit?: number): Promise; private markAllSchemaAsDirty; /** Convert field path from child collection to this collection */ private pathFromChildCollection; /** Convert field path from this collection to child collection */ private pathToChildCollection; /** Convert record from this collection to the child collection */ private recordToChildCollection; /** Convert record from the child collection to this collection */ private recordFromChildCollection; } //# sourceMappingURL=collection.d.ts.map