Initial commit - Event Planner application
This commit is contained in:
42
node_modules/@nestjs/common/interfaces/features/pipe-transform.interface.d.ts
generated
vendored
Normal file
42
node_modules/@nestjs/common/interfaces/features/pipe-transform.interface.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Type } from '../type.interface';
|
||||
import { Paramtype } from './paramtype.interface';
|
||||
export type Transform<T = any> = (value: T, metadata: ArgumentMetadata) => any;
|
||||
/**
|
||||
* Interface describing a pipe implementation's `transform()` method metadata argument.
|
||||
*
|
||||
* @see [Pipes](https://docs.nestjs.com/pipes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface ArgumentMetadata {
|
||||
/**
|
||||
* Indicates whether argument is a body, query, param, or custom parameter
|
||||
*/
|
||||
readonly type: Paramtype;
|
||||
/**
|
||||
* Underlying base type (e.g., `String`) of the parameter, based on the type
|
||||
* definition in the route handler.
|
||||
*/
|
||||
readonly metatype?: Type<any> | undefined;
|
||||
/**
|
||||
* String passed as an argument to the decorator.
|
||||
* Example: `@Body('userId')` would yield `userId`
|
||||
*/
|
||||
readonly data?: string | undefined;
|
||||
}
|
||||
/**
|
||||
* Interface describing implementation of a pipe.
|
||||
*
|
||||
* @see [Pipes](https://docs.nestjs.com/pipes)
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface PipeTransform<T = any, R = any> {
|
||||
/**
|
||||
* Method to implement a custom pipe. Called with two parameters
|
||||
*
|
||||
* @param value argument before it is received by route handler method
|
||||
* @param metadata contains metadata about the value
|
||||
*/
|
||||
transform(value: T, metadata: ArgumentMetadata): R;
|
||||
}
|
||||
Reference in New Issue
Block a user