UNPKG

1.07 kBTypeScriptView Raw
1import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface';
2import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util';
3/**
4 * @publicApi
5 */
6export interface ParseUUIDPipeOptions {
7 version?: '3' | '4' | '5' | '7';
8 errorHttpStatusCode?: ErrorHttpStatusCode;
9 exceptionFactory?: (errors: string) => any;
10 optional?: boolean;
11}
12/**
13 * Defines the built-in ParseUUID Pipe
14 *
15 * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes)
16 *
17 * @publicApi
18 */
19export declare class ParseUUIDPipe implements PipeTransform<string> {
20 protected readonly options?: ParseUUIDPipeOptions;
21 protected static uuidRegExps: {
22 3: RegExp;
23 4: RegExp;
24 5: RegExp;
25 7: RegExp;
26 all: RegExp;
27 };
28 private readonly version;
29 protected exceptionFactory: (errors: string) => any;
30 constructor(options?: ParseUUIDPipeOptions);
31 transform(value: string, metadata: ArgumentMetadata): Promise<string>;
32 protected isUUID(str: unknown, version?: string): any;
33}