api Page update

This commit is contained in:
tmshv committed 2020-03-02 00:36:22 +03:00
1 parent af7f32b1c0
commit 68b7f4225d
3 files changed
+56 -21

No files matched your search

+26 -3
View File
@@ -1,6 +1,29 @@
import ImageArtifactType from '../core/ImageArtifactType'
export function encodeImage(image) {
export type ImageArtifactDto = {
height: number
width: number
src: string
set: Array<{
density: number
url: string
}>
}
export type ImageDto = {
artifacts: {
original: ImageArtifactDto,
large: ImageArtifactDto,
big: ImageArtifactDto,
medium: ImageArtifactDto,
small: ImageArtifactDto,
fb: ImageArtifactDto,
},
hash: string
file: string
}
export function encodeImage(image): ImageDto {
const artifacts = [
ImageArtifactType.SMALL,
ImageArtifactType.MEDIUM,
@@ -17,8 +40,8 @@ export function encodeImage(image) {
}, {})
return {
artifacts,
artifacts: artifacts as any,
hash: image.hash,
file: image.file,
file: image.file,
}
}