Skip to content

Commit bddb379

Browse files
authored
feat: add a TypeScript declaration file for graphql-hooks-ssr (#142)
1 parent 857b6f0 commit bddb379

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Diff for: packages/graphql-hooks-ssr/index.d.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { ElementType } from 'react'
2+
3+
export function getInitialState(options: Options): object
4+
5+
interface Options {
6+
App: ElementType
7+
client: Client
8+
render?(element: ElementType): string
9+
}
10+
11+
interface Client {
12+
cache: Cache
13+
ssrPromises?: Promise<any>[]
14+
}
15+
16+
interface Cache {
17+
getInitialState(): object
18+
}

Diff for: packages/graphql-hooks-ssr/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.7",
44
"description": "Server side rendering utils for graphql-hooks",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 0",
89
"prepublishOnly": "cp ../../LICENSE ."
@@ -23,6 +24,7 @@
2324
"react-dom": "^16.8.1"
2425
},
2526
"devDependencies": {
27+
"@types/react": "16.8.8",
2628
"react": "16.8.4",
2729
"react-dom": "16.8.4"
2830
},

0 commit comments

Comments
 (0)