Skip to content

Commit

Permalink
feat: add a TypeScript declaration file for graphql-hooks-memcache (#137
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jackdclark committed Mar 15, 2019
1 parent 49787fc commit 03a1f43
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions packages/graphql-hooks-memcache/index.d.ts
@@ -0,0 +1,16 @@
export = MemCacheFunction

declare function MemCacheFunction(options?: {
size?: number
ttl?: number
initialState?: object
}): MemCache

interface MemCache {
get(keyObject: object): object
set(keyObject: object, data: object): void
delete(keyObject: object): void
clear(): void
keys(): void
getInitialState(): object
}
4 changes: 3 additions & 1 deletion packages/graphql-hooks-memcache/package.json
Expand Up @@ -5,6 +5,7 @@
"main": "lib/graphql-hooks-memcache.js",
"module": "es/graphql-hooks-memcache.js",
"unpkg": "dist/graphql-hooks-memcache.min.js",
"types": "index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "../../node_modules/.bin/rollup -c",
Expand All @@ -14,7 +15,8 @@
"dist",
"es",
"lib",
"src"
"src",
"index.d.ts"
],
"keywords": [
"graphql",
Expand Down

0 comments on commit 03a1f43

Please sign in to comment.