UNPKG

1.29 kBTypeScriptView Raw
1/**
2 * The API surface of this module has been heavily inspired by the "type-graphql" library (https://github.com/MichalLytek/type-graphql), originally designed & released by Michal Lytek.
3 * In the v6 major release of NestJS, we introduced the code-first approach as a compatibility layer between this package and the `@nestjs/graphql` module.
4 * Eventually, our team decided to reimplement all the features from scratch due to a lack of flexibility.
5 * To avoid numerous breaking changes, the public API is backward-compatible and may resemble "type-graphql".
6 */
7import { EnumMetadataValuesMap } from '../schema-builder/metadata';
8/**
9 * Interface defining options that can be passed to `registerEnumType` function.
10 */
11export interface EnumOptions<T extends object = any> {
12 /**
13 * Name of the enum.
14 */
15 name: string;
16 /**
17 * Description of the enum.
18 */
19 description?: string;
20 /**
21 * A map of options for the values of the enum.
22 */
23 valuesMap?: EnumMetadataValuesMap<T>;
24}
25/**
26 * Registers a GraphqQL enum type based on the passed enumerator reference.
27 * @param options
28 */
29export declare function registerEnumType<T extends object = any>(enumRef: T, options?: EnumOptions<T>): void;
30//# sourceMappingURL=register-enum-type.factory.d.ts.map
\No newline at end of file