Skip to content

Commit 07c0f4b

Browse files
committed
add index.d.ts
1 parent 864d409 commit 07c0f4b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

index.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export function useDataLoader<Data, Args extends any[]>(
2+
getData: (...args: Args) => Promise<Data>,
3+
...args: Args
4+
): {
5+
data: Data | null
6+
error: Error | null
7+
loading: boolean
8+
retry: () => void
9+
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
"version": "0.0.1",
44
"description": "React hook for loading data",
55
"main": "dist/index.js",
6+
"typings": "./index.d.ts",
67
"repository": "git@github.com:smmoosavi/react-use-data-loader.git",
78
"author": "Seyyed Morteza Moosavi <se.mo.moosavi@gmail.com>",
89
"license": "MIT",
910
"files": [
1011
"dist",
11-
"src"
12+
"src",
13+
"index.d.ts"
1214
],
1315
"scripts": {
1416
"clean": "rimraf lib dist es coverage",

0 commit comments

Comments
 (0)