Skip to content

Commit 492a4e7

Browse files
committed
chore: fix types
1 parent 7322c67 commit 492a4e7

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

docs/openapi-ts/plugins/pinia-colada.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ The Pinia Colada plugin for Hey API generates functions and query keys from your
3535

3636
## Installation
3737

38-
::: tip Nuxt
39-
When using this plugin in a Nuxt app, prefer the [ofetch client](/openapi-ts/clients/ofetch) for universal compatibility.
40-
41-
The [nuxt client](/openapi-ts/clients/nuxt) is tailored for working directly with Nuxt composables (`$fetch` / `useFetch` / `useAsyncData`) and is not intended as a universal HTTP client for libraries like `@pinia/colada`.
42-
:::
43-
4438
In your [configuration](/openapi-ts/get-started), add `@pinia/colada` to your plugins and you'll be ready to generate Pinia Colada artifacts. :tada:
4539

4640
```js
@@ -54,6 +48,12 @@ export default {
5448
};
5549
```
5650

51+
::: tip
52+
When using this plugin in a Nuxt app, prefer the [ofetch client](/openapi-ts/clients/ofetch) for universal compatibility.
53+
54+
The [nuxt client](/openapi-ts/clients/nuxt) is tailored for working directly with Nuxt composables (`$fetch` / `useFetch` / `useAsyncData`) and is not intended as a universal HTTP client for libraries like `@pinia/colada`.
55+
:::
56+
5757
## Output
5858

5959
The Pinia Colada plugin will generate the following artifacts, depending on the input specification.

packages/openapi-ts-tests/main/test/clients.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ const __dirname = path.dirname(__filename);
1616
const clients: ReadonlyArray<PluginClientNames> = [
1717
'@hey-api/client-axios',
1818
'@hey-api/client-fetch',
19-
'@hey-api/client-ofetch',
2019
'@hey-api/client-next',
2120
'@hey-api/client-nuxt',
21+
'@hey-api/client-ofetch',
2222
];
2323

2424
for (const client of clients) {

packages/openapi-ts/src/plugins/@hey-api/client-core/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export interface PluginHandler {
1010
(...args: Parameters<HeyApiClientAngularPlugin['Handler']>): void;
1111
(...args: Parameters<HeyApiClientAxiosPlugin['Handler']>): void;
1212
(...args: Parameters<HeyApiClientFetchPlugin['Handler']>): void;
13-
(...args: Parameters<HeyApiClientOfetchPlugin['Handler']>): void;
1413
(...args: Parameters<HeyApiClientNextPlugin['Handler']>): void;
1514
(...args: Parameters<HeyApiClientNuxtPlugin['Handler']>): void;
15+
(...args: Parameters<HeyApiClientOfetchPlugin['Handler']>): void;
1616
}
1717

1818
/**
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ICodegenSymbolSelector } from '@hey-api/codegen-core';
1+
import type { Selector } from '@hey-api/codegen-core';
22

33
import type { Plugin } from '../../types';
44

@@ -11,15 +11,13 @@ export type IApi = {
1111
* - `client`: never
1212
* @returns Selector array
1313
*/
14-
getSelector: (type: SelectorType, value?: string) => ICodegenSymbolSelector;
14+
getSelector: (type: SelectorType, value?: string) => Selector;
1515
};
1616

1717
export class Api implements IApi {
1818
constructor(public meta: Plugin.Name<'@hey-api/client-ofetch'>) {}
1919

20-
getSelector(
21-
...args: ReadonlyArray<string | undefined>
22-
): ICodegenSymbolSelector {
23-
return [this.meta.name, ...(args as ICodegenSymbolSelector)];
20+
getSelector(...args: ReadonlyArray<string | undefined>): Selector {
21+
return [this.meta.name, ...(args as Selector)];
2422
}
2523
}

packages/openapi-ts/tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ export default defineConfig((options) => ({
3939
'client-axios',
4040
'client-core',
4141
'client-fetch',
42-
'client-ofetch',
4342
'client-next',
4443
'client-nuxt',
44+
'client-ofetch',
4545
];
4646

4747
for (const pluginName of pluginNames) {

0 commit comments

Comments
 (0)