ueberpruefen

This commit is contained in:
2025-10-28 23:38:37 +01:00
parent c2c5dd1041
commit 8dab9bfd25
56 changed files with 13640 additions and 2002 deletions

104
src/types/index.ts Normal file
View File

@@ -0,0 +1,104 @@
export type UUID = string;
export type ProjectStatus = 'in_progress' | 'done' | 'archived';
export interface Project {
id: UUID;
title: string;
status: ProjectStatus;
tags: string[];
coverImageUri?: string;
createdAt: string;
updatedAt: string;
}
export type StepType = 'forming' | 'trimming' | 'drying' | 'bisque_firing' | 'glazing' | 'glaze_firing' | 'misc';
export type TemperatureUnit = 'F' | 'C';
export interface Temperature {
value: number;
unit: TemperatureUnit;
}
export interface FiringFields {
cone?: string; // e.g., '04', '6', '10', supports '06'
temperature?: Temperature;
durationMinutes?: number;
kilnNotes?: string;
}
export type ApplicationMethod = 'brush' | 'dip' | 'spray' | 'pour' | 'other';
export interface GlazingFields {
glazeIds: UUID[]; // references to Glaze (or custom)
coats?: number; // layers
application?: ApplicationMethod;
mixNotes?: string; // notes about glaze mixing ratios (e.g., "50/50", "3:1")
}
export interface StepBase {
id: UUID;
projectId: UUID;
type: StepType;
notesMarkdown?: string;
photoUris: string[]; // local URIs
createdAt: string;
updatedAt: string;
}
export type Step =
| (StepBase & { type: 'bisque_firing'; firing: FiringFields })
| (StepBase & { type: 'glaze_firing'; firing: FiringFields })
| (StepBase & { type: 'glazing'; glazing: GlazingFields })
| (StepBase & { type: 'forming' | 'trimming' | 'drying' | 'misc' });
export type GlazeFinish = 'glossy' | 'satin' | 'matte' | 'special' | 'unknown';
export interface Glaze {
id: UUID;
brand: string; // free text; seed list available
name: string;
code?: string; // brand code
color?: string; // hex color code for preview
finish?: GlazeFinish;
notes?: string;
isCustom: boolean; // true if user-entered
isMix?: boolean; // true if this is a mixed glaze
mixedGlazeIds?: UUID[]; // IDs of glazes that were mixed
mixRatio?: string; // e.g. "50/50", "3:1", "Equal parts"
}
export interface NewsItem {
id: UUID;
title: string;
excerpt?: string;
url?: string;
contentHtml?: string;
publishedAt: string;
}
export type UnitSystem = 'imperial' | 'metric';
export interface Settings {
unitSystem: UnitSystem;
tempUnit: TemperatureUnit;
analyticsOptIn: boolean;
}
// Helper type guards
export function isBisqueFiring(step: Step): step is StepBase & { type: 'bisque_firing'; firing: FiringFields } {
return step.type === 'bisque_firing';
}
export function isGlazeFiring(step: Step): step is StepBase & { type: 'glaze_firing'; firing: FiringFields } {
return step.type === 'glaze_firing';
}
export function isGlazing(step: Step): step is StepBase & { type: 'glazing'; glazing: GlazingFields } {
return step.type === 'glazing';
}
export function isFiringStep(step: Step): step is StepBase & { type: 'bisque_firing' | 'glaze_firing'; firing: FiringFields } {
return step.type === 'bisque_firing' || step.type === 'glaze_firing';
}