@@ -71,7 +71,7 @@ const composeQueryHandler = (
7171 config . autogenKey ? '' : 'id: string, '
7272 } getKey: ${ config . typesPrefix } SWRInfiniteKeyLoader${
7373 config . typesSuffix
74- } <${ responseType } , ${ variablesType } >, variables${ optionalVariables } : ${ variablesType } , config?: SWRInfiniteConfigInterface <${ responseType } , ClientError>) {
74+ } <${ responseType } , ${ variablesType } >, variables${ optionalVariables } : ${ variablesType } , config?: SWRInfiniteConfiguration <${ responseType } , ClientError>) {
7575 return useSWRInfinite<${ responseType } , ClientError>(
7676 utilsForInfinite.generateGetKey<${ responseType } , ${ variablesType } >(${
7777 config . autogenKey
@@ -122,24 +122,30 @@ export class SWRVisitor extends ClientSideBaseVisitor<
122122 if ( this . config . useTypeImports ) {
123123 if ( this . _enabledInfinite ) {
124124 this . _additionalImports . push (
125- `import type { ConfigInterface as SWRConfigInterface, keyInterface as SWRKeyInterface, SWRInfiniteConfigInterface } from 'swr';`
125+ `import type { SWRConfiguration as SWRConfigInterface, Key as SWRKeyInterface } from 'swr';`
126+ )
127+ this . _additionalImports . push (
128+ `import type { SWRInfiniteConfiguration } from 'swr/infinite';`
126129 )
127130 this . _additionalImports . push (
128131 `import useSWR, { useSWRInfinite } from 'swr';`
129132 )
130133 } else {
131134 this . _additionalImports . push (
132- `import type { ConfigInterface as SWRConfigInterface, keyInterface as SWRKeyInterface } from 'swr';`
135+ `import type { SWRConfiguration as SWRConfigInterface, Key as SWRKeyInterface } from 'swr';`
133136 )
134137 this . _additionalImports . push ( `import useSWR from 'swr';` )
135138 }
136139 } else if ( this . _enabledInfinite ) {
137140 this . _additionalImports . push (
138- `import useSWR, { useSWRInfinite, ConfigInterface as SWRConfigInterface, keyInterface as SWRKeyInterface, SWRInfiniteConfigInterface } from 'swr';`
141+ `import useSWR, { useSWRInfinite, SWRConfiguration as SWRConfigInterface, Key as SWRKeyInterface } from 'swr';`
142+ )
143+ this . _additionalImports . push (
144+ `import { SWRInfiniteConfiguration } from 'swr/infinite';`
139145 )
140146 } else {
141147 this . _additionalImports . push (
142- `import useSWR, { ConfigInterface as SWRConfigInterface, keyInterface as SWRKeyInterface } from 'swr';`
148+ `import useSWR, { SWRConfiguration as SWRConfigInterface, Key as SWRKeyInterface } from 'swr';`
143149 )
144150 }
145151 }
0 commit comments