import { PluginFunction } from '@graphql-codegen/plugin-helpers'; import { RawTypesConfig } from '@graphql-codegen/visitor-plugin-common'; import { TsVisitor } from './visitor'; import { TsIntrospectionVisitor } from './introspection-visitor'; export * from './typescript-variables-to-object'; export * from './visitor'; export interface TypeScriptPluginConfig extends RawTypesConfig { /** * @name avoidOptionals * @type boolean * @description This will cause the generator to avoid using TypeScript optionals (`?`), * so the following definition: `type A { myField: String }` will output `myField: Maybe` * instead of `myField?: Maybe`. * @default false * * @example * ```yml * generates: * path/to/file.ts: * plugins: * - typescript * config: * avoidOptionals: true * ``` */ avoidOptionals?: boolean; /** * @name constEnums * @type boolean * @description Will prefix every generated `enum` with `const`, you can read more * about const enums {@link https://www.typescriptlang.org/docs/handbook/enums.html|here}. * @default false * * @example * ```yml * generates: * path/to/file.ts: * plugins: * - typescript * config: * constEnums: true * ``` */ constEnums?: boolean; /** * @name enumsAsTypes * @type boolean * @description Generates enum as TypeScript `type` instead of `enum`. Useful it you wish to genereate `.d.ts` declartion file instead of `.ts` * @default false * * @example * ```yml * generates: * path/to/file.ts: * plugins: * - typescript * config: * enumsAsTypes: true * ``` */ enumsAsTypes?: boolean; /** * @name immutableTypes * @type boolean * @description Generates immutable types by adding `readonly` to properties and uses `ReadonlyArray`. * @default false * * @example * ```yml * generates: * path/to/file.ts: * plugins: * - typescript * config: * immutableTypes: true * ``` */ immutableTypes?: boolean; /** * @name maybeValue * @type string * @description Allow to override the type value of `Maybe`. * @default T | null * * @example Allow undefined * ```yml * generates: * path/to/file.ts: * plugins: * - typescript * config: * maybeValue: T | null | undefined * ``` */ maybeValue?: string; /** * @name outputTypeGraphQL * @type boolean * @description Output objects compatible with type-graphql * @default false * * @example * * ```yml * generates: * path/to/file.ts: * plugins: * - typescript * config: * outputTypeGraphQL: true * ``` */ outputTypeGraphQL?: boolean; } export declare const plugin: PluginFunction; export { TsVisitor, TsIntrospectionVisitor };