1 | import { ClassSerializerContextOptions } from './class-serializer.interfaces';
|
2 | import { Observable } from 'rxjs';
|
3 | import { CallHandler, ExecutionContext, NestInterceptor } from '../interfaces';
|
4 | import { ClassTransformOptions } from '../interfaces/external/class-transform-options.interface';
|
5 | import { TransformerPackage } from '../interfaces/external/transformer-package.interface';
|
6 | export interface PlainLiteralObject {
|
7 | [key: string]: any;
|
8 | }
|
9 |
|
10 |
|
11 |
|
12 | export interface ClassSerializerInterceptorOptions extends ClassTransformOptions {
|
13 | transformerPackage?: TransformerPackage;
|
14 | }
|
15 |
|
16 |
|
17 |
|
18 | export declare class ClassSerializerInterceptor implements NestInterceptor {
|
19 | protected readonly reflector: any;
|
20 | protected readonly defaultOptions: ClassSerializerInterceptorOptions;
|
21 | constructor(reflector: any, defaultOptions?: ClassSerializerInterceptorOptions);
|
22 | intercept(context: ExecutionContext, next: CallHandler): Observable<any>;
|
23 | /**
|
24 | * Serializes responses that are non-null objects nor streamable files.
|
25 | */
|
26 | serialize(response: PlainLiteralObject | Array<PlainLiteralObject>, options: ClassSerializerContextOptions): PlainLiteralObject | Array<PlainLiteralObject>;
|
27 | transformToPlain(plainOrClass: any, options: ClassSerializerContextOptions): PlainLiteralObject;
|
28 | protected getContextOptions(context: ExecutionContext): ClassSerializerContextOptions | undefined;
|
29 | }
|