import { FileUpload } from '..'; import { FileUploadRequest, FileUploadResponse, NewFileUploadsResponse, } from './FileUpload'; import * as R from './Resource'; import * as F from './Font'; export type ThemeResponse = { id: string; presentation_id: string | null; name: string; background_color: string; background_image: string; background_image_portrait: string; heading_text_color: string; heading_font: string; heading_2_text_color: string; heading_2_font: string; body_text_color: string; body_font: string; border_color: string; background_image_file_upload: FileUploadResponse | null; background_scale: 'fill' | 'fit'; resource: R.ResourceResponse; heading_font_new: F.FontResponse | null; heading_2_font_new: F.FontResponse | null; body_font_new: F.FontResponse | null; }; export interface NewThemeRequest extends ThemeResponse { heading_font_new_id: string | null; heading_2_font_new_id: string | null; body_font_new_id: string | null; } export type GetThemesRequest = undefined; export type GetThemesResponse = ThemeResponse[]; export type UpdateThemeRequest = Partial< Omit > & { background_image_file_upload: FileUploadRequest | null; }; export type UpdateThemeResponse = { background_image_file_uploads: NewFileUploadsResponse; theme: ThemeResponse; }; export type CreateThemeRequest = Pick< NewThemeRequest, | 'background_color' | 'background_image' | 'background_image_portrait' | 'background_scale' | 'body_font' | 'body_text_color' | 'heading_font' | 'heading_text_color' | 'name' | 'heading_font_new_id' | 'heading_2_font_new_id' | 'body_font_new_id' | 'background_image_file_upload' >; export type CreateThemeResponse = { background_image_file_uploads: NewFileUploadsResponse; theme: ThemeResponse; }; export type Theme = { id: string; presentationId: string | null; name: string; backgroundColor: string; backgroundImage: string; backgroundImagePortrait: string; headingTextColor: string; headingFont: string; heading2TextColor: string; heading2Font: string; bodyTextColor: string; bodyFont: string; borderColor: string; backgroundImageFileUpload: FileUpload | null; backgroundScale: 'fill' | 'fit'; resource: R.Resource; headingFontNew: F.Font | null; heading2FontNew: F.Font | null; bodyFontNew: F.Font | null; }; // v2 types export interface ThemeV2Response { id: string; presentation_id: string | null; name: string; background_color: string; background_image: string; background_image_portrait: string; heading_text_color: string; heading_font: string; heading_2_text_color: string; heading_2_font: string; body_text_color: string; body_font: string; border_color: string; heading_font_new: F.FontResponse | null; heading_2_font_new: F.FontResponse | null; body_font_new: F.FontResponse | null; background_image_file_upload: FileUploadResponse | null; background_scale: 'fill' | 'fit'; } export interface ThemeV2 { id: string; presentationId: string | null; name: string; backgroundColor: string; backgroundImage: string; backgroundImagePortrait: string; headingTextColor: string; headingFont: string; heading2TextColor: string; heading2Font: string; bodyTextColor: string; bodyFont: string; borderColor: string; headingFontNew: F.Font | null; heading2FontNew: F.Font | null; bodyFontNew: F.Font | null; backgroundImageFileUpload: FileUpload | null; backgroundScale: 'fill' | 'fit'; // TODO: device_published_content and playlist_playback_content don't // currently return the resource object for a theme. // resource: R.ResourceV2; } export type DeleteThemeRequest = void; export type DeleteThemeResponse = void;