Skip to content

Commit

Permalink
Export return type for GetStaticPaths (#16580)
Browse files Browse the repository at this point in the history
* feat Export return type for GetStaticPaths

* add Duplicate generic

Co-authored-by: Luis Alvarez D <luis@vercel.com>
  • Loading branch information
arthurjdam and lfades committed Sep 1, 2020
1 parent d59f12c commit d20dbd6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/next/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ export type InferGetStaticPropsType<T> = T extends GetStaticProps<infer P, any>
? P
: never

export type GetStaticPaths<
P extends ParsedUrlQuery = ParsedUrlQuery
> = () => Promise<{
export type GetStaticPathsResult<P extends ParsedUrlQuery = ParsedUrlQuery> = {
paths: Array<string | { params: P }>
fallback: boolean | 'unstable_blocking'
}>
}

export type GetStaticPaths<
P extends ParsedUrlQuery = ParsedUrlQuery
> = () => Promise<GetStaticPathsResult<P>>

export type GetServerSidePropsContext<
Q extends ParsedUrlQuery = ParsedUrlQuery
Expand Down

0 comments on commit d20dbd6

Please sign in to comment.