Skip to content

Commit bbcdd3c

Browse files
authored
Merge pull request #1701 from hey-api/fix/client-nuxt-default-type
fix: type default value
2 parents 55c1ef0 + e86629b commit bbcdd3c

File tree

17 files changed

+741
-495
lines changed

17 files changed

+741
-495
lines changed

.changeset/hip-starfishes-explain.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@hey-api/client-nuxt': patch
3+
'@hey-api/openapi-ts': patch
4+
---
5+
6+
fix: correctly type default value for Nuxt client
+22-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

3-
import { createClient, createConfig } from '@hey-api/client-nuxt';
3+
import {
4+
type ClientOptions as DefaultClientOptions,
5+
type Config,
6+
createClient,
7+
createConfig,
8+
} from '@hey-api/client-nuxt';
49

5-
export const client = createClient(createConfig());
10+
import type { ClientOptions } from './types.gen';
11+
12+
/**
13+
* The `createClientConfig()` function will be called on client initialization
14+
* and the returned object will become the client's initial configuration.
15+
*
16+
* You may want to initialize your client this way instead of calling
17+
* `setConfig()`. This is useful for example if you're using Next.js
18+
* to ensure your client always has the correct values.
19+
*/
20+
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =
21+
(
22+
override?: Config<DefaultClientOptions & T>,
23+
) => Config<Required<DefaultClientOptions> & T>;
24+
25+
export const client = createClient(createConfig<ClientOptions>());

0 commit comments

Comments
 (0)