Files
typogenie/src/types.ts
TypoGenie b91f565eaa feat: Transform to Tauri desktop app
- Initialize Tauri v2 project with Rust backend
- Restructure project: move source files to src/ directory
- Add Tauri configuration for Windows, macOS, and Linux builds
- Update Vite config for Tauri development workflow
- Add file system and dialog permissions for native features
- Update package.json with desktop build scripts
- Update tsconfig.json paths for new src structure
- Add Tauri and desktop badges to README
- Document desktop build process and architecture
2026-01-29 18:28:35 +02:00

68 lines
1.5 KiB
TypeScript

export type PaperSize = 'A4' | 'Letter';
export type StyleCategory = string;
export interface DocxBorder {
color: string;
space: number;
style: string; // 'single' | 'double' | 'dotted' | 'dashed'
size: number;
}
export interface DocxStyleConfig {
font: string;
size: number; // in pt
color: string;
bold?: boolean;
italic?: boolean;
underline?: boolean;
allCaps?: boolean;
smallCaps?: boolean;
tracking?: number; // Letter spacing
align?: 'left' | 'center' | 'right' | 'both'; // 'both' is justify
spacing?: { before: number; after: number; line: number };
border?: {
top?: DocxBorder;
bottom?: DocxBorder;
left?: DocxBorder;
right?: DocxBorder;
};
shading?: {
fill: string; // Hex color
color: string; // usually 'auto'
style: string; // usually 'clear'
};
}
export interface StyleOption {
id: string;
name: string;
category: StyleCategory;
description: string;
vibe: string;
googleFontsImport: string;
// Word Export Configuration
wordConfig: {
heading1: DocxStyleConfig;
heading2: DocxStyleConfig;
body: DocxStyleConfig;
accentColor: string; // Used for graphical elements
};
// CSS for Web Preview (Must match wordConfig manually for fidelity)
previewCss: string;
}
export interface GenerationConfig {
styleId: string;
paperSize: PaperSize;
content: string;
}
export enum AppState {
UPLOAD = 'UPLOAD',
CONFIG = 'CONFIG',
GENERATING = 'GENERATING',
PREVIEW = 'PREVIEW',
ERROR = 'ERROR'
}