diff --git a/hook/index.d.ts b/hook/index.d.ts new file mode 100644 index 0000000..c2e65e5 --- /dev/null +++ b/hook/index.d.ts @@ -0,0 +1,4 @@ +export default function useLinkState( + initialState: S, + eventPath?: string +): [S, (e: TEvent) => void, (value: S | ((prevState: S) => S)) => void]; diff --git a/hook/package.json b/hook/package.json index be6397c..0f8ccfc 100644 --- a/hook/package.json +++ b/hook/package.json @@ -2,6 +2,7 @@ "name": "linkstate_hook", "main": "./dist/hook.js", "module": "./dist/hook.module.js", + "typings": "./index.d.ts", "peerDependencies": { "preact": "*", "linkstate": "*"