Skip to content

Commit

Permalink
docs(hooks): updated typescript types for hooks
Browse files Browse the repository at this point in the history
issues: #22

hooks affected:
- useLocalsStorage
- useMediaStream
- useSessionStorage
  • Loading branch information
heyitsarpit committed Dec 25, 2021
1 parent 3a7a952 commit 5899ed4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/core/useLocalStorage/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ declare type UseLocalStorageOptions = {
*/
deserialize: (value: string) => unknown
}

/**
* Modified `useState` hook that syncs with localStorage.
*
Expand All @@ -79,7 +78,7 @@ declare function useLocalStorage<T>(
key: string,
initialValue: T,
options?: UseLocalStorageOptions
): [T, Dispatch<SetStateAction<T>>]
): [T, (value: T) => void]
```

## Source
Expand Down
2 changes: 1 addition & 1 deletion packages/core/useMediaStream/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ declare function useMediaStream(options?: UseMediaStreamOptions): {
stream: react.MutableRefObject<MediaStream | null>
isPlaying: boolean
play: () => Promise<MediaStream | null | undefined>
stop: () => Promise<void>
stop: () => void
restart: () => Promise<MediaStream | null | undefined>
isAudioMuted: boolean
muteAudio: () => void
Expand Down
3 changes: 1 addition & 2 deletions packages/core/useSessionStorage/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ declare type UseSessionStorageOptions = {
*/
deserialize: (value: string) => unknown
}

/**
* Modified `useState` hook that syncs with useSessionStorage.
*
Expand All @@ -79,7 +78,7 @@ declare function useSessionStorage<T>(
key: string,
initialValue: T,
options?: UseSessionStorageOptions
): [T, Dispatch<SetStateAction<T>>]
): [T, (value: T) => void]
```

## Source
Expand Down

0 comments on commit 5899ed4

Please sign in to comment.