@rexai/pulse-react 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -2
- package/dist/index.d.mts +361 -107
- package/dist/index.d.ts +361 -107
- package/dist/index.js +68 -13
- package/dist/index.mjs +68 -13
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @rexai/pulse-react
|
|
2
2
|
|
|
3
|
-
React SDK for
|
|
3
|
+
React SDK for comprehensive health analysis - measure heart rate, HRV, SpO2, skin health, voice biomarkers, and eye health from any camera or microphone using AI-powered analysis.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -101,7 +101,7 @@ const client = new PulseClient({
|
|
|
101
101
|
apiKey: 'pk_live_YOUR_API_KEY'
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
// Analyze a video blob
|
|
104
|
+
// Analyze a video blob for medical vitals
|
|
105
105
|
const vitals = await client.analyze({
|
|
106
106
|
video: videoBlob,
|
|
107
107
|
age: 30,
|
|
@@ -110,6 +110,35 @@ const vitals = await client.analyze({
|
|
|
110
110
|
|
|
111
111
|
console.log(vitals.heart_rate); // 72
|
|
112
112
|
console.log(vitals.spo2); // 98
|
|
113
|
+
|
|
114
|
+
// Analyze beauty/skin metrics
|
|
115
|
+
const beauty = await client.analyzeBeauty({
|
|
116
|
+
video: videoBlob,
|
|
117
|
+
age: 30,
|
|
118
|
+
gender: 'female'
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
console.log(beauty.summary.skin_age); // 28
|
|
122
|
+
console.log(beauty.surface.hydration); // 75
|
|
123
|
+
|
|
124
|
+
// Analyze voice for health biomarkers
|
|
125
|
+
const voice = await client.analyzeVoice({
|
|
126
|
+
audio: audioBlob
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
console.log(voice.stress_score); // 35
|
|
130
|
+
console.log(voice.respiratory_rate); // 16
|
|
131
|
+
console.log(voice.wellness_score); // 72
|
|
132
|
+
|
|
133
|
+
// Analyze eye health
|
|
134
|
+
const eye = await client.analyzeEye({
|
|
135
|
+
video: videoBlob
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
console.log(eye.overall_score); // 85
|
|
139
|
+
console.log(eye.cataract.risk_level); // "low"
|
|
140
|
+
console.log(eye.red_eye.is_inflamed); // false
|
|
141
|
+
console.log(eye.recommendations); // ["Maintain regular eye exams", ...]
|
|
113
142
|
```
|
|
114
143
|
|
|
115
144
|
## Hooks
|
|
@@ -130,6 +159,8 @@ function CustomScanner() {
|
|
|
130
159
|
|
|
131
160
|
## Vitals Returned
|
|
132
161
|
|
|
162
|
+
### Medical Analysis (`analyze`)
|
|
163
|
+
|
|
133
164
|
| Metric | Type | Description |
|
|
134
165
|
|--------|------|-------------|
|
|
135
166
|
| `heart_rate` | number | Heart rate in BPM |
|
|
@@ -142,6 +173,41 @@ function CustomScanner() {
|
|
|
142
173
|
| `recovery_score` | number | Recovery score % |
|
|
143
174
|
| `vascular_age` | number | Estimated vascular age |
|
|
144
175
|
|
|
176
|
+
### Voice Analysis (`analyzeVoice`)
|
|
177
|
+
|
|
178
|
+
| Metric | Type | Description |
|
|
179
|
+
|--------|------|-------------|
|
|
180
|
+
| `stress_score` | number | Voice stress score (0-100) |
|
|
181
|
+
| `fatigue_score` | number | Fatigue indicator (0-100) |
|
|
182
|
+
| `anxiety_level` | string | Anxiety level (low/mild/moderate/high) |
|
|
183
|
+
| `respiratory_rate` | number | Breathing rate from audio |
|
|
184
|
+
| `respiratory_health` | number | Respiratory health score |
|
|
185
|
+
| `cough_detected` | boolean | Cough presence detected |
|
|
186
|
+
| `depression_risk` | string | Depression risk indicator |
|
|
187
|
+
| `cognitive_load` | string | Mental load level |
|
|
188
|
+
| `wellness_score` | number | Overall wellness (0-100) |
|
|
189
|
+
| `composite_scores` | object | Mental, physical, cognitive, resilience scores |
|
|
190
|
+
|
|
191
|
+
### Eye Analysis (`analyzeEye`)
|
|
192
|
+
|
|
193
|
+
| Metric | Type | Description |
|
|
194
|
+
|--------|------|-------------|
|
|
195
|
+
| `overall_score` | number | Overall eye health score (0-100) |
|
|
196
|
+
| `health_level` | string | Health level (Excellent/Good/Fair/Needs Attention) |
|
|
197
|
+
| `cataract` | object | Cataract screening results |
|
|
198
|
+
| `cataract.opacity_score` | number | Lens opacity measurement (0-100) |
|
|
199
|
+
| `cataract.risk_level` | string | Risk level (low/mild/moderate/high) |
|
|
200
|
+
| `red_eye` | object | Red eye/inflammation detection |
|
|
201
|
+
| `red_eye.redness_score` | number | Redness measurement (0-100) |
|
|
202
|
+
| `red_eye.is_inflamed` | boolean | Inflammation detected |
|
|
203
|
+
| `lens_clarity` | object | Lens clarity assessment |
|
|
204
|
+
| `pupil` | object | Pupil analysis results |
|
|
205
|
+
| `pterygium` | object | Pterygium detection |
|
|
206
|
+
| `stye` | object | Stye/chalazion detection |
|
|
207
|
+
| `sclera` | object | Sclera health (yellowing/jaundice risk) |
|
|
208
|
+
| `recommendations` | string[] | Personalized recommendations |
|
|
209
|
+
| `analysis_confidence` | number | Analysis confidence % |
|
|
210
|
+
|
|
145
211
|
## Getting an API Key
|
|
146
212
|
|
|
147
213
|
Contact us for API access or visit the developer portal to generate your API key.
|
package/dist/index.d.mts
CHANGED
|
@@ -2,130 +2,346 @@ import React$1 from 'react';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* PulseAI SDK Type Definitions
|
|
5
|
+
*
|
|
6
|
+
* Version: 2.1.0
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT: Many metrics now return `null` when calculation fails.
|
|
9
|
+
* Always check for null before displaying values.
|
|
5
10
|
*/
|
|
11
|
+
interface BloodPressureFeatures {
|
|
12
|
+
rise_time_ms: number | null;
|
|
13
|
+
pulse_amplitude: number | null;
|
|
14
|
+
pulse_width_ms: number | null;
|
|
15
|
+
augmentation_index: number | null;
|
|
16
|
+
pulses_analyzed: number;
|
|
17
|
+
}
|
|
6
18
|
interface BloodPressure {
|
|
7
|
-
systolic: number;
|
|
8
|
-
diastolic: number;
|
|
19
|
+
systolic: number | null;
|
|
20
|
+
diastolic: number | null;
|
|
21
|
+
pulse_pressure: number | null;
|
|
22
|
+
confidence: 'high' | 'moderate' | 'low' | 'very_low' | null;
|
|
23
|
+
features?: BloodPressureFeatures;
|
|
24
|
+
methodology?: string;
|
|
25
|
+
note?: string;
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
interface SpO2MethodResult {
|
|
29
|
+
spo2: number;
|
|
30
|
+
ratio: number;
|
|
31
|
+
quality: number;
|
|
32
|
+
}
|
|
33
|
+
interface SpO2Result {
|
|
34
|
+
spo2: number | null;
|
|
35
|
+
confidence: 'high' | 'moderate' | 'low' | 'very_low' | null;
|
|
36
|
+
method_used: 'red_blue' | 'green_red' | null;
|
|
37
|
+
signal_quality: number | null;
|
|
38
|
+
methods?: {
|
|
39
|
+
red_blue?: SpO2MethodResult;
|
|
40
|
+
green_red?: SpO2MethodResult;
|
|
41
|
+
};
|
|
42
|
+
error?: string;
|
|
9
43
|
}
|
|
10
44
|
interface ArrhythmiaResult {
|
|
11
|
-
has_arrhythmia: boolean;
|
|
12
|
-
irregularity_score: number;
|
|
13
|
-
|
|
45
|
+
has_arrhythmia: boolean | null;
|
|
46
|
+
irregularity_score: number | null;
|
|
47
|
+
confidence: number | null;
|
|
48
|
+
details: string | null;
|
|
49
|
+
}
|
|
50
|
+
interface StressResult {
|
|
51
|
+
score: number | null;
|
|
52
|
+
level: 'low' | 'mild' | 'moderate' | 'high' | null;
|
|
53
|
+
confidence: number | null;
|
|
54
|
+
rmssd_ms: number | null;
|
|
55
|
+
}
|
|
56
|
+
interface RecoveryResult {
|
|
57
|
+
score: number | null;
|
|
58
|
+
level: 'poor' | 'moderate' | 'good' | 'excellent' | null;
|
|
59
|
+
rmssd_ms: number | null;
|
|
60
|
+
}
|
|
61
|
+
interface RespiratoryResult {
|
|
62
|
+
rate: number | null;
|
|
63
|
+
confidence: 'high' | 'moderate' | 'low' | null;
|
|
64
|
+
signal_quality: number | null;
|
|
65
|
+
breaths_detected: number | null;
|
|
66
|
+
interval_variability: number | null;
|
|
67
|
+
error?: string;
|
|
68
|
+
}
|
|
69
|
+
interface VascularAgeResult {
|
|
70
|
+
vascular_age: number | null;
|
|
71
|
+
chronological_age: number | null;
|
|
72
|
+
difference_years: number | null;
|
|
73
|
+
status: 'younger_than_chronological' | 'close_to_chronological' | 'moderately_elevated' | 'significantly_elevated' | null;
|
|
74
|
+
methodology?: string;
|
|
75
|
+
}
|
|
76
|
+
interface BMIEstimate {
|
|
77
|
+
value: number | null;
|
|
78
|
+
category: 'Underweight' | 'Normal' | 'Overweight' | 'Obese' | null;
|
|
79
|
+
confidence: 'high' | 'moderate' | 'low' | 'very_low' | 'invalid' | null;
|
|
80
|
+
fwhr: number | null;
|
|
81
|
+
source?: 'manual_input' | 'facial_estimation';
|
|
82
|
+
methodology?: string;
|
|
83
|
+
note?: string;
|
|
84
|
+
reason?: string;
|
|
85
|
+
}
|
|
86
|
+
interface SkinTemperatureResult {
|
|
87
|
+
value: number | null;
|
|
88
|
+
unit: string;
|
|
89
|
+
ratio: number | null;
|
|
90
|
+
confidence: 'proxy_only' | 'invalid_ratio';
|
|
91
|
+
note?: string;
|
|
92
|
+
}
|
|
93
|
+
interface FatigueIndicators {
|
|
94
|
+
eye_redness: number | null;
|
|
95
|
+
under_eye_darkness: number | null;
|
|
96
|
+
puffiness: number | null;
|
|
97
|
+
overall_fatigue: string | null;
|
|
98
|
+
}
|
|
99
|
+
interface SkinHealth {
|
|
100
|
+
evenness: number | null;
|
|
101
|
+
redness: number | null;
|
|
102
|
+
oiliness_proxy: number | null;
|
|
14
103
|
}
|
|
15
104
|
interface VisualAnalysis {
|
|
16
|
-
jaundice_risk: 'Low' | 'Medium' | 'High';
|
|
17
|
-
anemia_risk: 'Low' | 'Medium' | 'High';
|
|
18
|
-
bilirubin_proxy: number;
|
|
19
|
-
pallor_index: number;
|
|
20
|
-
hydration_level?: string;
|
|
21
|
-
hydration_score?: number;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
oiliness_proxy: number;
|
|
32
|
-
};
|
|
105
|
+
jaundice_risk: 'Low' | 'Medium' | 'High' | null;
|
|
106
|
+
anemia_risk: 'Low' | 'Medium' | 'High' | null;
|
|
107
|
+
bilirubin_proxy: number | null;
|
|
108
|
+
pallor_index: number | null;
|
|
109
|
+
hydration_level?: string | null;
|
|
110
|
+
hydration_score?: number | null;
|
|
111
|
+
texture_score?: number | null;
|
|
112
|
+
fatigue_indicators?: FatigueIndicators;
|
|
113
|
+
skin_health?: SkinHealth;
|
|
114
|
+
}
|
|
115
|
+
interface MentalWellnessComponents {
|
|
116
|
+
blink_score: number | null;
|
|
117
|
+
gaze_score: number | null;
|
|
118
|
+
emotion_score: number | null;
|
|
119
|
+
hrv_score: number | null;
|
|
33
120
|
}
|
|
34
121
|
interface MentalWellness {
|
|
35
|
-
wellness_score: number;
|
|
36
|
-
level: string;
|
|
37
|
-
emotion: string;
|
|
38
|
-
emotion_confidence?: number;
|
|
39
|
-
blink_rate_per_min: number;
|
|
40
|
-
gaze_stability: number;
|
|
41
|
-
gaze_direction?: string;
|
|
42
|
-
components:
|
|
43
|
-
blink_score: number;
|
|
44
|
-
gaze_score: number;
|
|
45
|
-
emotion_score: number;
|
|
46
|
-
hrv_score: number;
|
|
47
|
-
};
|
|
122
|
+
wellness_score: number | null;
|
|
123
|
+
level: string | null;
|
|
124
|
+
emotion: string | null;
|
|
125
|
+
emotion_confidence?: number | null;
|
|
126
|
+
blink_rate_per_min: number | null;
|
|
127
|
+
gaze_stability: number | null;
|
|
128
|
+
gaze_direction?: string | null;
|
|
129
|
+
components: MentalWellnessComponents | null;
|
|
48
130
|
}
|
|
49
|
-
interface
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
131
|
+
interface CompositeScoreDetails {
|
|
132
|
+
cardio?: string[];
|
|
133
|
+
resilience?: string[];
|
|
134
|
+
metabolic?: string[];
|
|
135
|
+
vitality?: string[];
|
|
54
136
|
}
|
|
55
|
-
interface
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
137
|
+
interface CompositeScores {
|
|
138
|
+
cardio_score: number | null;
|
|
139
|
+
resilience_score: number | null;
|
|
140
|
+
metabolic_score: number | null;
|
|
141
|
+
vitality_score: number | null;
|
|
142
|
+
calculation_details?: CompositeScoreDetails;
|
|
143
|
+
bmi_used?: number;
|
|
61
144
|
}
|
|
62
145
|
interface VitalsResult {
|
|
63
|
-
heart_rate: number;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
146
|
+
heart_rate: number | null;
|
|
147
|
+
hr_confidence?: 'high' | 'moderate' | 'low' | 'very_low' | null;
|
|
148
|
+
hr_snr_db?: number | null;
|
|
149
|
+
respiratory_rate: RespiratoryResult | number | null;
|
|
150
|
+
hrv_sdnn: number | null;
|
|
151
|
+
hrv_rmssd: number | null;
|
|
152
|
+
stress_index: StressResult | number | null;
|
|
153
|
+
recovery_score: RecoveryResult | number | null;
|
|
154
|
+
arrhythmia: ArrhythmiaResult | null;
|
|
155
|
+
rsa_amplitude: number | null;
|
|
156
|
+
blood_pressure: BloodPressure | null;
|
|
157
|
+
spo2: SpO2Result | number | null;
|
|
158
|
+
vascular_age: VascularAgeResult | number | null;
|
|
159
|
+
bmi_est: BMIEstimate | null;
|
|
76
160
|
manual_bmi?: number;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
fusion_weights
|
|
161
|
+
skin_temperature: SkinTemperatureResult | number | null;
|
|
162
|
+
composite_scores: CompositeScores | null;
|
|
163
|
+
visual_analysis?: VisualAnalysis | null;
|
|
164
|
+
mental_wellness?: MentalWellness | null;
|
|
165
|
+
signal_snippet?: number[];
|
|
166
|
+
fusion_weights?: Record<string, number>;
|
|
167
|
+
metadata?: {
|
|
168
|
+
video_fps?: number;
|
|
169
|
+
frames_analyzed?: number;
|
|
170
|
+
};
|
|
171
|
+
error?: string | null;
|
|
83
172
|
}
|
|
84
173
|
interface BeautySummary {
|
|
85
|
-
overall_score: number;
|
|
86
|
-
skin_age: number;
|
|
174
|
+
overall_score: number | null;
|
|
175
|
+
skin_age: number | null;
|
|
176
|
+
age_provided: boolean;
|
|
177
|
+
age_difference?: number;
|
|
178
|
+
calculation_details?: Record<string, number>;
|
|
179
|
+
skin_age_note?: string;
|
|
180
|
+
error?: string;
|
|
87
181
|
}
|
|
88
182
|
interface BeautySurface {
|
|
89
|
-
texture: number;
|
|
90
|
-
hydration: number;
|
|
91
|
-
foundation_hex: string;
|
|
92
|
-
undertone:
|
|
93
|
-
acne_count: number;
|
|
94
|
-
acne_severity:
|
|
95
|
-
wrinkle_severity:
|
|
96
|
-
wrinkle_density: number;
|
|
97
|
-
oiliness_index: number;
|
|
98
|
-
matches: string;
|
|
99
|
-
skin_health:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
183
|
+
texture: number | null;
|
|
184
|
+
hydration: number | null;
|
|
185
|
+
foundation_hex: string | null;
|
|
186
|
+
undertone: 'warm' | 'cool' | null;
|
|
187
|
+
acne_count: number | null;
|
|
188
|
+
acne_severity: 'minimal' | 'mild' | 'moderate' | 'significant' | null;
|
|
189
|
+
wrinkle_severity: 'minimal' | 'mild' | 'moderate' | 'significant' | null;
|
|
190
|
+
wrinkle_density: number | null;
|
|
191
|
+
oiliness_index: number | null;
|
|
192
|
+
matches: string | null;
|
|
193
|
+
skin_health: SkinHealth | null;
|
|
194
|
+
}
|
|
195
|
+
interface PtosisIndices {
|
|
196
|
+
status: 'none' | 'mild' | 'significant' | null;
|
|
197
|
+
youth_ratio?: number | null;
|
|
198
|
+
eye_openness?: number | null;
|
|
104
199
|
}
|
|
105
200
|
interface BeautyGeometry {
|
|
106
|
-
symmetry_score: number;
|
|
107
|
-
face_shape:
|
|
108
|
-
|
|
109
|
-
ptosis_indices:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
201
|
+
symmetry_score: number | null;
|
|
202
|
+
face_shape: 'oval' | 'round' | 'square' | 'oblong' | null;
|
|
203
|
+
landmarks?: any;
|
|
204
|
+
ptosis_indices: PtosisIndices;
|
|
205
|
+
analysis_confidence?: 'high' | 'moderate' | 'low';
|
|
206
|
+
error?: string;
|
|
113
207
|
}
|
|
114
208
|
interface BeautyPhysiology {
|
|
115
|
-
glow_index: number;
|
|
116
|
-
stress_level:
|
|
117
|
-
elasticity: number;
|
|
209
|
+
glow_index: number | null;
|
|
210
|
+
stress_level: 'low' | 'moderate' | 'high' | null;
|
|
211
|
+
elasticity: number | null;
|
|
212
|
+
heart_rate?: number | null;
|
|
118
213
|
}
|
|
119
214
|
interface BeautyRecommendations {
|
|
120
215
|
routine: string[];
|
|
121
216
|
tips: string[];
|
|
217
|
+
foundation?: string | null;
|
|
122
218
|
}
|
|
123
219
|
interface BeautyResult {
|
|
124
|
-
summary: BeautySummary;
|
|
125
|
-
surface: BeautySurface;
|
|
126
|
-
geometry: BeautyGeometry;
|
|
127
|
-
physiology: BeautyPhysiology;
|
|
128
|
-
recommendations: BeautyRecommendations;
|
|
220
|
+
summary: BeautySummary | null;
|
|
221
|
+
surface: BeautySurface | null;
|
|
222
|
+
geometry: BeautyGeometry | null;
|
|
223
|
+
physiology: BeautyPhysiology | null;
|
|
224
|
+
recommendations: BeautyRecommendations | null;
|
|
225
|
+
meta?: {
|
|
226
|
+
rppg_source: string;
|
|
227
|
+
beauty_engine: string;
|
|
228
|
+
};
|
|
229
|
+
error?: string | null;
|
|
230
|
+
}
|
|
231
|
+
interface VoiceCompositeScores {
|
|
232
|
+
mental_score: number | null;
|
|
233
|
+
physical_score: number | null;
|
|
234
|
+
cognitive_score: number | null;
|
|
235
|
+
resilience_score: number | null;
|
|
236
|
+
}
|
|
237
|
+
interface VoiceMoodIndicators {
|
|
238
|
+
pitch_monotony?: 'high' | 'moderate' | 'low';
|
|
239
|
+
speech_slowness?: 'high' | 'moderate' | 'low';
|
|
240
|
+
excessive_pauses?: boolean;
|
|
241
|
+
flat_affect?: boolean | 'partial';
|
|
242
|
+
}
|
|
243
|
+
interface VoiceResult {
|
|
244
|
+
status: 'success' | 'error' | null;
|
|
245
|
+
error?: string | null;
|
|
246
|
+
stress_score: number | null;
|
|
247
|
+
fatigue_score: number | null;
|
|
248
|
+
anxiety_level: 'low' | 'mild' | 'moderate' | 'high' | null;
|
|
249
|
+
anxiety_confidence: number | null;
|
|
250
|
+
voice_quality: 'healthy' | 'mild_strain' | 'moderate_strain' | 'significant_strain' | null;
|
|
251
|
+
pitch_variability: number | null;
|
|
252
|
+
speech_rate: number | null;
|
|
253
|
+
pause_ratio: number | null;
|
|
254
|
+
tremor_index: number | null;
|
|
255
|
+
energy_variability: number | null;
|
|
256
|
+
respiratory_rate: number | null;
|
|
257
|
+
breathing_regularity: number | null;
|
|
258
|
+
breath_depth: 'shallow' | 'normal' | 'deep' | null;
|
|
259
|
+
respiratory_health: number | null;
|
|
260
|
+
cough_detected: boolean | null;
|
|
261
|
+
cough_count: number | null;
|
|
262
|
+
wheeze_detected: boolean | null;
|
|
263
|
+
respiratory_concern: 'none' | 'mild' | 'elevated' | null;
|
|
264
|
+
depression_risk: 'low' | 'mild' | 'moderate' | 'elevated' | null;
|
|
265
|
+
depression_score: number | null;
|
|
266
|
+
mood_indicators: VoiceMoodIndicators | null;
|
|
267
|
+
cognitive_load: 'low' | 'normal' | 'moderate' | 'high' | null;
|
|
268
|
+
cognitive_score: number | null;
|
|
269
|
+
focus_indicator: 'relaxed' | 'stable' | 'engaged' | 'strained' | null;
|
|
270
|
+
composite_scores: VoiceCompositeScores | null;
|
|
271
|
+
wellness_score: number | null;
|
|
272
|
+
wellness_level: 'excellent' | 'good' | 'moderate' | 'fair' | 'poor' | null;
|
|
273
|
+
pitch_mean: number | null;
|
|
274
|
+
pitch_range: number | null;
|
|
275
|
+
energy_dynamics: number | null;
|
|
276
|
+
rhythm_regularity: number | null;
|
|
277
|
+
jitter: number | null;
|
|
278
|
+
shimmer: number | null;
|
|
279
|
+
duration_seconds: number | null;
|
|
280
|
+
analysis_confidence: number | null;
|
|
281
|
+
analysis_version: string;
|
|
282
|
+
}
|
|
283
|
+
interface EyeCataract {
|
|
284
|
+
opacity_score: number | null;
|
|
285
|
+
risk_level: 'low' | 'mild' | 'moderate' | 'elevated' | null;
|
|
286
|
+
confidence: 'high' | 'moderate' | 'low' | null;
|
|
287
|
+
description: string | null;
|
|
288
|
+
recommendation: string | null;
|
|
289
|
+
}
|
|
290
|
+
interface EyeRedEye {
|
|
291
|
+
redness_score: number | null;
|
|
292
|
+
risk_level: 'low' | 'mild' | 'moderate' | 'elevated' | null;
|
|
293
|
+
is_inflamed: boolean | null;
|
|
294
|
+
confidence: 'high' | 'moderate' | 'low' | null;
|
|
295
|
+
description: string | null;
|
|
296
|
+
}
|
|
297
|
+
interface EyeLensClarity {
|
|
298
|
+
score: number | null;
|
|
299
|
+
level: 'clear' | 'good' | 'moderate' | 'reduced' | null;
|
|
300
|
+
samples?: number;
|
|
301
|
+
}
|
|
302
|
+
interface EyePupil {
|
|
303
|
+
regularity_score: number | null;
|
|
304
|
+
circularity: number | null;
|
|
305
|
+
status: 'normal' | 'irregular' | null;
|
|
306
|
+
samples_analyzed?: number;
|
|
307
|
+
detected?: boolean;
|
|
308
|
+
}
|
|
309
|
+
interface EyePterygium {
|
|
310
|
+
detected: boolean | null;
|
|
311
|
+
confidence: number | null;
|
|
312
|
+
severity?: 'minimal' | 'mild' | 'moderate' | 'significant' | null;
|
|
313
|
+
description?: string;
|
|
314
|
+
error?: string;
|
|
315
|
+
}
|
|
316
|
+
interface EyeStye {
|
|
317
|
+
detected: boolean | null;
|
|
318
|
+
confidence: number | null;
|
|
319
|
+
note?: string;
|
|
320
|
+
}
|
|
321
|
+
interface EyeSclera {
|
|
322
|
+
score: number | null;
|
|
323
|
+
risk: 'low' | 'moderate' | 'elevated' | null;
|
|
324
|
+
color_health: 'healthy' | 'monitor' | null;
|
|
325
|
+
samples?: number;
|
|
326
|
+
error?: string;
|
|
327
|
+
}
|
|
328
|
+
interface EyeResult {
|
|
329
|
+
status: 'success' | 'error' | null;
|
|
330
|
+
overall_score: number | null;
|
|
331
|
+
health_level: 'Excellent' | 'Good' | 'Fair' | 'Needs Attention' | 'Consult Specialist' | null;
|
|
332
|
+
cataract: EyeCataract | null;
|
|
333
|
+
red_eye: EyeRedEye | null;
|
|
334
|
+
lens_clarity: EyeLensClarity | null;
|
|
335
|
+
pupil: EyePupil | null;
|
|
336
|
+
pterygium: EyePterygium | null;
|
|
337
|
+
stye: EyeStye | null;
|
|
338
|
+
sclera: EyeSclera | null;
|
|
339
|
+
recommendations: string[] | null;
|
|
340
|
+
frames_analyzed: number;
|
|
341
|
+
eyes_detected: number;
|
|
342
|
+
analysis_confidence: 'high' | 'moderate' | 'low' | null;
|
|
343
|
+
analysis_version?: string;
|
|
344
|
+
error?: string | null;
|
|
129
345
|
}
|
|
130
346
|
interface APIResponse<T> {
|
|
131
347
|
status: 'success' | 'error';
|
|
@@ -199,21 +415,21 @@ declare const PulseScanner: React$1.FC<PulseScannerProps>;
|
|
|
199
415
|
*/
|
|
200
416
|
interface VitalsCardProps {
|
|
201
417
|
/** Heart rate in BPM */
|
|
202
|
-
heartRate?: number;
|
|
418
|
+
heartRate?: number | null;
|
|
203
419
|
/** Oxygen saturation percentage */
|
|
204
|
-
spo2?: number;
|
|
420
|
+
spo2?: number | null;
|
|
205
421
|
/** Stress index (0-100) */
|
|
206
|
-
stressIndex?: number;
|
|
422
|
+
stressIndex?: number | null;
|
|
207
423
|
/** HRV SDNN in milliseconds */
|
|
208
|
-
hrvSdnn?: number;
|
|
424
|
+
hrvSdnn?: number | null;
|
|
209
425
|
/** HRV RMSSD in milliseconds */
|
|
210
|
-
hrvRmssd?: number;
|
|
426
|
+
hrvRmssd?: number | null;
|
|
211
427
|
/** Respiratory rate per minute */
|
|
212
|
-
respiratoryRate?: number;
|
|
428
|
+
respiratoryRate?: number | null;
|
|
213
429
|
/** Blood pressure readings */
|
|
214
|
-
bloodPressure?: BloodPressure;
|
|
430
|
+
bloodPressure?: BloodPressure | null;
|
|
215
431
|
/** Recovery score percentage */
|
|
216
|
-
recoveryScore?: number;
|
|
432
|
+
recoveryScore?: number | null;
|
|
217
433
|
/** Show loading state */
|
|
218
434
|
loading?: boolean;
|
|
219
435
|
/** Error message to display */
|
|
@@ -291,6 +507,20 @@ interface BeautyAnalyzeOptions {
|
|
|
291
507
|
/** User's gender */
|
|
292
508
|
gender?: 'male' | 'female';
|
|
293
509
|
}
|
|
510
|
+
/**
|
|
511
|
+
* Options for voice health analysis
|
|
512
|
+
*/
|
|
513
|
+
interface VoiceAnalyzeOptions {
|
|
514
|
+
/** Audio blob to analyze (webm, wav, mp3, ogg, m4a) */
|
|
515
|
+
audio: Blob;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Options for eye health analysis
|
|
519
|
+
*/
|
|
520
|
+
interface EyeAnalyzeOptions {
|
|
521
|
+
/** Video blob to analyze (webm or mp4) */
|
|
522
|
+
video: Blob;
|
|
523
|
+
}
|
|
294
524
|
/**
|
|
295
525
|
* PulseAI API Client
|
|
296
526
|
*
|
|
@@ -316,6 +546,30 @@ declare class PulseClient {
|
|
|
316
546
|
* Returns skin age, texture, hydration, symmetry, and recommendations.
|
|
317
547
|
*/
|
|
318
548
|
analyzeBeauty(options: BeautyAnalyzeOptions): Promise<BeautyResult>;
|
|
549
|
+
/**
|
|
550
|
+
* Analyze audio for voice health biomarkers
|
|
551
|
+
* Returns stress, fatigue, respiratory rate, cognitive load, and wellness scores.
|
|
552
|
+
*
|
|
553
|
+
* @example
|
|
554
|
+
* ```typescript
|
|
555
|
+
* const voiceResult = await client.analyzeVoice({ audio: audioBlob });
|
|
556
|
+
* console.log(voiceResult.stress_score);
|
|
557
|
+
* console.log(voiceResult.respiratory_rate);
|
|
558
|
+
* ```
|
|
559
|
+
*/
|
|
560
|
+
analyzeVoice(options: VoiceAnalyzeOptions): Promise<VoiceResult>;
|
|
561
|
+
/**
|
|
562
|
+
* Analyze video for eye health screening
|
|
563
|
+
* Returns cataract risk, red eye detection, lens clarity, pupil analysis, and more.
|
|
564
|
+
*
|
|
565
|
+
* @example
|
|
566
|
+
* ```typescript
|
|
567
|
+
* const eyeResult = await client.analyzeEye({ video: videoBlob });
|
|
568
|
+
* console.log(eyeResult.overall_score);
|
|
569
|
+
* console.log(eyeResult.cataract.risk_level);
|
|
570
|
+
* ```
|
|
571
|
+
*/
|
|
572
|
+
analyzeEye(options: EyeAnalyzeOptions): Promise<EyeResult>;
|
|
319
573
|
/**
|
|
320
574
|
* Check API health status
|
|
321
575
|
*/
|
|
@@ -427,6 +681,6 @@ declare function useRecording(stream: MediaStream | null, options?: UseRecording
|
|
|
427
681
|
* @packageDocumentation
|
|
428
682
|
*/
|
|
429
683
|
|
|
430
|
-
declare const VERSION = "1.
|
|
684
|
+
declare const VERSION = "1.2.0";
|
|
431
685
|
|
|
432
|
-
export { type APIError, type APIResponse, type AnalyzeOptions, type ArrhythmiaResult, type BMIEstimate, type BeautyAnalyzeOptions, type BeautyGeometry, type BeautyPhysiology, type BeautyRecommendations, type BeautyResult, type BeautySummary, type BeautySurface, type BloodPressure, type CompositeScores, type FaceDetectionResult, type MentalWellness, PulseClient, type PulseClientConfig, PulseScanner, type PulseScannerProps, type ScannerStatus, type UseCameraOptions, type UseCameraReturn, type UseFaceDetectionOptions, type UseFaceDetectionReturn, type UseRecordingOptions, type UseRecordingReturn, VERSION, type VisualAnalysis, VitalsCard, VitalsCardFromResult, type VitalsCardProps, type VitalsResult, useCamera, useFaceDetection, useRecording };
|
|
686
|
+
export { type APIError, type APIResponse, type AnalyzeOptions, type ArrhythmiaResult, type BMIEstimate, type BeautyAnalyzeOptions, type BeautyGeometry, type BeautyPhysiology, type BeautyRecommendations, type BeautyResult, type BeautySummary, type BeautySurface, type BloodPressure, type CompositeScores, type EyeAnalyzeOptions, type EyeCataract, type EyeLensClarity, type EyePterygium, type EyePupil, type EyeRedEye, type EyeResult, type EyeSclera, type EyeStye, type FaceDetectionResult, type MentalWellness, PulseClient, type PulseClientConfig, PulseScanner, type PulseScannerProps, type ScannerStatus, type UseCameraOptions, type UseCameraReturn, type UseFaceDetectionOptions, type UseFaceDetectionReturn, type UseRecordingOptions, type UseRecordingReturn, VERSION, type VisualAnalysis, VitalsCard, VitalsCardFromResult, type VitalsCardProps, type VitalsResult, type VoiceAnalyzeOptions, type VoiceCompositeScores, type VoiceMoodIndicators, type VoiceResult, useCamera, useFaceDetection, useRecording };
|