From a0a0101da72564e3a473605d104417e5189de4fd Mon Sep 17 00:00:00 2001 From: Lubos Date: Tue, 3 Mar 2026 23:09:58 +0100 Subject: [PATCH] chore: improve preset types --- dev/hey-api.ts | 2 +- dev/playground.ts | 2 +- dev/python/plugins.ts | 2 +- dev/python/presets.ts | 3 ++- dev/typescript/plugins.ts | 2 +- dev/typescript/presets.ts | 3 ++- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dev/hey-api.ts b/dev/hey-api.ts index 7abbee273..6ab5e9305 100644 --- a/dev/hey-api.ts +++ b/dev/hey-api.ts @@ -1,5 +1,5 @@ // @ts-ignore -import type { CreateClientConfig } from './client/client.gen'; +import type { CreateClientConfig } from './.gen/typescript/client.gen'; // @ts-ignore export const createClientConfig: CreateClientConfig = (config) => ({ diff --git a/dev/playground.ts b/dev/playground.ts index a81b45d17..b44778b9b 100644 --- a/dev/playground.ts +++ b/dev/playground.ts @@ -1,7 +1,7 @@ import type { DefinePlugin, IR } from '@hey-api/openapi-ts'; // import { createOpencode } from '@opencode-ai/sdk'; -import { PetStore } from './.gen/sdk.gen.ts'; +import { PetStore } from './.gen/typescript/sdk.gen.ts'; type MyPluginConfig = { readonly name: 'myplugin' }; type MyPlugin = DefinePlugin; diff --git a/dev/python/plugins.ts b/dev/python/plugins.ts index cd6698d7d..45539567f 100644 --- a/dev/python/plugins.ts +++ b/dev/python/plugins.ts @@ -1,6 +1,6 @@ import type { UserConfig } from '@hey-api/openapi-python'; -type PluginConfig = NonNullable[number]>; +export type PluginConfig = NonNullable[number]>; export function sdk( options?: Omit, 'name'>, diff --git a/dev/python/presets.ts b/dev/python/presets.ts index 6d9062ac3..e1df773ce 100644 --- a/dev/python/presets.ts +++ b/dev/python/presets.ts @@ -1,3 +1,4 @@ +import type { PluginConfig } from './plugins'; import { pydantic, sdk } from './plugins'; export const presets = { @@ -19,7 +20,7 @@ export const presets = { sdk(), pydantic(), ], -} as const; +} as const satisfies Record ReadonlyArray>; export type PresetKey = keyof typeof presets; diff --git a/dev/typescript/plugins.ts b/dev/typescript/plugins.ts index 9066c5da7..e5a9080a1 100644 --- a/dev/typescript/plugins.ts +++ b/dev/typescript/plugins.ts @@ -1,6 +1,6 @@ import type { UserConfig } from '@hey-api/openapi-ts'; -type PluginConfig = NonNullable[number]>; +export type PluginConfig = NonNullable[number]>; export function typescript( options?: Omit, 'name'>, diff --git a/dev/typescript/presets.ts b/dev/typescript/presets.ts index b27cd46a7..c808b411e 100644 --- a/dev/typescript/presets.ts +++ b/dev/typescript/presets.ts @@ -1,3 +1,4 @@ +import type { PluginConfig } from './plugins'; import { sdk, tanstackReactQuery, transformers, typescript, valibot, zod } from './plugins'; export const presets = { @@ -36,7 +37,7 @@ export const presets = { valibot({ metadata: true }), zod({ metadata: true }), ], -} as const; +} as const satisfies Record ReadonlyArray>; export type PresetKey = keyof typeof presets; -- 2.51.2