@graphql-codegen/typescript
Advanced tools
Comparing version 0.18.1-alpha.59 to 0.18.1-alpha.63
@@ -6,8 +6,91 @@ import { PluginFunction } from '@graphql-codegen/plugin-helpers'; | ||
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<string>` | ||
* instead of `myField?: Maybe<string>`. | ||
* @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; | ||
} | ||
export declare const plugin: PluginFunction<TypeScriptPluginConfig>; |
@@ -6,8 +6,91 @@ import { PluginFunction } from '@graphql-codegen/plugin-helpers'; | ||
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<string>` | ||
* instead of `myField?: Maybe<string>`. | ||
* @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; | ||
} | ||
export declare const plugin: PluginFunction<TypeScriptPluginConfig>; |
{ | ||
"name": "@graphql-codegen/typescript", | ||
"version": "0.18.1-alpha.59+c8b59c87", | ||
"version": "0.18.1-alpha.63+3b44d0d5", | ||
"description": "GraphQL Code Generator plugin for generating TypeScript types", | ||
@@ -12,8 +12,8 @@ "repository": "git@github.com:dotansimha/graphql-code-generator.git", | ||
"dependencies": { | ||
"@graphql-codegen/plugin-helpers": "0.18.1-alpha.59+c8b59c87", | ||
"@graphql-codegen/visitor-plugin-common": "0.18.1-alpha.59+c8b59c87", | ||
"@graphql-codegen/plugin-helpers": "0.18.1-alpha.63+3b44d0d5", | ||
"@graphql-codegen/visitor-plugin-common": "0.18.1-alpha.63+3b44d0d5", | ||
"tslib": "1.9.3" | ||
}, | ||
"devDependencies": { | ||
"@graphql-codegen/testing": "0.18.1-alpha.59+c8b59c87", | ||
"@graphql-codegen/testing": "0.18.1-alpha.63+3b44d0d5", | ||
"graphql": "14.1.1", | ||
@@ -34,3 +34,3 @@ "jest": "24.5.0", | ||
}, | ||
"gitHead": "c8b59c8737fdc9e68dd8dbb3b8640ef4d64b7aaf" | ||
"gitHead": "3b44d0d5ef0a11fb9e6d07ca1655aab61b3068d6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
45084
670