From 4505d6cfe13da3e2825078cebfd59c3438a14e11 Mon Sep 17 00:00:00 2001 From: wukko Date: Tue, 6 Aug 2024 21:32:17 +0600 Subject: [PATCH] web/api: merge picker types --- web/src/lib/types/api.ts | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/web/src/lib/types/api.ts b/web/src/lib/types/api.ts index 8df6d570..a40b6d3c 100644 --- a/web/src/lib/types/api.ts +++ b/web/src/lib/types/api.ts @@ -20,24 +20,15 @@ type CobaltPartialURLResponse = { url: string, } -type CobaltPartialImagesPickerResponse = { - pickerType: 'images', - picker: CobaltPartialURLResponse[], -} - -type CobaltPartialVariousPickerResponse = { - pickerType: 'various', - picker: { - type: 'photo' | 'video', - url: string, - thumb: string, - }[]; -} - type CobaltPickerResponse = { status: CobaltResponseType.Picker - audio: string | false, -} & (CobaltPartialImagesPickerResponse | CobaltPartialVariousPickerResponse); + picker: { + type: 'photo' | 'video' | 'gif', + url: string, + thumb?: string, + }[]; + audio?: string, +}; type CobaltRedirectResponse = { status: CobaltResponseType.Redirect,