Skip to content

Commit

Permalink
fix: export more types to resolve TypeScript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlubos committed Aug 11, 2024
1 parent 8ac24a6 commit 7825a2f
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .changeset/silent-readers-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hey-api/client-axios': patch
'@hey-api/client-fetch': patch
---

fix: export more types to resolve TypeScript errors
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from '@hey-api/openapi-ts'

export default defineConfig({
client: '@hey-api/client-axios',
client: '@hey-api/client-fetch',
input:
'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml',
// 'https://raw.githubusercontent.com/Redocly/museum-openapi-example/main/openapi.yaml',
Expand Down
2 changes: 1 addition & 1 deletion examples/openapi-ts-tanstack-vue-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"build-only": "vite build",
"build": "run-p type-check \"build-only {@}\" --",
"build": "run-p typecheck \"build-only {@}\" --",
"dev": "vite",
"format": "prettier --write src/",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import { describe, expect,it } from 'vitest'
import { describe, expect, it } from 'vitest'

import HelloWorld from '../HelloWorld.vue'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
import { computed,ref } from 'vue'
import { computed, ref } from 'vue'

export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
Expand Down
2 changes: 1 addition & 1 deletion examples/openapi-ts-tanstack-vue-query/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fileURLToPath } from 'node:url'

import { configDefaults,defineConfig, mergeConfig } from 'vitest/config'
import { configDefaults, defineConfig, mergeConfig } from 'vitest/config'

import viteConfig from './vite.config'

Expand Down
9 changes: 8 additions & 1 deletion packages/client-axios/src/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
export { createClient } from '../';
export type { Client, Config, Options, RequestResult } from '../types';
export type {
Client,
Config,
Options,
RequestOptions,
RequestOptionsBase,
RequestResult,
} from '../types';
export {
createConfig,
formDataBodySerializer,
Expand Down
13 changes: 12 additions & 1 deletion packages/client-fetch/src/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
export { createClient } from '../';
export type { Client, Config, Options, RequestResult } from '../types';
export type {
Client,
Config,
Options,
RequestOptions,
RequestOptionsBase,
RequestResult,
} from '../types';
export {
type BodySerializer,
createConfig,
formDataBodySerializer,
jsonBodySerializer,
type Middleware,
type QuerySerializer,
type QuerySerializerOptions,
urlSearchParamsBodySerializer,
} from '../utils';
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
export { createClient } from './core/';
export type { Client, Config, Options, RequestResult } from './core/types';
export type {
Client,
Config,
Options,
RequestOptions,
RequestOptionsBase,
RequestResult,
} from './core/types';
export {
createConfig,
formDataBodySerializer,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
export { createClient } from './core/';
export type { Client, Config, Options, RequestResult } from './core/types';
export type {
Client,
Config,
Options,
RequestOptions,
RequestOptionsBase,
RequestResult,
} from './core/types';
export {
createConfig,
formDataBodySerializer,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
export { createClient } from './core/';
export type { Client, Config, Options, RequestResult } from './core/types';
export type {
Client,
Config,
Options,
RequestOptions,
RequestOptionsBase,
RequestResult,
} from './core/types';
export {
type BodySerializer,
createConfig,
formDataBodySerializer,
jsonBodySerializer,
type Middleware,
type QuerySerializer,
type QuerySerializerOptions,
urlSearchParamsBodySerializer,
} from './core/utils';
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
export { createClient } from './core/';
export type { Client, Config, Options, RequestResult } from './core/types';
export type {
Client,
Config,
Options,
RequestOptions,
RequestOptionsBase,
RequestResult,
} from './core/types';
export {
type BodySerializer,
createConfig,
formDataBodySerializer,
jsonBodySerializer,
type Middleware,
type QuerySerializer,
type QuerySerializerOptions,
urlSearchParamsBodySerializer,
} from './core/utils';

0 comments on commit 7825a2f

Please sign in to comment.