Skip to content

Commit

Permalink
fix: type default value
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlubos committed Feb 10, 2025
1 parent 55c1ef0 commit e86629b
Show file tree
Hide file tree
Showing 17 changed files with 741 additions and 495 deletions.
6 changes: 6 additions & 0 deletions .changeset/hip-starfishes-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hey-api/client-nuxt': patch
'@hey-api/openapi-ts': patch
---

fix: correctly type default value for Nuxt client
24 changes: 22 additions & 2 deletions examples/openapi-ts-nuxt/client/client.gen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
// This file is auto-generated by @hey-api/openapi-ts

import { createClient, createConfig } from '@hey-api/client-nuxt';
import {
type ClientOptions as DefaultClientOptions,
type Config,
createClient,
createConfig,
} from '@hey-api/client-nuxt';

export const client = createClient(createConfig());
import type { ClientOptions } from './types.gen';

/**
* The `createClientConfig()` function will be called on client initialization
* and the returned object will become the client's initial configuration.
*
* You may want to initialize your client this way instead of calling
* `setConfig()`. This is useful for example if you're using Next.js
* to ensure your client always has the correct values.
*/
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =
(
override?: Config<DefaultClientOptions & T>,
) => Config<Required<DefaultClientOptions> & T>;

export const client = createClient(createConfig<ClientOptions>());
Loading

0 comments on commit e86629b

Please sign in to comment.