diff --git a/.expo/types/router.d.ts b/.expo/types/router.d.ts index 8a0394c..8492b24 100644 --- a/.expo/types/router.d.ts +++ b/.expo/types/router.d.ts @@ -6,9 +6,9 @@ export * from 'expo-router'; declare module 'expo-router' { export namespace ExpoRouter { export interface __routes { - hrefInputParams: { pathname: Router.RelativePathString, params?: Router.UnknownInputParams } | { pathname: Router.ExternalPathString, params?: Router.UnknownInputParams } | { pathname: `/analytics`; params?: Router.UnknownInputParams; } | { pathname: `/emergency`; params?: Router.UnknownInputParams; } | { pathname: `/onboarding`; params?: Router.UnknownInputParams; } | { pathname: `/_sitemap`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/advanced-analytics` | `/advanced-analytics`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/advanced-therapy` | `/advanced-therapy`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/ai-chat` | `/ai-chat`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/ai-coach` | `/ai-coach`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/analytics` | `/analytics`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/articles` | `/articles`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/community` | `/community`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/enhanced-exercises` | `/enhanced-exercises`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/enhanced-settings` | `/enhanced-settings`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/exercises` | `/exercises`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/gamification` | `/gamification`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}` | `/`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/journal` | `/journal`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/mini-games` | `/mini-games`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/personalized-recommendations` | `/personalized-recommendations`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/profile` | `/profile`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/psychology` | `/psychology`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/sounds` | `/sounds`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/therapy` | `/therapy`; params?: Router.UnknownInputParams; } | { pathname: `/i18n`; params?: Router.UnknownInputParams; } | { pathname: `/+not-found`, params: Router.UnknownInputParams & { } }; - hrefOutputParams: { pathname: Router.RelativePathString, params?: Router.UnknownOutputParams } | { pathname: Router.ExternalPathString, params?: Router.UnknownOutputParams } | { pathname: `/analytics`; params?: Router.UnknownOutputParams; } | { pathname: `/emergency`; params?: Router.UnknownOutputParams; } | { pathname: `/onboarding`; params?: Router.UnknownOutputParams; } | { pathname: `/_sitemap`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/advanced-analytics` | `/advanced-analytics`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/advanced-therapy` | `/advanced-therapy`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/ai-chat` | `/ai-chat`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/ai-coach` | `/ai-coach`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/analytics` | `/analytics`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/articles` | `/articles`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/community` | `/community`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/enhanced-exercises` | `/enhanced-exercises`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/enhanced-settings` | `/enhanced-settings`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/exercises` | `/exercises`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/gamification` | `/gamification`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}` | `/`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/journal` | `/journal`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/mini-games` | `/mini-games`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/personalized-recommendations` | `/personalized-recommendations`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/profile` | `/profile`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/psychology` | `/psychology`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/sounds` | `/sounds`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/therapy` | `/therapy`; params?: Router.UnknownOutputParams; } | { pathname: `/i18n`; params?: Router.UnknownOutputParams; } | { pathname: `/+not-found`, params: Router.UnknownOutputParams & { } }; - href: Router.RelativePathString | Router.ExternalPathString | `/analytics${`?${string}` | `#${string}` | ''}` | `/emergency${`?${string}` | `#${string}` | ''}` | `/onboarding${`?${string}` | `#${string}` | ''}` | `/_sitemap${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/advanced-analytics${`?${string}` | `#${string}` | ''}` | `/advanced-analytics${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/advanced-therapy${`?${string}` | `#${string}` | ''}` | `/advanced-therapy${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/ai-chat${`?${string}` | `#${string}` | ''}` | `/ai-chat${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/ai-coach${`?${string}` | `#${string}` | ''}` | `/ai-coach${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/analytics${`?${string}` | `#${string}` | ''}` | `/analytics${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/articles${`?${string}` | `#${string}` | ''}` | `/articles${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/community${`?${string}` | `#${string}` | ''}` | `/community${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/enhanced-exercises${`?${string}` | `#${string}` | ''}` | `/enhanced-exercises${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/enhanced-settings${`?${string}` | `#${string}` | ''}` | `/enhanced-settings${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/exercises${`?${string}` | `#${string}` | ''}` | `/exercises${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/gamification${`?${string}` | `#${string}` | ''}` | `/gamification${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}${`?${string}` | `#${string}` | ''}` | `/${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/journal${`?${string}` | `#${string}` | ''}` | `/journal${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/mini-games${`?${string}` | `#${string}` | ''}` | `/mini-games${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/personalized-recommendations${`?${string}` | `#${string}` | ''}` | `/personalized-recommendations${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/profile${`?${string}` | `#${string}` | ''}` | `/profile${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/psychology${`?${string}` | `#${string}` | ''}` | `/psychology${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/sounds${`?${string}` | `#${string}` | ''}` | `/sounds${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/therapy${`?${string}` | `#${string}` | ''}` | `/therapy${`?${string}` | `#${string}` | ''}` | `/i18n${`?${string}` | `#${string}` | ''}` | { pathname: Router.RelativePathString, params?: Router.UnknownInputParams } | { pathname: Router.ExternalPathString, params?: Router.UnknownInputParams } | { pathname: `/analytics`; params?: Router.UnknownInputParams; } | { pathname: `/emergency`; params?: Router.UnknownInputParams; } | { pathname: `/onboarding`; params?: Router.UnknownInputParams; } | { pathname: `/_sitemap`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/advanced-analytics` | `/advanced-analytics`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/advanced-therapy` | `/advanced-therapy`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/ai-chat` | `/ai-chat`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/ai-coach` | `/ai-coach`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/analytics` | `/analytics`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/articles` | `/articles`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/community` | `/community`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/enhanced-exercises` | `/enhanced-exercises`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/enhanced-settings` | `/enhanced-settings`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/exercises` | `/exercises`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/gamification` | `/gamification`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}` | `/`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/journal` | `/journal`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/mini-games` | `/mini-games`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/personalized-recommendations` | `/personalized-recommendations`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/profile` | `/profile`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/psychology` | `/psychology`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/sounds` | `/sounds`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/therapy` | `/therapy`; params?: Router.UnknownInputParams; } | { pathname: `/i18n`; params?: Router.UnknownInputParams; } | `/+not-found` | { pathname: `/+not-found`, params: Router.UnknownInputParams & { } }; + hrefInputParams: { pathname: Router.RelativePathString, params?: Router.UnknownInputParams } | { pathname: Router.ExternalPathString, params?: Router.UnknownInputParams } | { pathname: `/analytics`; params?: Router.UnknownInputParams; } | { pathname: `/emergency`; params?: Router.UnknownInputParams; } | { pathname: `/onboarding`; params?: Router.UnknownInputParams; } | { pathname: `/_sitemap`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/advanced-analytics` | `/advanced-analytics`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/advanced-therapy` | `/advanced-therapy`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/ai-chat` | `/ai-chat`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/ai-coach` | `/ai-coach`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/analytics` | `/analytics`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/articles` | `/articles`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/community` | `/community`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/courses` | `/courses`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/enhanced-exercises` | `/enhanced-exercises`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/enhanced-settings` | `/enhanced-settings`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/exercises` | `/exercises`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/gamification` | `/gamification`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}` | `/`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/journal` | `/journal`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/micro-courses` | `/micro-courses`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/mini-games` | `/mini-games`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/personalized-recommendations` | `/personalized-recommendations`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/profile` | `/profile`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/psychology` | `/psychology`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/sounds` | `/sounds`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/therapy` | `/therapy`; params?: Router.UnknownInputParams; } | { pathname: `/i18n`; params?: Router.UnknownInputParams; } | { pathname: `/+not-found`, params: Router.UnknownInputParams & { } }; + hrefOutputParams: { pathname: Router.RelativePathString, params?: Router.UnknownOutputParams } | { pathname: Router.ExternalPathString, params?: Router.UnknownOutputParams } | { pathname: `/analytics`; params?: Router.UnknownOutputParams; } | { pathname: `/emergency`; params?: Router.UnknownOutputParams; } | { pathname: `/onboarding`; params?: Router.UnknownOutputParams; } | { pathname: `/_sitemap`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/advanced-analytics` | `/advanced-analytics`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/advanced-therapy` | `/advanced-therapy`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/ai-chat` | `/ai-chat`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/ai-coach` | `/ai-coach`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/analytics` | `/analytics`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/articles` | `/articles`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/community` | `/community`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/courses` | `/courses`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/enhanced-exercises` | `/enhanced-exercises`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/enhanced-settings` | `/enhanced-settings`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/exercises` | `/exercises`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/gamification` | `/gamification`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}` | `/`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/journal` | `/journal`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/micro-courses` | `/micro-courses`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/mini-games` | `/mini-games`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/personalized-recommendations` | `/personalized-recommendations`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/profile` | `/profile`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/psychology` | `/psychology`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/sounds` | `/sounds`; params?: Router.UnknownOutputParams; } | { pathname: `${'/(tabs)'}/therapy` | `/therapy`; params?: Router.UnknownOutputParams; } | { pathname: `/i18n`; params?: Router.UnknownOutputParams; } | { pathname: `/+not-found`, params: Router.UnknownOutputParams & { } }; + href: Router.RelativePathString | Router.ExternalPathString | `/analytics${`?${string}` | `#${string}` | ''}` | `/emergency${`?${string}` | `#${string}` | ''}` | `/onboarding${`?${string}` | `#${string}` | ''}` | `/_sitemap${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/advanced-analytics${`?${string}` | `#${string}` | ''}` | `/advanced-analytics${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/advanced-therapy${`?${string}` | `#${string}` | ''}` | `/advanced-therapy${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/ai-chat${`?${string}` | `#${string}` | ''}` | `/ai-chat${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/ai-coach${`?${string}` | `#${string}` | ''}` | `/ai-coach${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/analytics${`?${string}` | `#${string}` | ''}` | `/analytics${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/articles${`?${string}` | `#${string}` | ''}` | `/articles${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/community${`?${string}` | `#${string}` | ''}` | `/community${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/courses${`?${string}` | `#${string}` | ''}` | `/courses${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/enhanced-exercises${`?${string}` | `#${string}` | ''}` | `/enhanced-exercises${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/enhanced-settings${`?${string}` | `#${string}` | ''}` | `/enhanced-settings${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/exercises${`?${string}` | `#${string}` | ''}` | `/exercises${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/gamification${`?${string}` | `#${string}` | ''}` | `/gamification${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}${`?${string}` | `#${string}` | ''}` | `/${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/journal${`?${string}` | `#${string}` | ''}` | `/journal${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/micro-courses${`?${string}` | `#${string}` | ''}` | `/micro-courses${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/mini-games${`?${string}` | `#${string}` | ''}` | `/mini-games${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/personalized-recommendations${`?${string}` | `#${string}` | ''}` | `/personalized-recommendations${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/profile${`?${string}` | `#${string}` | ''}` | `/profile${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/psychology${`?${string}` | `#${string}` | ''}` | `/psychology${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/sounds${`?${string}` | `#${string}` | ''}` | `/sounds${`?${string}` | `#${string}` | ''}` | `${'/(tabs)'}/therapy${`?${string}` | `#${string}` | ''}` | `/therapy${`?${string}` | `#${string}` | ''}` | `/i18n${`?${string}` | `#${string}` | ''}` | { pathname: Router.RelativePathString, params?: Router.UnknownInputParams } | { pathname: Router.ExternalPathString, params?: Router.UnknownInputParams } | { pathname: `/analytics`; params?: Router.UnknownInputParams; } | { pathname: `/emergency`; params?: Router.UnknownInputParams; } | { pathname: `/onboarding`; params?: Router.UnknownInputParams; } | { pathname: `/_sitemap`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/advanced-analytics` | `/advanced-analytics`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/advanced-therapy` | `/advanced-therapy`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/ai-chat` | `/ai-chat`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/ai-coach` | `/ai-coach`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/analytics` | `/analytics`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/articles` | `/articles`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/community` | `/community`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/courses` | `/courses`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/enhanced-exercises` | `/enhanced-exercises`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/enhanced-settings` | `/enhanced-settings`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/exercises` | `/exercises`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/gamification` | `/gamification`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}` | `/`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/journal` | `/journal`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/micro-courses` | `/micro-courses`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/mini-games` | `/mini-games`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/personalized-recommendations` | `/personalized-recommendations`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/profile` | `/profile`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/psychology` | `/psychology`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/sounds` | `/sounds`; params?: Router.UnknownInputParams; } | { pathname: `${'/(tabs)'}/therapy` | `/therapy`; params?: Router.UnknownInputParams; } | { pathname: `/i18n`; params?: Router.UnknownInputParams; } | `/+not-found${`?${string}` | `#${string}` | ''}` | { pathname: `/+not-found`, params: Router.UnknownInputParams & { } }; } } } diff --git a/.gitignore b/.gitignore index 728a120..f584ab3 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ yarn-error.* *.tsbuildinfo app-example +.kimchi/ diff --git a/README.md b/README.md index 43ecd94..d04feaf 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ ## πŸ“ˆ Π˜ΡΡ‚ΠΎΡ€ΠΈΡ ΡƒΠ»ΡƒΡ‡ΡˆΠ΅Π½ΠΈΠΉ (ПослСдниС Ρ†ΠΈΠΊΠ»Ρ‹) +* **v1.6.1 (Π˜ΡΠΏΡ€Π°Π²Π»Π΅Π½ΠΈΠ΅ Ρ‚ΠΈΠΏΠΎΠ² ΠΈ Π»ΠΈΠ½Ρ‚ΠΈΠ½Π³Π°)**: УстранСны всС ошибки TypeScript (`tsc --noEmit`: 0 ошибок) ΠΈ всС ошибки ESLint (`npm run lint`: 0 ошибок, 102 прСдупрСТдСния). Π”ΠΎΠ±Π°Π²Π»Π΅Π½Ρ‹ Π½Π΅Π΄ΠΎΡΡ‚Π°ΡŽΡ‰ΠΈΠ΅ ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹/Ρ‚ΠΈΠΏΡ‹ Π² сСрвисы (`advancedMoodTracker`, `interactiveMeditation`, `personalization`, `notificationService`, `smartNotificationService`, `audioService`, `PsychologyService`), исправлСны TS-ошибки Π² ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Π°Ρ… (`sounds`, `gamification`, `mini-games`, `ai-coach`, `enhanced-exercises`, `enhanced-settings`, `personalized-recommendations` ΠΈ Π΄Ρ€.), Π·Π°Π΄Π°Π½Ρ‹ `displayName` для `React.memo`, Π΄ΠΎΠ±Π°Π²Π»Π΅Π½Ρ‹ Jest-Π³Π»ΠΎΠ±Π°Π»ΠΈ Π² `eslint.config.js`. ВсС тСсты проходят: `npm test` β€” 5/5. * **v1.6.0 (Π¦ΠΈΠΊΠ» 6)**: Π’Π½Π΅Π΄Ρ€Π΅Π½Ρ‹ "ΠšΡ€ΡƒΠ³ΠΈ" Π² БообщСство, Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ Π²ΠΈΠ΄ΠΆΠ΅Ρ‚ Π°Π½Π°Π»ΠΈΡ‚ΠΈΠΊΠΈ настроСния, Π±Π°Π·Π° Π·Π½Π°Π½ΠΈΠΉ Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½Π° Π΄ΠΎ 50+ статСй, ΡƒΠ»ΡƒΡ‡ΡˆΠ΅Π½Π° ΠΏΠ°ΠΌΡΡ‚ΡŒ AI-ΠΊΠΎΡƒΡ‡Π°. * **v1.5.0 (Π¦ΠΈΠΊΠ» 5)**: Π”ΠΎΠ±Π°Π²Π»Π΅Π½Ρ‹ "Π•ΠΆΠ΅Π΄Π½Π΅Π²Π½Ρ‹Π΅ испытания", Π³Π»ΡƒΠ±ΠΎΠΊΠΈΠ΅ ссылки ΠΈΠ· Ρ‡Π°Ρ‚Π° Π½Π° ΡΡ‚Π°Ρ‚ΡŒΠΈ, ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ UI ΠΊΠ°Ρ€Ρ‚ΠΎΡ‡Π΅ΠΊ сообщСства. * **v1.4.0 (Π¦ΠΈΠΊΠ» 4)**: Π Π΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π° ΠΎΠ·Π²ΡƒΡ‡ΠΊΠ° (TTS) для ΠΊΠΎΡƒΡ‡Π°, "Π£ΠΌΠ½Ρ‹ΠΉ Π΄Π½Π΅Π²Π½ΠΈΠΊ", Lottie-Π°Π½ΠΈΠΌΠ°Ρ†ΠΈΠΈ достиТСний. diff --git a/__tests__/setup.js b/__tests__/setup.js index 5db102e..1701609 100644 --- a/__tests__/setup.js +++ b/__tests__/setup.js @@ -1,3 +1,4 @@ +/* eslint-env jest */ import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock'; jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage); diff --git a/app/(tabs)/advanced-analytics.tsx b/app/(tabs)/advanced-analytics.tsx index 74069ce..924a48a 100644 --- a/app/(tabs)/advanced-analytics.tsx +++ b/app/(tabs)/advanced-analytics.tsx @@ -26,10 +26,10 @@ import { smartNotificationService } from '../../services/smartNotificationServic const { width: screenWidth, height: screenHeight } = Dimensions.get('window'); // ΠœΠ΅ΠΌΠΎΠΈΠ·ΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹Π΅ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Ρ‹ для ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ -const MemoizedInsightCard = React.memo(({ insight, onPress }: { - insight: PersonalInsight; - onPress: () => void; -}) => { +const MemoizedInsightCard = React.memo(function MemoizedInsightCard({ insight, onPress }: { + insight: PersonalInsight; + onPress: () => void; +}) { const scaleValue = useSharedValue(1); const opacityValue = useSharedValue(1); @@ -101,10 +101,10 @@ const MemoizedInsightCard = React.memo(({ insight, onPress }: { ); }); -const MemoizedRiskIndicator = React.memo(({ riskLevel, factors }: { +const MemoizedRiskIndicator = React.memo(function MemoizedRiskIndicator({ riskLevel, factors }: { riskLevel: string; factors: string[]; -}) => { +}) { const getRiskColor = (level: string) => { switch (level) { case 'low': return '#4CAF50'; @@ -165,7 +165,7 @@ const MemoizedRiskIndicator = React.memo(({ riskLevel, factors }: { export default function AdvancedAnalyticsPage() { const insets = useSafeAreaInsets(); const { userProfile, progress, soberDays } = useRecovery(); - const { moodData, getAnalytics } = useAnalytics(); + const { moodEntries } = useAnalytics(); const [insights, setInsights] = useState([]); const [riskAssessment, setRiskAssessment] = useState(null); @@ -199,16 +199,16 @@ export default function AdvancedAnalyticsPage() { setLoading(true); // АнализируСм ΠΏΠ°Ρ‚Ρ‚Π΅Ρ€Π½Ρ‹ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ - const userInsights = advancedInsightsService.analyzeUserPatterns(progress || [], moodData || []); + const userInsights = advancedInsightsService.analyzeUserPatterns(progress || [], moodEntries || []); setInsights(userInsights); // ΠžΡ†Π΅Π½ΠΈΠ²Π°Π΅ΠΌ Ρ‚Π΅ΠΊΡƒΡ‰ΠΈΠΉ риск const currentRisk = advancedInsightsService.assessRelapsRisk({ - mood: moodData?.[moodData.length - 1]?.mood || 3, - stress: moodData?.[moodData.length - 1]?.stressLevel || 3, - sleep: moodData?.[moodData.length - 1]?.sleepQuality || 3, + mood: moodEntries?.[moodEntries.length - 1]?.mood || 3, + stress: moodEntries?.[moodEntries.length - 1]?.stressLevel || 3, + sleep: moodEntries?.[moodEntries.length - 1]?.sleepQuality || 3, socialSupport: 4, // Π·Π°Π³Π»ΡƒΡˆΠΊΠ° - cravings: moodData?.[moodData.length - 1]?.cravingLevel || 2 + cravings: moodEntries?.[moodEntries.length - 1]?.cravingLevel || 2 }); setRiskAssessment(currentRisk); diff --git a/app/(tabs)/advanced-therapy.tsx b/app/(tabs)/advanced-therapy.tsx index 3f6e550..3106e85 100644 --- a/app/(tabs)/advanced-therapy.tsx +++ b/app/(tabs)/advanced-therapy.tsx @@ -89,7 +89,7 @@ export default function AdvancedTherapyPage() { setShowTherapyPlayer(false)} /> - setShowSoundPlayer(false)} /> + setShowSoundPlayer(false)} /> ); } diff --git a/app/(tabs)/ai-chat.tsx b/app/(tabs)/ai-chat.tsx index 7d63494..a2068b6 100644 --- a/app/(tabs)/ai-chat.tsx +++ b/app/(tabs)/ai-chat.tsx @@ -59,10 +59,10 @@ interface AIAssistantPageProps { } // ΠšΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ сообщСния Π² Ρ‡Π°Ρ‚Π΅ -const MessageBubble = React.memo(({ message, onSuggestionPress }: { +const MessageBubble = React.memo(function MessageBubble({ message, onSuggestionPress }: { message: ChatMessage; onSuggestionPress: (suggestion: ActionSuggestion) => void; -}) => { +}) { const isUser = message.senderType === 'user'; const isEmergency = message.messageType === 'emergency'; @@ -81,7 +81,7 @@ const MessageBubble = React.memo(({ message, onSuggestionPress }: { slideValue.value = withSpring(0, { damping: 15 }); }, []); - const getBubbleColor = () => { + const getBubbleColor = (): readonly [string, string] => { if (isEmergency) return ['#FF5722', '#FF3D00']; if (isUser) return ['#2E7D4A', '#1B5E20']; return ['#FFFFFF', '#F1F8E9']; @@ -161,10 +161,10 @@ const MessageBubble = React.memo(({ message, onSuggestionPress }: { }); // ΠšΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ быстрых ΠΎΡ‚Π²Π΅Ρ‚ΠΎΠ² -const QuickResponses = React.memo(({ onSelect, currentMood }: { +const QuickResponses = React.memo(function QuickResponses({ onSelect, currentMood }: { onSelect: (response: string) => void; currentMood: number; -}) => { +}) { const getQuickResponses = () => { if (currentMood <= 2) { return [ @@ -211,7 +211,7 @@ const QuickResponses = React.memo(({ onSelect, currentMood }: { }); // Π˜Π½Π΄ΠΈΠΊΠ°Ρ‚ΠΎΡ€ ΠΏΠ΅Ρ‡Π°Ρ‚ΠΈ ИИ -const TypingIndicator = React.memo(() => { +const TypingIndicator = React.memo(function TypingIndicator() { const dot1 = useSharedValue(0.3); const dot2 = useSharedValue(0.3); const dot3 = useSharedValue(0.3); @@ -338,15 +338,20 @@ const AIAssistantPage: React.FC = ({ initialContext }) => timeOfDay: new Date().getHours() > 12 ? 'afternoon' : 'morning', }); + if (!aiResponse.success) { + setIsTyping(false); + return; + } + const responseMessage: ChatMessage = { id: `ai_${Date.now()}`, senderId: 'ai_coach', senderType: 'ai', - content: aiResponse.message, + content: aiResponse.data.message, timestamp: new Date(), messageType: 'text', metadata: { - suggestions: aiResponse.suggestions.map((s, i) => ({ + suggestions: aiResponse.data.suggestions.map((s: string, i: number) => ({ id: `s_${i}`, type: 'technique', title: s, diff --git a/app/(tabs)/ai-coach.tsx b/app/(tabs)/ai-coach.tsx index 9e87b2a..3751dfd 100644 --- a/app/(tabs)/ai-coach.tsx +++ b/app/(tabs)/ai-coach.tsx @@ -28,7 +28,7 @@ const ChallengeCard = React.memo(({ challenge, onComplete }: { style={[styles.challengeCard, challenge.completed && styles.challengeCompleted]} > - + @@ -51,6 +51,7 @@ const ChallengeCard = React.memo(({ challenge, onComplete }: { )} )); +ChallengeCard.displayName = 'ChallengeCard'; // Refactored Message component const MessageBubble = React.memo(({ message, onArticlePress, onCoursePress, onSpeak, isSpeaking }: { @@ -167,6 +168,7 @@ const MessageBubble = React.memo(({ message, onArticlePress, onCoursePress, onSp ); }); +MessageBubble.displayName = 'MessageBubble'; export default function EnhancedAICoach() { const insets = useSafeAreaInsets(); diff --git a/app/(tabs)/articles.tsx b/app/(tabs)/articles.tsx index 11269a7..80aba28 100644 --- a/app/(tabs)/articles.tsx +++ b/app/(tabs)/articles.tsx @@ -43,12 +43,12 @@ import { articlesDatabase } from '../../services/articlesDatabase'; const articles: Article[] = articlesDatabase; -const MemoizedArticleCard = React.memo(({ article, onPress, isFavorite, onToggleFavorite }: { +const MemoizedArticleCard = React.memo(function MemoizedArticleCard({ article, onPress, isFavorite, onToggleFavorite }: { article: Article; onPress: () => void; isFavorite: boolean; onToggleFavorite: (id: string) => void; -}) => { +}) { const scaleValue = useSharedValue(1); const animatedStyle = useAnimatedStyle(() => ({ transform: [{ scale: scaleValue.value }] @@ -104,12 +104,12 @@ const MemoizedArticleCard = React.memo(({ article, onPress, isFavorite, onToggle ); }); -const MemoizedFilterChip = React.memo(({ label, selected, onPress, count }: { +const MemoizedFilterChip = React.memo(function MemoizedFilterChip({ label, selected, onPress, count }: { label: string; selected: boolean; onPress: () => void; count: number; -}) => { +}) { const scaleValue = useSharedValue(1); const animatedStyle = useAnimatedStyle(() => ({ transform: [{ scale: scaleValue.value }] diff --git a/app/(tabs)/community.tsx b/app/(tabs)/community.tsx index edc8682..cd72463 100644 --- a/app/(tabs)/community.tsx +++ b/app/(tabs)/community.tsx @@ -4,6 +4,7 @@ import { FlatList, Image, Dimensions, Modal, TextInput, Alert } from 'react-native'; import { MaterialIcons } from '@expo/vector-icons'; +import * as Haptics from 'expo-haptics'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { LinearGradient } from 'expo-linear-gradient'; import { CommunityService, SuccessStory, SupportPost, ExpertQA, ReactionType, CommunityGoal } from '../../services/communityService'; diff --git a/app/(tabs)/enhanced-exercises.tsx b/app/(tabs)/enhanced-exercises.tsx index ec4de17..0da39de 100644 --- a/app/(tabs)/enhanced-exercises.tsx +++ b/app/(tabs)/enhanced-exercises.tsx @@ -38,14 +38,14 @@ const { width: screenWidth } = Dimensions.get('window'); // ОбъСдинСнная Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠ° всСх Ρ‚Π΅Ρ…Π½ΠΈΠΊ const allTechniques = [ - ...advancedNLPTechniques.map(tech => ({ ...tech, category: 'ΠΠ›ΠŸ Π‘Π°Π·ΠΎΠ²Ρ‹Π΅', color: '#FF9800' })), - ...additionalNLPTechniques.map(tech => ({ ...tech, category: 'ΠΠ›ΠŸ ΠŸΡ€ΠΎΠ΄Π²ΠΈΠ½ΡƒΡ‚Ρ‹Π΅', color: '#FF5722' })), - ...beliefWorkTechniques.map(tech => ({ ...tech, category: 'Π Π°Π±ΠΎΡ‚Π° с убСТдСниями', color: '#E91E63' })), - ...integrativeNLPTechniques.map(tech => ({ ...tech, category: 'ΠΠ›ΠŸ Π˜Π½Ρ‚Π΅Π³Ρ€Π°Ρ‚ΠΈΠ²Π½Ρ‹Π΅', color: '#9C27B0' })), - ...advancedCBTTechniques.map(tech => ({ ...tech, category: 'КПВ', color: '#2196F3' })), - ...traumaInformedTechniques.map(tech => ({ ...tech, category: 'Π Π°Π±ΠΎΡ‚Π° с Ρ‚Ρ€Π°Π²ΠΌΠΎΠΉ', color: '#673AB7' })), - ...integrativeTherapyTechniques.map(tech => ({ ...tech, category: 'Π˜Π½Ρ‚Π΅Π³Ρ€Π°Ρ‚ΠΈΠ²Π½Ρ‹Π΅ ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹', color: '#4CAF50' })), - ...allExpandedTechniques.map(tech => ({ ...tech, category: 'ΠΠ›ΠŸ Π Π°ΡΡˆΠΈΡ€Π΅Π½Π½Ρ‹Π΅', color: '#00BCD4' })) + ...advancedNLPTechniques.map(tech => ({ ...tech, category: 'ΠΠ›ΠŸ Π‘Π°Π·ΠΎΠ²Ρ‹Π΅', color: '#FF9800', difficulty: (tech as any).difficulty ?? 'intermediate' })), + ...additionalNLPTechniques.map(tech => ({ ...tech, category: 'ΠΠ›ΠŸ ΠŸΡ€ΠΎΠ΄Π²ΠΈΠ½ΡƒΡ‚Ρ‹Π΅', color: '#FF5722', difficulty: (tech as any).difficulty ?? 'intermediate' })), + ...beliefWorkTechniques.map(tech => ({ ...tech, category: 'Π Π°Π±ΠΎΡ‚Π° с убСТдСниями', color: '#E91E63', difficulty: (tech as any).difficulty ?? 'intermediate' })), + ...integrativeNLPTechniques.map(tech => ({ ...tech, category: 'ΠΠ›ΠŸ Π˜Π½Ρ‚Π΅Π³Ρ€Π°Ρ‚ΠΈΠ²Π½Ρ‹Π΅', color: '#9C27B0', difficulty: (tech as any).difficulty ?? 'intermediate' })), + ...advancedCBTTechniques.map(tech => ({ ...tech, category: 'КПВ', color: '#2196F3', difficulty: (tech as any).difficulty ?? 'intermediate' })), + ...traumaInformedTechniques.map(tech => ({ ...tech, category: 'Π Π°Π±ΠΎΡ‚Π° с Ρ‚Ρ€Π°Π²ΠΌΠΎΠΉ', color: '#673AB7', difficulty: (tech as any).difficulty ?? 'intermediate' })), + ...integrativeTherapyTechniques.map(tech => ({ ...tech, category: 'Π˜Π½Ρ‚Π΅Π³Ρ€Π°Ρ‚ΠΈΠ²Π½Ρ‹Π΅ ΠΌΠ΅Ρ‚ΠΎΠ΄Ρ‹', color: '#4CAF50', difficulty: (tech as any).difficulty ?? 'intermediate' })), + ...allExpandedTechniques.map(tech => ({ ...tech, category: 'ΠΠ›ΠŸ Π Π°ΡΡˆΠΈΡ€Π΅Π½Π½Ρ‹Π΅', color: '#00BCD4', difficulty: (tech as any).difficulty ?? 'intermediate' })) ]; interface Technique { @@ -128,6 +128,7 @@ const MemoizedTechniqueCard = React.memo(({ technique, onPress }: { ); }); +MemoizedTechniqueCard.displayName = 'MemoizedTechniqueCard'; const MemoizedFilterChip = React.memo(({ label, selected, onPress, color }: { label: string; @@ -168,6 +169,7 @@ const MemoizedFilterChip = React.memo(({ label, selected, onPress, color }: { ); }); +MemoizedFilterChip.displayName = 'MemoizedFilterChip'; export default function EnhancedExercisesPage() { const insets = useSafeAreaInsets(); diff --git a/app/(tabs)/enhanced-settings.tsx b/app/(tabs)/enhanced-settings.tsx index 7612a07..b87d4d0 100644 --- a/app/(tabs)/enhanced-settings.tsx +++ b/app/(tabs)/enhanced-settings.tsx @@ -107,6 +107,7 @@ const MemoizedThemeCard = React.memo(({ theme, isSelected, onPress }: { ); }); +MemoizedThemeCard.displayName = 'MemoizedThemeCard'; const MemoizedSettingRow = React.memo(({ setting, onValueChange }: { setting: Setting; @@ -169,6 +170,7 @@ const MemoizedSettingRow = React.memo(({ setting, onValueChange }: { ); }); +MemoizedSettingRow.displayName = 'MemoizedSettingRow'; export default function EnhancedSettingsPage() { const insets = useSafeAreaInsets(); @@ -481,7 +483,7 @@ export default function EnhancedSettingsPage() { {settingSections.map((section) => ( - + {section.title} {section.description} diff --git a/app/(tabs)/exercises.tsx b/app/(tabs)/exercises.tsx index 772e782..fe4ea7d 100644 --- a/app/(tabs)/exercises.tsx +++ b/app/(tabs)/exercises.tsx @@ -64,7 +64,10 @@ export default function ExercisesPage() { submodalities: '#FF9800', swish: '#F44336', phobia: '#795548', - belief_change: '#607D8B' + belief_change: '#607D8B', + parts_integration: '#00BCD4', + meta_program: '#E91E63', + perceptual_positions: '#FF9800' }; const nlpCategoryNames = { @@ -74,8 +77,11 @@ export default function ExercisesPage() { submodalities: 'Π‘ΡƒΠ±ΠΌΠΎΠ΄Π°Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ', swish: 'Бвиш-ΠΏΠ°Ρ‚Ρ‚Π΅Ρ€Π½', phobia: 'Π Π°Π±ΠΎΡ‚Π° с фобиями', - belief_change: 'ИзмСнСниС ΡƒΠ±Π΅ΠΆΠ΄Π΅Π½ΠΈΠΉ' - }; + belief_change: 'ИзмСнСниС ΡƒΠ±Π΅ΠΆΠ΄Π΅Π½ΠΈΠΉ', + parts_integration: 'Π˜Π½Ρ‚Π΅Π³Ρ€Π°Ρ†ΠΈΡ частСй личности: согласованиС ΠΊΠΎΠ½Ρ„Π»ΠΈΠΊΡ‚ΡƒΡŽΡ‰ΠΈΡ… Π²Π½ΡƒΡ‚Ρ€Π΅Π½Π½ΠΈΡ… частСй для достиТСния Π²Π½ΡƒΡ‚Ρ€Π΅Π½Π½Π΅ΠΉ Π³Π°Ρ€ΠΌΠΎΠ½ΠΈΠΈ.', + meta_program: 'ΠœΠ΅Ρ‚Π°-ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹: выявлСниС ΠΈ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ Π³Π»ΡƒΠ±ΠΈΠ½Π½Ρ‹Ρ… ΠΌΠ΅Π½Ρ‚Π°Π»ΡŒΠ½Ρ‹Ρ… шаблонов, Π²Π»ΠΈΡΡŽΡ‰ΠΈΡ… Π½Π° восприятиС ΠΈ ΠΏΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠ΅.', + perceptual_positions: 'ΠŸΠΎΠ·ΠΈΡ†ΠΈΠΈ восприятия: взгляд Π½Π° ΡΠΈΡ‚ΡƒΠ°Ρ†ΠΈΡŽ с Ρ‚ΠΎΡ‡ΠΊΠΈ зрСния сСбя, Π΄Ρ€ΡƒΠ³ΠΎΠ³ΠΎ Ρ‡Π΅Π»ΠΎΠ²Π΅ΠΊΠ° ΠΈ Π½Π°Π±Π»ΡŽΠ΄Π°Ρ‚Π΅Π»Ρ для ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΈΠ²Π½ΠΎΠ³ΠΎ понимания.' + } as Record; const startTechnique = (technique: NLPTechnique) => { setSelectedTechnique(technique); @@ -813,4 +819,4 @@ const styles = StyleSheet.create({ color: '#666', lineHeight: 16 } -}); \ No newline at end of file +}); diff --git a/app/(tabs)/gamification.tsx b/app/(tabs)/gamification.tsx index a83eb5e..161b8ce 100644 --- a/app/(tabs)/gamification.tsx +++ b/app/(tabs)/gamification.tsx @@ -222,7 +222,7 @@ export default function GamificationDashboard() { setChallenges(challengesData); }; - const getRarityColor = (rarity: string) => { + const getRarityColor = (rarity: string): readonly [string, string] => { switch (rarity) { case 'common': return ['#95A5A6', '#BDC3C7']; case 'rare': return ['#3498DB', '#5DADE2']; diff --git a/app/(tabs)/mini-games.tsx b/app/(tabs)/mini-games.tsx index 07e85f3..0b3f96c 100644 --- a/app/(tabs)/mini-games.tsx +++ b/app/(tabs)/mini-games.tsx @@ -33,7 +33,7 @@ const BreathBubbleGame = ({ onGameComplete }: { onGameComplete: (score: number) const [breathPhase, setBreathPhase] = useState<'inhale' | 'hold' | 'exhale'>('inhale'); const [phaseTime, setPhaseTime] = useState(0); const [gameActive, setGameActive] = useState(false); - const animationRef = useRef(); + const animationRef = useRef(null); interface Bubble { id: string; @@ -220,7 +220,7 @@ const MindfulMazeGame = ({ onGameComplete }: { onGameComplete: (score: number) = const [maze, setMaze] = useState([]); const [collectibles, setCollectibles] = useState<{x: number, y: number}[]>([]); const [gameTime, setGameTime] = useState(0); - const gameTimerRef = useRef(); + const gameTimerRef = useRef(null); const CELL_SIZE = 25; const MAZE_SIZE = 15; @@ -382,7 +382,7 @@ const DecisionChallengeGame = ({ onGameComplete }: { onGameComplete: (score: num const [gameActive, setGameActive] = useState(false); const [timeLeft, setTimeLeft] = useState(10); const [scenarioIndex, setScenarioIndex] = useState(0); - const timerRef = useRef(); + const timerRef = useRef(null); const scenarios = [ { @@ -742,7 +742,7 @@ const StressBallGame = ({ onGameComplete }: { onGameComplete: (score: number) => const [ballSize, setBallSize] = useState(new Animated.Value(80)); const [ballColor, setBallColor] = useState('#4CAF50'); const [breathingPhase, setBreathingPhase] = useState<'inhale' | 'exhale'>('inhale'); - const gameTimerRef = useRef(); + const gameTimerRef = useRef(null); const startGame = () => { setGameActive(true); diff --git a/app/(tabs)/personalized-recommendations.tsx b/app/(tabs)/personalized-recommendations.tsx index a98c985..e86751b 100644 --- a/app/(tabs)/personalized-recommendations.tsx +++ b/app/(tabs)/personalized-recommendations.tsx @@ -238,6 +238,7 @@ const MemoizedRecommendationCard = React.memo(({ ); }); +MemoizedRecommendationCard.displayName = 'MemoizedRecommendationCard'; const PersonalizedRecommendationsPage = () => { const insets = useSafeAreaInsets(); diff --git a/app/(tabs)/sounds.tsx b/app/(tabs)/sounds.tsx index 7a65725..85a5c9f 100644 --- a/app/(tabs)/sounds.tsx +++ b/app/(tabs)/sounds.tsx @@ -36,6 +36,7 @@ interface Sound { color: string; frequency?: string; benefits: string[]; + duration: number; } // ΠœΠ΅ΠΌΠΎΠΈΠ·ΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹Π΅ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚Ρ‹ @@ -90,6 +91,7 @@ const MemoizedSoundCard = React.memo(({ sound, onPlay }: { ); }); +MemoizedSoundCard.displayName = 'MemoizedSoundCard'; function SoundsPage() { const insets = useSafeAreaInsets(); @@ -127,6 +129,7 @@ function SoundsPage() { const sounds = useMemo(() => [ { id: '1', + duration: 600, name: 'Глубокая мСдитация', description: 'ΠŸΠΎΠ³Ρ€ΡƒΠΆΠ΅Π½ΠΈΠ΅ Π² состояниС покоя', category: 'meditation', @@ -137,6 +140,7 @@ function SoundsPage() { }, { id: '2', + duration: 600, name: 'Π¨ΡƒΠΌ ΠΎΠΊΠ΅Π°Π½Π°', description: 'Π£ΡΠΏΠΎΠΊΠ°ΠΈΠ²Π°ΡŽΡ‰ΠΈΠ΅ Π·Π²ΡƒΠΊΠΈ прибоя', category: 'nature', @@ -146,6 +150,7 @@ function SoundsPage() { }, { id: '3', + duration: 600, name: 'Π‘ΠΈΠ½Π°ΡƒΡ€Π°Π»ΡŒΠ½Ρ‹Π΅ Ρ€ΠΈΡ‚ΠΌΡ‹', description: 'Бинхронизация ΠΌΠΎΠ·Π³ΠΎΠ²Ρ‹Ρ… Π²ΠΎΠ»Π½', category: 'binaural', @@ -156,6 +161,7 @@ function SoundsPage() { }, { id: '4', + duration: 600, name: 'Π˜ΡΡ†Π΅Π»ΡΡŽΡ‰ΠΈΠ΅ частоты', description: 'Π‘ΠΎΠ»ΡŒΡ„Π΅Π΄ΠΆΠΈΠΎ для восстановлСния', category: 'healing', @@ -166,6 +172,7 @@ function SoundsPage() { }, { id: '5', + duration: 600, name: 'ЛСсныС Π·Π²ΡƒΠΊΠΈ', description: 'ПСниС ΠΏΡ‚ΠΈΡ† ΠΈ ΡˆΠ΅Π»Π΅ΡΡ‚ листвы', category: 'nature', @@ -175,6 +182,7 @@ function SoundsPage() { }, { id: '6', + duration: 600, name: 'Π”ΠΎΠΆΠ΄ΡŒ ΠΈ Π³Ρ€ΠΎΠΌ', description: 'АтмосфСрныС осадки', category: 'nature', @@ -184,6 +192,7 @@ function SoundsPage() { }, { id: '7', + duration: 600, name: 'ВибСтскиС ΠΏΠΎΡŽΡ‰ΠΈΠ΅ Ρ‡Π°ΡˆΠΈ', description: 'Π”Ρ€Π΅Π²Π½ΠΈΠ΅ Π·Π²ΡƒΠΊΠΈ для очищСния', category: 'healing', @@ -194,6 +203,7 @@ function SoundsPage() { }, { id: '8', + duration: 600, name: 'ΠšΠΎΠ»Ρ‹Π±Π΅Π»ΡŒΠ½Π°Ρ всСлСнной', description: 'Π“Π»ΡƒΠ±ΠΎΠΊΠΈΠΉ Π²ΠΎΡΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹ΠΉ сон', category: 'sleep', @@ -403,7 +413,7 @@ function SoundsPage() { - + Π£Π²Π΅Π»ΠΈΡ‡Π΅Π½ΠΈΠ΅ Π²Ρ‹Ρ€Π°Π±ΠΎΡ‚ΠΊΠΈ Π“ΠΠœΠš (Π½Π΅ΠΉΡ€ΠΎΠΌΠ΅Π΄ΠΈΠ°Ρ‚ΠΎΡ€ покоя) diff --git a/app/(tabs)/therapy.tsx b/app/(tabs)/therapy.tsx index 0ae911c..7440301 100644 --- a/app/(tabs)/therapy.tsx +++ b/app/(tabs)/therapy.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { View, Text, ScrollView, StyleSheet, TouchableOpacity, Modal } from 'react-native'; import { MaterialIcons } from '@expo/vector-icons'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import { modernTechniques, ModernTechnique, mindfulnessExercises } from '../../services/PsychologyService'; +import { modernTechniques, ModernTechnique, mindfulnessExercises, MindfulnessExercise } from '../../services/PsychologyService'; export default function TherapyPage() { const insets = useSafeAreaInsets(); @@ -140,7 +140,7 @@ export default function TherapyPage() { ΠŸΡ€Π°ΠΊΡ‚ΠΈΠΊΠΈ осознанности - {mindfulnessExercises.map((exercise, index) => ( + {mindfulnessExercises.map((exercise: MindfulnessExercise, index: number) => ( diff --git a/app/+not-found.tsx b/app/+not-found.tsx index 44fe758..a960594 100644 --- a/app/+not-found.tsx +++ b/app/+not-found.tsx @@ -21,7 +21,7 @@ export default function NotFoundScreen() { Page Not Found - The moment you're looking for seems to have been lost in the shadows. + The moment you're looking for seems to have been lost in the shadows. { - const locale = Localization.getLocales()[0].languageCode; - return resources.hasOwnProperty(locale) ? locale : 'en'; +const getLanguage = (): string => { + const locale = Localization.getLocales()[0]?.languageCode; + return locale && resources.hasOwnProperty(locale) ? locale : 'en'; }; i18n diff --git a/components/home/HealthMetric.tsx b/components/home/HealthMetric.tsx index 2d626ab..ff481f3 100644 --- a/components/home/HealthMetric.tsx +++ b/components/home/HealthMetric.tsx @@ -14,7 +14,7 @@ interface HealthMetricProps { onPress: () => void; } -export const MemoizedHealthMetric = React.memo(({ metric, onPress }: HealthMetricProps) => { +export const MemoizedHealthMetric = React.memo(function MemoizedHealthMetric({ metric, onPress }: HealthMetricProps) { const { t } = useTranslation(); return ( diff --git a/components/home/StatCard.tsx b/components/home/StatCard.tsx index d327fc2..fbf8fa8 100644 --- a/components/home/StatCard.tsx +++ b/components/home/StatCard.tsx @@ -1,5 +1,5 @@ import React, { useEffect } from 'react'; -import { View, Text, StyleSheet } from 'react-native'; +import { View, Text, StyleSheet, ViewStyle, StyleProp } from 'react-native'; import { MaterialIcons } from '@expo/vector-icons'; import Animated, { useSharedValue, @@ -15,9 +15,10 @@ interface StatCardProps { label: string; primary?: boolean; index?: number; + animatedStyle?: StyleProp; } -export const StatCard = ({ icon, number, label, primary, index = 0 }: StatCardProps) => { +export const StatCard = ({ icon, number, label, primary, index = 0, animatedStyle }: StatCardProps) => { const n = typeof number === 'number' ? number : parseInt(number, 10) || 0; const milestones = [ @@ -45,7 +46,7 @@ export const StatCard = ({ icon, number, label, primary, index = 0 }: StatCardPr translateY.value = withDelay(index * 100, withSpring(0)); }, []); - const animatedStyle = useAnimatedStyle(() => ({ + const entranceStyle = useAnimatedStyle(() => ({ opacity: opacity.value, transform: [{ translateY: translateY.value }] })); @@ -54,7 +55,8 @@ export const StatCard = ({ icon, number, label, primary, index = 0 }: StatCardPr {number} diff --git a/contexts/RecoveryContext.tsx b/contexts/RecoveryContext.tsx index c337e25..28235ba 100644 --- a/contexts/RecoveryContext.tsx +++ b/contexts/RecoveryContext.tsx @@ -215,6 +215,8 @@ export function RecoveryProvider({ children }: { children: ReactNode }) { const today = new Date(); let streak = 0; let currentDate = new Date(today); + const todayStart = new Date(); + todayStart.setHours(0, 0, 0, 0); const startDate = new Date(userProfile.startDate); while (currentDate >= startDate) { @@ -227,7 +229,7 @@ export function RecoveryProvider({ children }: { children: ReactNode }) { } else if (dayEntry.status === 'relapse') { break; } - } else if (currentDate < new Date().setHours(0, 0, 0, 0)) { + } else if (currentDate < todayStart) { break; } diff --git a/eslint.config.js b/eslint.config.js index 5025da6..4cd30ec 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -7,4 +7,20 @@ module.exports = defineConfig([ { ignores: ['dist/*'], }, + { + files: ['__tests__/**/*.js', '__tests__/**/*.ts', '__tests__/**/*.tsx', '**/*.test.js', '**/*.test.ts', '**/*.test.tsx'], + languageOptions: { + globals: { + jest: 'readonly', + describe: 'readonly', + it: 'readonly', + test: 'readonly', + expect: 'readonly', + beforeEach: 'readonly', + afterEach: 'readonly', + beforeAll: 'readonly', + afterAll: 'readonly', + }, + }, + }, ]); diff --git a/package-lock.json b/package-lock.json index 9aee9f1..a68d52f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sober-path", - "version": "1.12.0", + "version": "1.13.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sober-path", - "version": "1.12.0", + "version": "1.13.0", "dependencies": { "@expo-google-fonts/inter": "^0.4.1", "@expo/metro-runtime": "~5.0.5", @@ -5482,9 +5482,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -5499,9 +5496,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -5516,9 +5510,6 @@ "loong64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -5533,9 +5524,6 @@ "loong64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -5550,9 +5538,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -5567,9 +5552,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -5584,9 +5566,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -5601,9 +5580,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -5618,9 +5594,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -5635,9 +5608,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -13499,9 +13469,6 @@ "cpu": [ "arm64" ], - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -13522,9 +13489,6 @@ "cpu": [ "arm64" ], - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -13545,9 +13509,6 @@ "cpu": [ "x64" ], - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -13568,9 +13529,6 @@ "cpu": [ "x64" ], - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ diff --git a/services/PsychologyService.ts b/services/PsychologyService.ts index a3a7060..88b0b11 100644 --- a/services/PsychologyService.ts +++ b/services/PsychologyService.ts @@ -72,6 +72,13 @@ export interface ModernTechnique { benefits: string[]; } +export interface MindfulnessExercise { + id: string; + title: string; + description: string; + duration?: number; +} + export const advancedCBTTechniques: CBTTechnique[] = [ { id: 'thought-defusion', @@ -195,6 +202,33 @@ export const modernTechniques: ModernTechnique[] = [ } ]; +export const mindfulnessExercises: MindfulnessExercise[] = [ + { + id: 'breath-awareness', + title: 'ОсознаниС дыхания', + description: 'ΠŸΡ€ΠΎΡΡ‚Π°Ρ ΠΏΡ€Π°ΠΊΡ‚ΠΈΠΊΠ° наблюдСния Π·Π° Π²Π΄ΠΎΡ…ΠΎΠΌ ΠΈ Π²Ρ‹Π΄ΠΎΡ…ΠΎΠΌ для возвращСния Π² настоящий ΠΌΠΎΠΌΠ΅Π½Ρ‚', + duration: 5 + }, + { + id: 'body-scan', + title: 'Π‘ΠΊΠ°Π½ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ Ρ‚Π΅Π»Π°', + description: 'ΠŸΠΎΡΡ‚Π΅ΠΏΠ΅Π½Π½ΠΎΠ΅ Π²Π½ΠΈΠΌΠ°Π½ΠΈΠ΅ ΠΊ ощущСниям Π² ΠΊΠ°ΠΆΠ΄ΠΎΠΉ части Ρ‚Π΅Π»Π° для снятия напряТСния', + duration: 10 + }, + { + id: 'loving-kindness', + title: 'Π›ΡŽΠ±ΡΡ‰Π°Ρ Π΄ΠΎΠ±Ρ€ΠΎΡ‚Π°', + description: 'ΠœΠ΅Π΄ΠΈΡ‚Π°Ρ†ΠΈΡ направлСнная Π½Π° Ρ€Π°Π·Π²ΠΈΡ‚ΠΈΠ΅ сострадания ΠΊ сСбС ΠΈ ΠΎΠΊΡ€ΡƒΠΆΠ°ΡŽΡ‰ΠΈΠΌ', + duration: 15 + }, + { + id: 'urge-surfing', + title: 'Π‘Π΅Ρ€Ρ„ΠΈΠ½Π³ тяги', + description: 'Π’Π΅Ρ…Π½ΠΈΠΊΠ° наблюдСния Π·Π° ΠΈΠΌΠΏΡƒΠ»ΡŒΡΠΎΠΌ ΠΊΠ°ΠΊ Π·Π° Π²ΠΎΠ»Π½ΠΎΠΉ, которая Π½Π΅ΠΈΠ·Π±Π΅ΠΆΠ½ΠΎ ΠΏΡ€ΠΎΡ…ΠΎΠ΄ΠΈΡ‚', + duration: 10 + } +]; + export const PsychologyService = { getTechniques: (): Result => { try { diff --git a/services/advancedMoodTracker.ts b/services/advancedMoodTracker.ts index 83830ae..17e4edd 100644 --- a/services/advancedMoodTracker.ts +++ b/services/advancedMoodTracker.ts @@ -181,7 +181,7 @@ export class AdvancedMoodTracker { } private async triggerInterventions(stressLevel: number, anomalies: string[]): Promise { - const interventions = []; + const interventions: Intervention[] = []; if (stressLevel > 0.8) { interventions.push({ @@ -278,7 +278,7 @@ export class AdvancedMoodTracker { // Π˜Π½Ρ‚Π΅Π»Π»Π΅ΠΊΡ‚ΡƒΠ°Π»ΡŒΠ½Ρ‹Π΅ вопросы Π½Π° основС контСкста generateSmartQuestions(context: any): SmartQuestion[] { - const questions = []; + const questions: SmartQuestion[] = []; const currentHour = new Date().getHours(); // Вопросы Π½Π° основС Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ дня @@ -324,8 +324,8 @@ export class AdvancedMoodTracker { // ΠŸΡ€Π΅Π΄ΠΈΠΊΡ‚ΠΈΠ²Π½Π°Ρ Π°Π½Π°Π»ΠΈΡ‚ΠΈΠΊΠ° private async predictMoodTrends(moodEntries: MoodEntry[]): Promise { // ΠŸΡ€ΠΎΡΡ‚Π°Ρ линСйная рСгрСссия для дСмонстрации - const trends = []; - + const trends: MoodPrediction[] = []; + const moodTrend = this.calculateTrend(moodEntries.map(e => e.mood)); const anxietyTrend = this.calculateTrend(moodEntries.map(e => e.anxiety)); const energyTrend = this.calculateTrend(moodEntries.map(e => e.energy)); @@ -358,6 +358,99 @@ export class AdvancedMoodTracker { const lastValue = values[values.length - 1]; return Math.max(1, Math.min(5, lastValue + trend)); } + + // === Stub implementations for callers of private helpers === + + private async collectContextualData(): Promise { + return { + timestamp: new Date(), + location: 'unknown', + weather: 'unknown', + activity: 'unknown', + socialContext: 'unknown' + }; + } + + private generateQuickMoodQuestions(context?: ContextualData): SmartQuestion[] { + return this.generateSmartQuestions(context ?? {}); + } + + private async generateContextualSuggestions( + biometricData: BiometricData, + contextualData: ContextualData + ): Promise { + return []; + } + + private async getMoodEntries(userId: string, timeRange: TimeRange): Promise { + return []; + } + + private analyzeDailyPatterns(moodEntries: MoodEntry[]): DailyPattern { + return { + averageMood: 0, + peakHours: [], + variability: 0 + }; + } + + private analyzeWeeklyPatterns(moodEntries: MoodEntry[]): WeeklyPattern { + return { + bestDay: '', + worstDay: '', + weeklyAverage: 0 + }; + } + + private analyzeTriggerPatterns(moodEntries: MoodEntry[]): TriggerPattern[] { + return []; + } + + private analyzeSeasonalPatterns(moodEntries: MoodEntry[]): SeasonalPattern { + return { + season: '', + moodTrend: 'stable', + recommendation: '' + }; + } + + private analyzeCorrelations(moodEntries: MoodEntry[]): CorrelationData { + return { + triggers: [], + weatherImpact: 0 + }; + } + + private generatePersonalizedRecommendations( + patterns: PatternData, + predictions: MoodPrediction[] + ): string[] { + return []; + } + + private assessRiskLevel(moodEntries: MoodEntry[]): RiskAssessment { + return { + level: 'low', + factors: [], + recommendations: [] + }; + } + + private generateInsights(patterns: PatternData): string[] { + return []; + } + + private detectAnomalies(data: BiometricData): string[] { + return []; + } + + private async updateCurrentState(data: BiometricData, stressLevel: number): Promise { + // Stub: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ обновлялось Π±Ρ‹ глобальноС состояниС ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ. + } + + private async sendInterventionNotification(intervention: Intervention): Promise { + // Stub: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ вызывался Π±Ρ‹ NotificationService. + } } // ΠšΠ»Π°ΡΡΡ‹ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠΈ @@ -481,4 +574,59 @@ interface SmartQuestion { options?: string[]; } +interface ContextualData { + timestamp: Date; + location?: string; + weather?: string; + activity?: string; + socialContext?: string; +} + +type TimeRange = number; + +interface DailyPattern { + averageMood: number; + peakHours: number[]; + variability: number; +} + +interface WeeklyPattern { + bestDay: string; + worstDay: string; + weeklyAverage: number; +} + +interface TriggerPattern { + trigger: string; + frequency: number; + severity: number; + contexts: string[]; +} + +interface SeasonalPattern { + season: string; + moodTrend: 'improving' | 'declining' | 'stable'; + recommendation: string; +} + +interface CorrelationData { + triggers: { trigger: string; correlation: number }[]; + weatherImpact: number; +} + +interface PatternData { + dailyPatterns: DailyPattern; + weeklyPatterns: WeeklyPattern; + triggerPatterns: TriggerPattern[]; + seasonalPatterns: SeasonalPattern; + correlations: CorrelationData; +} + +interface Intervention { + type: string; + title: string; + description: string; + urgency: 'low' | 'medium' | 'high'; +} + export default AdvancedMoodTracker; \ No newline at end of file diff --git a/services/advancedNLPTraining.ts b/services/advancedNLPTraining.ts index d3b26a3..14fb493 100644 --- a/services/advancedNLPTraining.ts +++ b/services/advancedNLPTraining.ts @@ -135,7 +135,7 @@ export const advancedNLPExercises: NLPExercise[] = [ instruction: 'Π‘ΠΎΠ·Π΄Π°ΠΉΡ‚Π΅ яркий ΠΎΠ±Ρ€Π°Π· сСбя - ΡƒΠ²Π΅Ρ€Π΅Π½Π½ΠΎΠ³ΠΎ, Π·Π΄ΠΎΡ€ΠΎΠ²ΠΎΠ³ΠΎ, Π»Π΅Π³ΠΊΠΎ ΡΠΏΡ€Π°Π²Π»ΡΡŽΡ‰Π΅Π³ΠΎΡΡ с этой ситуациСй. Π’Ρ‹ Π²ΠΈΠ΄ΠΈΡ‚Π΅ сСбя со стороны, ΠΈΠ·Π»ΡƒΡ‡Π°ΡŽΡ‰Π΅Π³ΠΎ спокойствиС ΠΈ силу.', duration: 4, visualAids: [ - { type: 'image', url: 'confident_self_visualization.jpg' } + { type: 'image', url: 'confident_self_visualization.jpg', description: 'Визуализация ΡƒΠ²Π΅Ρ€Π΅Π½Π½ΠΎΠ³ΠΎ сСбя' } ] }, { diff --git a/services/audioService.ts b/services/audioService.ts index 3c5959d..7324ad0 100644 --- a/services/audioService.ts +++ b/services/audioService.ts @@ -8,6 +8,16 @@ export interface RelaxingSound { duration: number; benefits: string[]; uri?: string; + frequency?: string; +} + +export interface HypnotherapySession { + id: string; + title: string; + description: string; + duration: number; + category?: string; + benefits?: string[]; } export const generatedSounds: RelaxingSound[] = [ diff --git a/services/interactiveMeditationService.ts b/services/interactiveMeditationService.ts index b5f4121..71f521b 100644 --- a/services/interactiveMeditationService.ts +++ b/services/interactiveMeditationService.ts @@ -471,6 +471,92 @@ export class InteractiveMeditationEngine { phases: [] }; } + + // === Stub implementations for callers of private helpers === + + private async loadMeditationSession(sessionId: string): Promise { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ Π·Π°Π³Ρ€ΡƒΠ·ΠΊΠ° сСссии ΠΈΠ· ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π° ΠΈΠ»ΠΈ Π‘Π”. + return this.getDefaultEmergencyMeditation(); + } + + private async applyAdaptations(adaptations: Adaptation[]): Promise { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ примСняСт измСнСния ΠΊ currentSession. + } + + private async completeMeditation(): Promise { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ сохраняСт сСссию ΠΈ Π°Π½Π°Π»ΠΈΡ‚ΠΈΠΊΡƒ. + } + + private async scheduleInstruction(instruction: Instruction, startTime: number): Promise { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ запускаСт воспроизвСдСниС Π°ΡƒΠ΄ΠΈΠΎ-инструкции. + } + + private async showVisualFeedback(feedback: FeedbackMethod, deviation: number): Promise { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Π²ΠΈΠ·ΡƒΠ°Π»ΡŒΠ½Π°Ρ обратная связь (Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€, Π΄Ρ‹Ρ…Π°Ρ‚Π΅Π»ΡŒΠ½Ρ‹ΠΉ ΠΊΡ€ΡƒΠ³). + } + + private async playAudioFeedback(feedback: FeedbackMethod, deviation: number): Promise { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: звуковая обратная связь (Ρ‚ΠΎΠ½Ρ‹, подсказки). + } + + private async triggerHapticFeedback(feedback: FeedbackMethod, deviation: number): Promise { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Ρ‚Π°ΠΊΡ‚ΠΈΠ»ΡŒΠ½Π°Ρ обратная связь Ρ‡Π΅Ρ€Π΅Π· expo-haptics. + } + + private scalePhaseDurations(phases: MeditationPhase[], scale: number): MeditationPhase[] { + return phases.map(phase => ({ ...phase, duration: phase.duration * scale })); + } + + private adaptInstructions(phases: MeditationPhase[], experienceLevel: string): MeditationPhase[] { + return phases; + } + + private customizeBiofeedback( + config: BiofeedbackConfig | undefined, + preferences: Partial | undefined + ): BiofeedbackConfig | undefined { + if (!config) return config; + if (!preferences) return config; + return { ...config, ...preferences }; + } + + private getLatestBiometrics(): BiometricReading { + const data = this.currentSession?.biometricData; + if (!data || data.length === 0) { + return { timestamp: new Date() }; + } + return data[data.length - 1]; + } + + private analyzeBiometricData(biometricData: BiometricReading[]): BiometricAnalysis { + return { + averageHeartRate: 0, + averageHRV: 0, + averageBreathingRate: 0, + stressLevel: 0, + coherenceScore: 0, + insights: [] + }; + } + + private analyzeAdaptations(adaptations: Adaptation[]): AdaptationAnalysis { + return { + totalAdaptations: adaptations.length, + adaptationTypes: [], + effectiveness: 0 + }; + } + + private generateRecommendations( + biometricAnalysis: BiometricAnalysis, + adaptationAnalysis: AdaptationAnalysis + ): string[] { + return []; + } + + private suggestNextSessions(session: ActiveMeditationSession): string[] { + return []; + } } // ΠŸΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°ΡŽΡ‰ΠΈΠ΅ классы ΠΈ интСрфСйсы @@ -559,4 +645,19 @@ interface VisualEffect { parameters: any; } +interface BiometricAnalysis { + averageHeartRate: number; + averageHRV: number; + averageBreathingRate: number; + stressLevel: number; + coherenceScore: number; + insights: string[]; +} + +interface AdaptationAnalysis { + totalAdaptations: number; + adaptationTypes: string[]; + effectiveness: number; +} + export default InteractiveMeditationEngine; \ No newline at end of file diff --git a/services/notificationService.ts b/services/notificationService.ts index e4ab5f6..475a708 100644 --- a/services/notificationService.ts +++ b/services/notificationService.ts @@ -5,7 +5,8 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; // Настройки ΡƒΠ²Π΅Π΄ΠΎΠΌΠ»Π΅Π½ΠΈΠΉ Notifications.setNotificationHandler({ handleNotification: async () => ({ - shouldShowAlert: true, + shouldShowBanner: true, + shouldShowList: true, shouldPlaySound: true, shouldSetBadge: false, }), @@ -211,34 +212,35 @@ class NotificationService { } // Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ Ρ‚Ρ€ΠΈΠ³Π³Π΅Ρ€Π° для увСдомлСния - private createTrigger(trigger: NotificationTrigger) { + private createTrigger(trigger: NotificationTrigger): Notifications.NotificationTriggerInput { switch (trigger.type) { case 'daily': return { + type: Notifications.SchedulableTriggerInputTypes.DAILY, hour: trigger.hour || 9, minute: trigger.minute || 0, - repeats: true }; - + case 'weekly': return { + type: Notifications.SchedulableTriggerInputTypes.WEEKLY, weekday: trigger.weekday || 1, hour: trigger.hour || 9, minute: trigger.minute || 0, - repeats: true }; - + case 'interval': return { + type: Notifications.SchedulableTriggerInputTypes.TIME_INTERVAL, seconds: trigger.seconds || 3600, - repeats: true + repeats: true, }; - + default: return { + type: Notifications.SchedulableTriggerInputTypes.DAILY, hour: 9, minute: 0, - repeats: true }; } } @@ -341,8 +343,9 @@ class NotificationService { sound: 'default', }, trigger: { + type: Notifications.SchedulableTriggerInputTypes.TIME_INTERVAL, seconds, - repeats: false + repeats: false, }, }); } @@ -399,7 +402,7 @@ class NotificationService { } // Web push notifications setup - async setupWebNotifications(): Promise { + async setupWebNotifications(): Promise { if (Platform.OS === 'web' && 'Notification' in window) { if (Notification.permission === 'default') { const permission = await Notification.requestPermission(); diff --git a/services/personalizationService.ts b/services/personalizationService.ts index 8105880..2d1e934 100644 --- a/services/personalizationService.ts +++ b/services/personalizationService.ts @@ -258,11 +258,96 @@ export class PersonalizationEngine { private calculateVolatility(data: number[]): 'stable' | 'moderate' | 'high' { const average = data.reduce((a, b) => a + b, 0) / data.length; const variance = data.reduce((acc, val) => acc + Math.pow(val - average, 2), 0) / data.length; - + if (variance < 0.5) return 'stable'; if (variance < 1.5) return 'moderate'; return 'high'; } + + // === Stub implementations for callers of private helpers === + + private findOptimalTimes(timeOfDayPreferences: TimeOfDayPreference[]): OptimalTimePattern[] { + return []; + } + + private rankTechniques(techniques: string[], successfulTechniques: string[]): TechniqueRanking[] { + return []; + } + + private assessRiskFactors(behaviorData: UserBehaviorData): RiskFactor[] { + return []; + } + + private calculateResilienceScore(behaviorData: UserBehaviorData): ResilienceScore { + return { + overall: 0, + emotional: 0, + social: 0, + cognitive: 0, + behavioral: 0 + }; + } + + private calculateConfidence(behaviorData: UserBehaviorData): number { + return 0; + } + + private assessCurrentRisk(currentContext: CurrentContext, userProfile: UserProfile): { level: string } { + return { level: 'low' }; + } + + private generatePreventiveRecommendations( + context: CurrentContext, + profile: UserProfile + ): PersonalizedRecommendation[] { + return []; + } + + private generateMaintenanceRecommendations( + context: CurrentContext, + profile: UserProfile + ): PersonalizedRecommendation[] { + return []; + } + + private recommendSocialSupport( + context: CurrentContext, + profile: UserProfile + ): PersonalizedRecommendation[] { + return []; + } + + private identifyLowMoodTriggers(moodData: number[]): string[] { + return []; + } + + private groupTriggersByTime(triggers: TriggerPattern[]): { [key: string]: TriggerPattern[] } { + return {}; + } + + private groupTriggersByEmotion(triggers: TriggerPattern[]): { [key: string]: TriggerPattern[] } { + return {}; + } + + private groupTriggersByContext(triggers: TriggerPattern[]): { [key: string]: TriggerPattern[] } { + return {}; + } + + private updateTechniqueWeights(recommendationId: string, outcome: RecommendationOutcome): void { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ вСсов Ρ‚Π΅Ρ…Π½ΠΈΠΊ Π² ML-ΠΌΠΎΠ΄Π΅Π»ΠΈ. + } + + private updateContextualWeights(context: CurrentContext, effectiveness: number): void { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ контСкстных вСсов. + } + + private updateTimeBasedWeights(timeOfDay: number, effectiveness: number): void { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ вСсов ΠΏΠΎ Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ суток. + } + + private saveLearningData(data: LearningData): void { + // Π—Π°Π³Π»ΡƒΡˆΠΊΠ°: Π² Ρ€Π΅Π°Π»ΡŒΠ½ΠΎΠΌ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ сохранСниС ΠΎΠ±ΡƒΡ‡Π°ΡŽΡ‰ΠΈΡ… Π΄Π°Π½Π½Ρ‹Ρ…. + } } // Π’ΠΈΠΏΡ‹ для систСмы пСрсонализации @@ -343,4 +428,17 @@ interface RecommendationOutcome { feedback: string; } +interface TimeOfDayPreference { + hour: number; + activity: string; +} + +interface LearningData { + userId: string; + recommendationId: string; + context: CurrentContext; + effectiveness: number; + timestamp: Date; +} + export default PersonalizationEngine; \ No newline at end of file diff --git a/services/smartNotificationService.ts b/services/smartNotificationService.ts index ddb8b52..6b1c637 100644 --- a/services/smartNotificationService.ts +++ b/services/smartNotificationService.ts @@ -78,7 +78,8 @@ class SmartNotificationService { // Настройка ΠΎΠ±Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠ° ΡƒΠ²Π΅Π΄ΠΎΠΌΠ»Π΅Π½ΠΈΠΉ Notifications.setNotificationHandler({ handleNotification: async () => ({ - shouldShowAlert: true, + shouldShowBanner: true, + shouldShowList: true, shouldPlaySound: true, shouldSetBadge: false, }), @@ -246,7 +247,9 @@ class SmartNotificationService { } } - const trigger = notification.scheduledFor ? { date: notification.scheduledFor } : null; + const trigger: Notifications.NotificationTriggerInput = notification.scheduledFor + ? { type: Notifications.SchedulableTriggerInputTypes.DATE, date: notification.scheduledFor } + : null; await Notifications.scheduleNotificationAsync({ identifier: notification.id,