Skip to content

Commit 82cff0d

Browse files
authored
Fix DeviceProfile.signals type to reflect stored shape (#23)
Middleware endpoints strip userAgent and viewport before storing, but DeviceProfile.signals was typed as RawSignals — making TypeScript claim those fields might exist when they never will. Add StoredSignals type alias (Omit<RawSignals, 'userAgent' | 'viewport'>) and use it instead.
1 parent 28cc6e6 commit 82cff0d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

packages/types/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export type {
22
ConnectionInfo,
33
Viewport,
44
RawSignals,
5+
StoredSignals,
56
DeviceProfile,
67
CpuTier,
78
MemoryTier,

packages/types/src/profile.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ export interface RawSignals {
2323
battery?: { level: number; charging: boolean };
2424
}
2525

26+
export type StoredSignals = Omit<RawSignals, 'userAgent' | 'viewport'>;
27+
2628
export interface DeviceProfile {
2729
schemaVersion: 1;
2830
sessionToken: string;
2931
createdAt: string;
3032
expiresAt: string;
31-
signals: RawSignals;
33+
signals: StoredSignals;
3234
}
3335

3436
export type CpuTier = 'low' | 'mid' | 'high';

0 commit comments

Comments
 (0)