import type { BulkOperationResult, SelectFromCollectionSlug, } from "node_modules/payload/dist/collections/config/types"; import type { Options as CountOptions } from "node_modules/payload/dist/collections/operations/local/count"; import type { Options as CreateOptions } from "node_modules/payload/dist/collections/operations/local/create"; import type { ManyOptions as DeleteManyOptions } from "node_modules/payload/dist/collections/operations/local/delete"; import type { Options as FindOptions } from "node_modules/payload/dist/collections/operations/local/find"; import type { Options as FindByIDOptions } from "node_modules/payload/dist/collections/operations/local/findByID"; import type { ByIDOptions as UpdateFindByIDOptions, ManyOptions as UpdateManyOptions, } from "node_modules/payload/dist/collections/operations/local/update"; import type { CollectionSlug, SelectType, TransformCollectionWithSelect, } from "payload"; import type { Sort, Where } from "."; import type { Depth, DepthQuery } from "./depth"; import type { DefaultQueryMaxDepth } from "./object-path"; export type TypedTransformCollectionWithSelect< TSlug extends CollectionSlug, TDepth extends Depth, > = DepthQuery; export interface TypedCreateOptions< TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug, TDepth extends Depth, > extends Omit, "collection" | "depth"> { collection: TSlug; depth?: TDepth; } export interface TypedCountOptions< TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug, TQueryDepth extends Depth = DefaultQueryMaxDepth, > extends Omit, "collection" | "where"> { collection: TSlug; where?: Where, TQueryDepth>; } export interface TypedFindOptions< TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug, TDepth extends Depth, TQueryDepth extends Depth = DefaultQueryMaxDepth, > extends Omit< FindOptions, "collection" | "where" | "sort" | "depth" > { collection: TSlug; where?: Where, TQueryDepth>; sort?: Sort, TQueryDepth>; depth?: TDepth; } export interface TypedFindByIDOptions< TSlug extends CollectionSlug, TDisableErrors extends boolean, TSelect extends SelectFromCollectionSlug, TDepth extends Depth, > extends Omit< FindByIDOptions, "collection" | "depth" > { collection: TSlug; depth?: TDepth; } export interface TypedUpdateManyOptions< TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug, TDepth extends Depth, TQueryDepth extends Depth = DefaultQueryMaxDepth, > extends Omit< UpdateManyOptions, "collection" | "where" | "depth" | "sort" > { collection: TSlug; where?: Where, TQueryDepth>; sort?: Sort, TQueryDepth>; depth?: TDepth; } export interface TypedUpdateByIDOptions< TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug, TDepth extends Depth, > extends Omit, "collection" | "depth"> { collection: TSlug; depth?: TDepth; } export interface TypedDeleteManyOptions< TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug, TDepth extends Depth, TQueryDepth extends Depth = DefaultQueryMaxDepth, > extends Omit< DeleteManyOptions, "collection" | "where" | "depth" > { collection: TSlug; where?: Where, TQueryDepth>; depth?: TDepth; } export interface TypedBulkOperationResult< TSlug extends CollectionSlug, TSelect extends SelectType, TDepth extends Depth, > extends Omit, "docs"> { docs: DepthQuery[]; }