Initial QOffice implementation
This commit is contained in:
+111
@@ -0,0 +1,111 @@
|
||||
export type AppId = "word" | "sheets" | "slides" | "mail";
|
||||
|
||||
export interface WordDocument {
|
||||
id: string;
|
||||
title: string;
|
||||
updatedAt: string;
|
||||
html: string;
|
||||
}
|
||||
|
||||
export interface Workbook {
|
||||
id: string;
|
||||
title: string;
|
||||
updatedAt: string;
|
||||
activeSheet: string;
|
||||
sheets: Sheet[];
|
||||
}
|
||||
|
||||
export interface Sheet {
|
||||
id: string;
|
||||
name: string;
|
||||
cells: Record<string, string>;
|
||||
mergedCells?: MergedCellRange[];
|
||||
hyperlinks?: Record<string, string>;
|
||||
cellFormats?: Record<string, CellFormat>;
|
||||
charts?: SheetChart[];
|
||||
}
|
||||
|
||||
export interface CellFormat {
|
||||
bold?: boolean;
|
||||
italics?: boolean;
|
||||
underline?: boolean;
|
||||
fillColor?: string;
|
||||
numberFormat?: string;
|
||||
}
|
||||
|
||||
export interface MergedCellRange {
|
||||
start: string;
|
||||
end: string;
|
||||
}
|
||||
|
||||
export type SheetChartType = "bar" | "line" | "pie";
|
||||
|
||||
export interface SheetChart {
|
||||
id: string;
|
||||
type: SheetChartType;
|
||||
title: string;
|
||||
labelRange: string;
|
||||
valueRange: string;
|
||||
}
|
||||
|
||||
export interface SlideDeck {
|
||||
id: string;
|
||||
title: string;
|
||||
updatedAt: string;
|
||||
activeSlideId: string;
|
||||
slides: Slide[];
|
||||
}
|
||||
|
||||
export interface Slide {
|
||||
id: string;
|
||||
title: string;
|
||||
subtitle: string;
|
||||
notes: string;
|
||||
theme: "classic" | "ocean" | "graphite";
|
||||
images?: SlideImage[];
|
||||
}
|
||||
|
||||
export interface SlideImage {
|
||||
id: string;
|
||||
src: string;
|
||||
alt?: string;
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
export interface MailAttachment {
|
||||
id: string;
|
||||
fileName: string;
|
||||
contentType: string;
|
||||
size: number;
|
||||
contentBase64: string;
|
||||
disposition: "attachment" | "inline";
|
||||
contentId?: string;
|
||||
}
|
||||
|
||||
export interface MailMessage {
|
||||
id: string;
|
||||
folder: "inbox" | "sent" | "drafts" | "archive";
|
||||
from: string;
|
||||
to: string;
|
||||
subject: string;
|
||||
body: string;
|
||||
time: string;
|
||||
read: boolean;
|
||||
flagged: boolean;
|
||||
attachments?: MailAttachment[];
|
||||
}
|
||||
|
||||
export interface QOfficeState {
|
||||
activeApp: AppId;
|
||||
word: WordDocument;
|
||||
workbook: Workbook;
|
||||
deck: SlideDeck;
|
||||
mail: {
|
||||
activeFolder: MailMessage["folder"];
|
||||
activeMessageId: string;
|
||||
messages: MailMessage[];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user