chore: scaffold Expo project with types and utils
This commit is contained in:
parent
f66034136d
commit
6c0b33f86a
2 changed files with 6474 additions and 1462 deletions
23
src/types.ts
Normal file
23
src/types.ts
Normal 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
13
src/utils/uuid.ts
Normal 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('-')
|
||||
}
|
||||
Loading…
Reference in a new issue