Skip to content

Commit d20dbd6

Browse files
arthurjdamlfades
andauthoredSep 1, 2020
Export return type for GetStaticPaths (#16580)
* feat Export return type for GetStaticPaths * add Duplicate generic Co-authored-by: Luis Alvarez D <luis@vercel.com>
1 parent d59f12c commit d20dbd6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎packages/next/types/index.d.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,14 @@ export type InferGetStaticPropsType<T> = T extends GetStaticProps<infer P, any>
9696
? P
9797
: never
9898

99-
export type GetStaticPaths<
100-
P extends ParsedUrlQuery = ParsedUrlQuery
101-
> = () => Promise<{
99+
export type GetStaticPathsResult<P extends ParsedUrlQuery = ParsedUrlQuery> = {
102100
paths: Array<string | { params: P }>
103101
fallback: boolean | 'unstable_blocking'
104-
}>
102+
}
103+
104+
export type GetStaticPaths<
105+
P extends ParsedUrlQuery = ParsedUrlQuery
106+
> = () => Promise<GetStaticPathsResult<P>>
105107

106108
export type GetServerSidePropsContext<
107109
Q extends ParsedUrlQuery = ParsedUrlQuery

0 commit comments

Comments
 (0)
Please sign in to comment.