source dump of claude code
at main 17 lines 618 B view raw
1import { type AppState, useAppState } from '../state/AppState.js' 2 3/** 4 * Settings type as stored in AppState (DeepImmutable wrapped). 5 * Use this type when you need to annotate variables that hold settings from useSettings(). 6 */ 7export type ReadonlySettings = AppState['settings'] 8 9/** 10 * React hook to access current settings from AppState. 11 * Settings automatically update when files change on disk via settingsChangeDetector. 12 * 13 * Use this instead of getSettings_DEPRECATED() in React components for reactive updates. 14 */ 15export function useSettings(): ReadonlySettings { 16 return useAppState(s => s.settings) 17}