- op.rs: 纯函数 apply_op(deck,op) → new_deck,覆盖全部 11 种 Op 类型 - invert_op(deck,op) → 逆 Op,支持完整的 undo 链路 - 所有 reducer 不 mutate 输入,返回新 deck - 8 个单元测试: add_slide/del_slide/set_theme/update_element/del_element/ move_slide/undo_update/undo_add_slide/replace_deck_undo - ElementStyle 加 rename_all=camelCase 匹配 JS 协议 - 32 个测试全部通过(B1:23 + B2:9)
34 lines
2.5 KiB
TypeScript
34 lines
2.5 KiB
TypeScript
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
|
|
export type AiCfg = { preset: string, protocol: string, base: string, key: string, model: string, proxy: string, img_base: string | null, img_key: string | null, img_model: string | null, };
|
|
|
|
export type AnimType = "fade-up" | "fade" | "scale" | "zoom" | "slide-l" | "slide-r" | "pop" | "rotate" | "bounce" | "flip" | "blur";
|
|
|
|
export type ChartItem = { label: string | null, value: number | null, };
|
|
|
|
export type ChartType = "bar" | "line" | "pie" | "area" | "doughnut" | "radar" | "hbar" | "progress";
|
|
|
|
export type ChatMessage = { role: string, content: string, };
|
|
|
|
export type Deck = { v: number, theme: string, slides: Array<Slide>, chat_id: string | null, };
|
|
|
|
export type ElementStyle = { fontSize: number | null, color: string | null, align: string | null, bold: boolean | null, italic: boolean | null, anim: string | null, label: string | null, labelColor: string | null, labelSize: number | null, fit: string | null, shapeType: ShapeType | null, fill: string | null, gradient: boolean | null, opacity: number | null, radius: number | null, max: number | null, chartType: ChartType | null, legend: boolean | null, stack: boolean | null, grid: boolean | null, header: boolean | null, lang: string | null, inline: boolean | null, icon: string | null, accent: string | null, };
|
|
|
|
export type ElementType = "title" | "text" | "list" | "stat" | "quote" | "image" | "shape" | "chart" | "card" | "table" | "code" | "formula";
|
|
|
|
export type LibItem = { id: string, name: string, deck: Deck, created_at: number, updated_at: number, };
|
|
|
|
export type PageTemplate = { id: string, name: string, category: string, background: string, elements: Array<SlideElement>, created_at: number | null, };
|
|
|
|
export type RichLine = { segments: Array<RichSegment>, };
|
|
|
|
export type RichSegment = { text: string, bold: boolean | null, italic: boolean | null, underline: boolean | null, strike: boolean | null, color: string | null, highlight: boolean | null, code: boolean | null, sup: boolean | null, sub: boolean | null, font_size: number | null, link: string | null, };
|
|
|
|
export type ShapeType = "rect" | "circle" | "triangle";
|
|
|
|
export type Slide = { id: string, background: string, elements: Array<SlideElement>, };
|
|
|
|
export type SlideElement = { id: string, type: string, x: number, y: number, w: number, h: number, content: string, style: ElementStyle, segments: Array<RichLine> | null, };
|
|
|
|
export type Theme = { name: string, primary: string, accent: string, bg: string, panel: string, text: string, muted: string, };
|