Skip to content

Commit 03a1f43

Browse files
authored
feat: add a TypeScript declaration file for graphql-hooks-memcache (#137)
1 parent 49787fc commit 03a1f43

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

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

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export = MemCacheFunction
2+
3+
declare function MemCacheFunction(options?: {
4+
size?: number
5+
ttl?: number
6+
initialState?: object
7+
}): MemCache
8+
9+
interface MemCache {
10+
get(keyObject: object): object
11+
set(keyObject: object, data: object): void
12+
delete(keyObject: object): void
13+
clear(): void
14+
keys(): void
15+
getInitialState(): object
16+
}

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "lib/graphql-hooks-memcache.js",
66
"module": "es/graphql-hooks-memcache.js",
77
"unpkg": "dist/graphql-hooks-memcache.min.js",
8+
"types": "index.d.ts",
89
"scripts": {
910
"test": "echo \"Error: no test specified\" && exit 1",
1011
"build": "../../node_modules/.bin/rollup -c",
@@ -14,7 +15,8 @@
1415
"dist",
1516
"es",
1617
"lib",
17-
"src"
18+
"src",
19+
"index.d.ts"
1820
],
1921
"keywords": [
2022
"graphql",

0 commit comments

Comments
 (0)