@kubb/plugin-ts 5.0.9 → 5.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/docs/overview.md +8 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
package/docs/overview.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# TypeScript
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The TypeScript plugin generates a type or interface for every schema in your OpenAPI spec, plus the request, response, and parameter types of each operation.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Kubb runs this plugin before the plugins that import its types, whatever the order of the `plugins` array.
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
|
|
@@ -16,8 +16,14 @@ No other plugins or packages are needed.
|
|
|
16
16
|
- `arrayType` writes arrays as `T[]` (default) or `Array<T>`.
|
|
17
17
|
- `group` splits the output into folders by tag or path. It does not work with `output.mode: 'file'`.
|
|
18
18
|
|
|
19
|
+
With the default OpenAPI adapter, `int64` fields are typed as `bigint`, while JSON responses hold numbers. Set `integerType: 'number'` on `adapterOas` for most JSON APIs.
|
|
20
|
+
|
|
21
|
+
See [Options](https://kubb.dev/extensions/kubb-labs/plugin-ts/options) for every option and its default.
|
|
22
|
+
|
|
19
23
|
## Example
|
|
20
24
|
|
|
25
|
+
The config below generates the types into `src/gen/types`.
|
|
26
|
+
|
|
21
27
|
```typescript [kubb.config.ts]
|
|
22
28
|
import { defineConfig } from 'kubb/config'
|
|
23
29
|
import { pluginTs } from '@kubb/plugin-ts'
|
|
@@ -30,8 +36,3 @@ export default defineConfig({
|
|
|
30
36
|
],
|
|
31
37
|
})
|
|
32
38
|
```
|
|
33
|
-
|
|
34
|
-
## See also
|
|
35
|
-
|
|
36
|
-
- [TypeScript](https://www.typescriptlang.org/)
|
|
37
|
-
- [TypeScript Compiler API](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API)
|
package/package.json
CHANGED