chore: scaffold Expo project with types and utils

This commit is contained in:
Eddy de Vink 2026-06-27 22:39:55 +02:00
commit 6c0b33f86a
2 changed files with 6474 additions and 1462 deletions

23
src/types.ts Normal file
View file

@ -0,0 +1,23 @@
export type SyncStatus = 'local' | 'synced'
export type Measurement = {
id: string
weight: number
bmi: number
bodyFatPercentage: number
fatMass: number
musclePercentage: number
muscleMass: number
visceralFat: number
bmr: number
measuredAt: string
createdAt: string
updatedAt: string
syncStatus: SyncStatus
}
export type WebDAVConfig = {
url: string
username: string
password: string
}

13
src/utils/uuid.ts Normal file
View file

@ -0,0 +1,13 @@
export function generateId(): string {
const chars = '0123456789abcdef'
const segments = [8, 4, 4, 4, 12]
return segments
.map(len => {
let s = ''
for (let i = 0; i < len; i++) {
s += chars[Math.floor(Math.random() * 16)]
}
return s
})
.join('-')
}