import { T as AnyFallback, b as TransformerFn, l as DispatchOption, n as ResultSingleHookContext, t as DataSingleHookContext, x as TransformerInputFn } from "./hook-context-BsxU1vfN.mjs"; import { HookContext, NextFunction, Query } from "@feathersjs/feathers"; //#region src/hooks/transform-data/transform-data.hook.d.ts type Data = AnyFallback, Record>; /** * Transforms each item in `context.data` using the provided transformer function. * The transformer receives each item and can mutate it in place or return a new object. * Commonly used with built-in transformers like `lowercase`, `trim`, or `setNow`. * * @example * ```ts * import { transformData, lowercase } from 'feathers-utils/transformers' * * app.service('users').hooks({ * before: { create: [transformData(item => lowercase(item, 'email'))] } * }) * ``` * * @see https://utils.feathersjs.com/hooks/transform-data.html */ declare const transformData: >(transformer: TransformerInputFn) => (context: H, next?: NextFunction) => Promise; //#endregion //#region src/hooks/transform-query/transform-query.hook.d.ts /** * Transforms `context.params.query` using the provided transformer function. * The transformer receives the current query and can return a modified version. * Useful for normalizing, sanitizing, or enriching queries before they hit the database. * * @example * ```ts * import { transformQuery } from 'feathers-utils/transformers' * * app.service('users').hooks({ * before: { find: [transformQuery((query) => ({ ...query, active: true }))] } * }) * ``` * * @see https://utils.feathersjs.com/hooks/transform-query.html */ declare const transformQuery: (transformer: TransformerFn) => { (context: H): void; (context: H, next: NextFunction): Promise; }; //#endregion //#region src/hooks/transform-result/transform-result.hook.d.ts type Result = AnyFallback, Record>; type TransformResultOptions = { dispatch?: DispatchOption; }; /** * Transforms each item in `context.result` using the provided transformer function. * The transformer receives each item and can mutate it in place or return a new object. * Optionally operates on `context.dispatch` via the `dispatch` option. * * @example * ```ts * import { transformResult, omit } from 'feathers-utils/transformers' * * app.service('users').hooks({ * after: { all: [transformResult(item => omit(item, 'password'))] } * }) * ``` * * @see https://utils.feathersjs.com/hooks/transform-result.html */ declare const transformResult: >(transformer: TransformerInputFn, options?: TransformResultOptions) => (context: H, next?: NextFunction) => Promise; //#endregion export { transformData as i, transformResult as n, transformQuery as r, TransformResultOptions as t }; //# sourceMappingURL=transform-result.hook-C9wMLWs2.d.mts.map