Skip to content

Commit

Permalink
feat: add interface for useState, useCallback, useMemo functions
Browse files Browse the repository at this point in the history
  • Loading branch information
denbite committed May 26, 2024
1 parent 67eff2a commit 0cca03b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-social-vm-types",
"version": "1.0.0",
"version": "1.1.0",
"description": "This repository includes types for Near social VM",
"main": "src/index.d.ts",
"repository": {
Expand Down
18 changes: 18 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,21 @@ declare namespace StorageAPI {
privateSet(key: string, value: string): Promise<void>;
}
}

declare function useState<S = undefined>(): [
S | undefined,
(value: S | undefined | ((prevState: S | undefined) => S | undefined)) => void
];
declare function useState<S>(
initialState: S | (() => S)
): [S, (value: S | ((prevState: S) => S)) => void];

declare function useEffect(
effect: () => void | (() => void),
deps?: ReadonlyArray<unknown>
): void;

declare function useMemo<T>(
factory: () => T,
deps: ReadonlyArray<unknown> | undefined
): T;

0 comments on commit 0cca03b

Please sign in to comment.