| 15 | } |
| 16 | |
| 17 | export interface SourceTypeModule { |
| 18 | /** |
| 19 | * The module for where to look for the types. This uses the node resolution algorithm via require.resolve, |
| 20 | * so if this lives in node_modules, you can just provide the module name otherwise you should provide the |
| 21 | * absolute path to the file. |
| 22 | */ |
| 23 | module: string |
| 24 | /** |
| 25 | * When we import the module, we use `import * as ____` to prevent conflicts. This alias should be a name |
| 26 | * that doesn't conflict with any other types, usually a short lowercase name. |
| 27 | */ |
| 28 | alias: string |
| 29 | /** |
| 30 | * Provides a custom approach to matching for the type |
| 31 | * |
| 32 | * If not provided, the default implementation is: |
| 33 | * |
| 34 | * (type) => [ new RegExp(`(?:interface|type|class|enum)\\s+(${type.name})\\W`, "g"), ] |
| 35 | */ |
| 36 | typeMatch?: (type: GraphQLNamedType, defaultRegex: RegExp) => RegExp | RegExp[] |
| 37 | /** |
| 38 | * A list of typesNames or regular expressions matching type names that should be resolved by this import. |
| 39 | * Provide an empty array if you wish to use the file for context and ensure no other types are matched. |
| 40 | */ |
| 41 | onlyTypes?: (string | RegExp)[] |
| 42 | /** |
| 43 | * By default the import is configured `import * as alias from`, setting glob to false will change this to |
| 44 | * `import alias from` |
| 45 | */ |
| 46 | glob?: false |
| 47 | } |
| 48 | |
| 49 | export interface SourceTypesConfigOptions { |
| 50 | /** Any headers to prefix on the generated type file */ |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…