Changeset View
Changeset View
Standalone View
Standalone View
lib/types/media-types.js
Show All 11 Lines | |||||
}>; | }>; | ||||
export const dimensionsValidator: TInterface<Dimensions> = tShape<Dimensions>({ | export const dimensionsValidator: TInterface<Dimensions> = tShape<Dimensions>({ | ||||
height: t.Number, | height: t.Number, | ||||
width: t.Number, | width: t.Number, | ||||
}); | }); | ||||
export type MediaType = 'photo' | 'video'; | export type MediaType = 'photo' | 'video'; | ||||
const mediaTypeValidator = t.enums.of(['photo', 'video']); | |||||
export type EncryptedMediaType = 'encrypted_photo' | 'encrypted_video'; | export type EncryptedMediaType = 'encrypted_photo' | 'encrypted_video'; | ||||
export type AvatarMediaInfo = { | export type AvatarMediaInfo = { | ||||
+type: 'photo', | +type: 'photo', | ||||
+uri: string, | +uri: string, | ||||
}; | }; | ||||
Show All 31 Lines | |||||
export type UploadMultimediaResult = { | export type UploadMultimediaResult = { | ||||
+id: string, | +id: string, | ||||
+uri: string, | +uri: string, | ||||
+dimensions: Dimensions, | +dimensions: Dimensions, | ||||
+mediaType: MediaType, | +mediaType: MediaType, | ||||
+loop: boolean, | +loop: boolean, | ||||
}; | }; | ||||
export const uploadMultimediaResultValidator: TInterface<UploadMultimediaResult> = | |||||
tShape<UploadMultimediaResult>({ | |||||
id: tID, | |||||
uri: t.String, | |||||
dimensions: dimensionsValidator, | |||||
mediaType: mediaTypeValidator, | |||||
loop: t.Boolean, | |||||
}); | |||||
export type UpdateMultimediaMessageMediaPayload = { | export type UpdateMultimediaMessageMediaPayload = { | ||||
+messageID: string, | +messageID: string, | ||||
+currentMediaID: string, | +currentMediaID: string, | ||||
+mediaUpdate: Shape<Media>, | +mediaUpdate: Shape<Media>, | ||||
}; | }; | ||||
export type UploadDeletionRequest = { | export type UploadDeletionRequest = { | ||||
▲ Show 20 Lines • Show All 664 Lines • Show Last 20 Lines |