Open History to see the last commit
1import { describe, expectTypeOf, it } from 'vitest'
2import type {
3 UseLiveInfiniteQueryConfig,
4 UseLiveInfiniteQueryReturn,
5} from '../src/useLiveInfiniteQuery'
6import type { Context } from '@tanstack/db'
7
8describe(`useLiveInfiniteQuery type assertions`, () => {
9 it(`keeps legacy generic wrappers source-compatible`, () => {
10 function acceptsContext<TContext extends Context>(
11 _config: UseLiveInfiniteQueryConfig<TContext>,
12 _result: UseLiveInfiniteQueryReturn<TContext>,
13 ): void {}
14
15 void acceptsContext
16 })
17
18 it(`exposes the controller fetch promise`, () => {
19 expectTypeOf<
20 UseLiveInfiniteQueryReturn<Context>[`fetchNextPage`]
21 >().toEqualTypeOf<() => Promise<void>>()
22 })
23})