Changeset View
Changeset View
Standalone View
Standalone View
lib/types/device-types.js
Show All 11 Lines | |||||
export function assertDeviceType(deviceType: ?string): DeviceType { | export function assertDeviceType(deviceType: ?string): DeviceType { | ||||
invariant( | invariant( | ||||
deviceType === 'ios' || deviceType === 'android', | deviceType === 'ios' || deviceType === 'android', | ||||
'string is not DeviceType enum', | 'string is not DeviceType enum', | ||||
); | ); | ||||
return deviceType; | return deviceType; | ||||
} | } | ||||
export function isWebPlatform(platform: ?string): boolean { | |||||
return platform === 'web'; | |||||
} | |||||
export type DeviceTokenUpdateRequest = { | export type DeviceTokenUpdateRequest = { | ||||
+deviceToken: string, | +deviceToken: string, | ||||
+deviceType?: DeviceType, | +deviceType?: DeviceType, | ||||
+platformDetails?: PlatformDetails, | +platformDetails?: PlatformDetails, | ||||
}; | }; | ||||
export type PlatformDetails = { | export type PlatformDetails = { | ||||
+platform: Platform, | +platform: Platform, | ||||
+codeVersion?: number, | +codeVersion?: number, | ||||
+stateVersion?: number, | +stateVersion?: number, | ||||
}; | }; |