feat: 完成大部分操作

This commit is contained in:
claude-code-best
2026-03-31 21:40:37 +08:00
parent 3d4cb096d1
commit c4d92178b7
22 changed files with 561 additions and 98 deletions

View File

@@ -139,7 +139,7 @@ function useAppStore(): AppStateStore {
* const { text, promptId } = useAppState(s => s.promptSuggestion) // good
* ```
*/
export function useAppState(selector) {
export function useAppState<R>(selector: (state: AppState) => R): R {
const $ = _c(3);
const store = useAppStore();
let t0;
@@ -183,7 +183,7 @@ const NOOP_SUBSCRIBE = () => () => {};
* Safe version of useAppState that returns undefined if called outside of AppStateProvider.
* Useful for components that may be rendered in contexts where AppStateProvider isn't available.
*/
export function useAppStateMaybeOutsideOfProvider(selector) {
export function useAppStateMaybeOutsideOfProvider<R>(selector: (state: AppState) => R): R | undefined {
const $ = _c(3);
const store = useContext(AppStoreContext);
let t0;