Skip to content

Commit

Permalink
feat(react-query-4): export UnselectedQueryOptions, SelectedQueryOpti…
Browse files Browse the repository at this point in the history
…ons (#1223)

# Overview

<!--
    A clear and concise description of what this pr is about.
 -->
Add exports for queryOptions return type
Fix ts error such as `The inferred type of "X" cannot be named without a
reference to "Y". This is likely not portable. A type annotation is
necessary.` when emitting d.ts file

## PR Checklist

- [x] I did below actions if need

1. I read the [Contributing
Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md)
2. I added documents and tests.

---------

Co-authored-by: GwanSik Kim <Seorit98@gmail.com>
Co-authored-by: Jonghyeon Ko <manudeli.ko@gmail.com>
  • Loading branch information
3 people authored Aug 20, 2024
1 parent d3231e5 commit 2221303
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-games-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@suspensive/react-query-4": minor
---

feat(react-query-4): export UnselectedQueryOptions, SelectedQueryOptions
2 changes: 2 additions & 0 deletions packages/react-query-4/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export { queryOptions } from './queryOptions'
export type { SelectedQueryOptions, UnSelectedQueryOptions } from './queryOptions'
export { infiniteQueryOptions } from './infiniteQueryOptions'
export type { SelectedInfiniteOptions, UnSelectedInfiniteOptions } from './infiniteQueryOptions'
export { useSuspenseQuery } from './useSuspenseQuery'
export type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './useSuspenseQuery'
export { useSuspenseQueries } from './useSuspenseQueries'
Expand Down
4 changes: 2 additions & 2 deletions packages/react-query-4/src/infiniteQueryOptions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { OmitKeyof, RequiredKeyof } from '@suspensive/utils'
import type { InfiniteData, QueryKey, UseInfiniteQueryOptions } from '@tanstack/react-query'

type SelectedInfiniteOptions<
export type SelectedInfiniteOptions<
TQueryFnData,
TError = unknown,
TData = InfiniteData<TQueryFnData>,
Expand All @@ -26,7 +26,7 @@ type SelectedInfiniteOptions<
select: (data: InfiniteData<TQueryFnData>) => InfiniteData<TData>
}

type UnSelectedInfiniteOptions<
export type UnSelectedInfiniteOptions<
TQueryFnData,
TError = unknown,
TData = InfiniteData<TQueryFnData>,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-query-4/src/queryOptions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { OmitKeyof, RequiredKeyof } from '@suspensive/utils'
import type { QueryKey, UseQueryOptions } from '@tanstack/react-query'

type SelectedQueryOptions<
export type SelectedQueryOptions<
TQueryFnData = unknown,
TError = unknown,
TData = TQueryFnData,
Expand All @@ -28,7 +28,7 @@ type SelectedQueryOptions<
select: (data: TQueryFnData) => TData
}

type UnSelectedQueryOptions<
export type UnSelectedQueryOptions<
TQueryFnData = unknown,
TError = unknown,
TData = TQueryFnData,
Expand Down

0 comments on commit 2221303

Please sign in to comment.