You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(gatsby): Add types for getServerData (#34406)
* Add types for getServerData
* Add types for getServerData
* Revert get-server-data change
* Make return type a promise
Co-authored-by: Josh <[email protected]>
Copy file name to clipboardExpand all lines: packages/gatsby/index.d.ts
+29
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,35 @@ export type PageProps<
146
146
serverData: ServerDataType
147
147
}
148
148
149
+
/**
150
+
* Props object passed into the [getServerData](https://www.gatsbyjs.com/docs/reference/rendering-options/server-side-rendering/) function.
151
+
*/
152
+
exporttypeGetServerDataProps={
153
+
headers: Map<string,unknown>
154
+
method: string
155
+
url: string
156
+
query?: Record<string,unknown>
157
+
params?: Record<string,unknown>
158
+
pageContext: Record<string,unknown>
159
+
};
160
+
161
+
/**
162
+
* The return type (promise payload) from the [getServerData](https://www.gatsbyjs.com/docs/reference/rendering-options/server-side-rendering/) function.
* A shorthand type for combining the props and return type for the [getServerData](https://www.gatsbyjs.com/docs/reference/rendering-options/server-side-rendering/) function.
0 commit comments