import express from "express"; import { Document } from "mongoose"; import { FernsRouterOptions } from "./api"; import { User } from "./auth"; export interface FernsTransformer { transform?: (obj: Partial, method: "create" | "update", user?: User) => Partial | undefined; serialize?: (obj: T, user?: User) => Partial | undefined; } export declare function AdminOwnerTransformer(options: { anonReadFields?: string[]; authReadFields?: string[]; ownerReadFields?: string[]; adminReadFields?: string[]; anonWriteFields?: string[]; authWriteFields?: string[]; ownerWriteFields?: string[]; adminWriteFields?: string[]; }): FernsTransformer; export declare function transform(options: FernsRouterOptions, data: Partial | Partial[], method: "create" | "update", user?: User): Partial | (Partial | undefined)[] | undefined; export declare function serialize(req: express.Request, options: FernsRouterOptions, data: (Document & T) | (Document & T)[]): Partial | (Partial | undefined)[] | undefined; /** * Default response handler for FernsRouter. Calls toObject on each doc and returns the result, * using transformers.serializer if provided. */ export declare function defaultResponseHandler(doc: (Document & T) | (Document & T)[] | null, method: "list" | "create" | "read" | "update", request: express.Request, options: FernsRouterOptions): Promise | (Partial | undefined)[] | null | undefined>;