@modelhealth/modelhealth 0.1.24 → 0.1.26
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 +14 -31
- package/package.json +1 -1
- package/wasm/model_health_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -62,33 +62,25 @@ const newSession = await client.createSession();
|
|
|
62
62
|
const subjects = await client.subjectList();
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
###
|
|
65
|
+
### Activities
|
|
66
66
|
|
|
67
67
|
```typescript
|
|
68
|
-
// Get
|
|
69
|
-
const
|
|
68
|
+
// Get activities for a session
|
|
69
|
+
const activities = await client.activityList('session-id');
|
|
70
70
|
|
|
71
|
-
// Download
|
|
72
|
-
const videos = await client.
|
|
73
|
-
|
|
71
|
+
// Download activity videos
|
|
72
|
+
const videos = await client.downloadActivityVideos(
|
|
73
|
+
activity,
|
|
74
74
|
'raw' // or 'synced'
|
|
75
75
|
);
|
|
76
76
|
|
|
77
77
|
// Download result data
|
|
78
|
-
const results = await client.
|
|
79
|
-
|
|
80
|
-
['
|
|
78
|
+
const results = await client.downloadActivityResultData(
|
|
79
|
+
activity,
|
|
80
|
+
['kinematics_mot', 'kinematics_csv']
|
|
81
81
|
);
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
### Utilities
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
// Convert MOT to CSV
|
|
88
|
-
const motData = new Uint8Array([...]); // MOT file data
|
|
89
|
-
const csv = ModelHealthService.motToCsv(motData);
|
|
90
|
-
```
|
|
91
|
-
|
|
92
84
|
## React Example
|
|
93
85
|
|
|
94
86
|
```tsx
|
|
@@ -129,27 +121,19 @@ function App() {
|
|
|
129
121
|
|
|
130
122
|
## Vite Configuration
|
|
131
123
|
|
|
132
|
-
If using Vite,
|
|
124
|
+
If using Vite, exclude the SDK from dependency pre-bundling:
|
|
133
125
|
|
|
134
126
|
```typescript
|
|
135
127
|
// vite.config.ts
|
|
136
128
|
import { defineConfig } from 'vite';
|
|
137
|
-
import wasm from 'vite-plugin-wasm';
|
|
138
|
-
import topLevelAwait from 'vite-plugin-top-level-await';
|
|
139
129
|
|
|
140
130
|
export default defineConfig({
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
],
|
|
131
|
+
optimizeDeps: {
|
|
132
|
+
exclude: ['@modelhealth/modelhealth'],
|
|
133
|
+
},
|
|
145
134
|
});
|
|
146
135
|
```
|
|
147
136
|
|
|
148
|
-
Install plugins:
|
|
149
|
-
```bash
|
|
150
|
-
npm install -D vite-plugin-wasm vite-plugin-top-level-await
|
|
151
|
-
```
|
|
152
|
-
|
|
153
137
|
## TypeScript Types
|
|
154
138
|
|
|
155
139
|
All types are fully documented with JSDoc comments. Import types as needed:
|
|
@@ -158,7 +142,7 @@ All types are fully documented with JSDoc comments. Import types as needed:
|
|
|
158
142
|
import type {
|
|
159
143
|
Session,
|
|
160
144
|
Subject,
|
|
161
|
-
|
|
145
|
+
Activity,
|
|
162
146
|
CheckerboardDetails,
|
|
163
147
|
// ... etc
|
|
164
148
|
} from '@modelhealth/modelhealth';
|
|
@@ -188,7 +172,6 @@ npm run dev
|
|
|
188
172
|
- ✅ Modern browsers (Chrome, Firefox, Safari, Edge)
|
|
189
173
|
- ✅ Node.js 18+ (with WASM support)
|
|
190
174
|
- ✅ React, Vue, Svelte, Angular
|
|
191
|
-
- ✅ React Native (with WASM bridge)
|
|
192
175
|
- ✅ Electron
|
|
193
176
|
|
|
194
177
|
## Error Handling
|
package/package.json
CHANGED
|
Binary file
|