web/api: merge picker types

This commit is contained in:
wukko 2024-08-06 21:32:17 +06:00
parent 9ff27391d0
commit 4505d6cfe1
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -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,