declare const google: { accounts: { id: { initialize: (config: { client_id: string; callback: (response: any) => void; }) => void; renderButton: ( parent: HTMLElement, options: { theme?: string; size?: string; type?: string; text?: string, width?: string, logo_alignment?: string } ) => void; prompt: (notification?: any) => void; disableAutoSelect: () => void; }; }; }; declare global { interface Window { google: typeof google; } } export enum AppStatus { IDLE = 'IDLE', ANALYZING = 'ANALYZING', SUCCESS = 'SUCCESS', ERROR = 'ERROR', } export type View = 'steward' | 'pests' | 'seasons' | 'tools' | 'garden' | 'healthCheck' | 'designStudio' | 'speciesIdentifier' | 'wiringGuide' | 'soilAnalyzer' | 'nebariDeveloper' | 'potCalculator' | 'sunTracker' | 'fertilizerMixer' | 'soilVolumeCalculator' | 'weatherShield' | 'settings'; export interface UserProfile { id: string; name: string; email: string; picture: string; } export enum LogTag { Pruning = 'Pruning', Watering = 'Watering', Fertilizing = 'Fertilizing', Repotting = 'Repotting', Wiring = 'Wiring', PestControl = 'Pest Control', DiseaseControl = 'Disease Control', Observation = 'Observation', Styling = 'Styling', NewGrowth = 'New Growth', HealthDiagnosis = 'Health Diagnosis', } export interface HealthCheckResult { probableCause: string; confidence: 'High' | 'Medium' | 'Low'; explanation: string; isPest: boolean; isDisease: boolean; treatmentPlan: { step: number; action: string; details: string; }[]; organicAlternatives: string; preventativeMeasures: string; } export interface DiaryAIAnalysis { summary: string; healthChange?: number; // e.g., +5, -2, or 0 suggestions?: string[]; } export interface DiaryLog { id: string; // uuid date: string; // ISO string title: string; notes: string; photos: string[]; // base64 strings without the data URI prefix tags: LogTag[]; aiAnalysis?: DiaryAIAnalysis; healthCheckResult?: HealthCheckResult; } export interface ProtectionProfile { minTempC: number; maxTempC: number; maxWindKph: number; alertsEnabled: boolean; } export interface BonsaiTree { id: string; // uuid name: string; species: string; acquiredDate: string; // ISO string source: string; // e.g., Nursery, Collected, Gift location: string; // e.g., San Francisco, CA initialPhoto: string; // base64 string without the data URI prefix notes?: string; logs: DiaryLog[]; analysisHistory: { date: string; analysis: BonsaiAnalysis }[]; protectionProfile?: ProtectionProfile; } export interface CareTask { week: number; task: string; details: string; toolsNeeded?: string[]; } export interface PestAlert { pestOrDisease: string; symptoms:string; treatment: string; severity: 'Low' | 'Medium' | 'High'; } export interface StylingSuggestion { technique: 'Pruning' | 'Wiring' | 'Shaping'; description: string; area: string; } export interface EnvironmentalFactors { idealLight: string; idealHumidity: string; temperatureRange: string; } export interface WateringAnalysis { frequency: string; method: string; notes: string; } export interface FertilizerRec { phase: 'Spring Growth' | 'Summer Maintenance' | 'Autumn Preparation' | 'Winter Dormancy'; type: string; frequency: string; notes: string; } export interface SoilRecipeComponent { name: 'Akadama' | 'Pumice' | 'Lava Rock' | 'Organic Compost' | 'Kiryu' | 'Other'; percentage: number; notes: string; } export interface SoilRecipe { components: SoilRecipeComponent[]; rationale: string; } export interface PotSuggestion { style: string; size: string; colorPalette: string; rationale:string; } export interface SeasonalTask { task: string; importance: 'High' | 'Medium' | 'Low'; } export interface SeasonalGuide { season: 'Spring' | 'Summer' | 'Autumn' | 'Winter'; summary: string; tasks: SeasonalTask[]; } export interface DiagnosticIssue { issue: string; confidence: 'High' | 'Medium' | 'Low'; symptoms: string; solution: string; } export interface PestLibraryEntry { name: string; type: 'Pest' | 'Disease'; description: string; symptoms: string[]; treatment: { organic: string; chemical: string; }; } export interface ToolRecommendation { name: string; category: 'Cutting' | 'Wiring' | 'Repotting' | 'General Care'; description: string; level: 'Essential' | 'Recommended' | 'Advanced'; } export enum ToolCondition { EXCELLENT = 'Excellent', GOOD = 'Good', NEEDS_SHARPENING = 'Needs Sharpening', NEEDS_OILING = 'Needs Oiling', DAMAGED = 'Damaged' } export interface UserTool extends ToolRecommendation { id: string; // Unique ID for the user's instance of the tool condition: ToolCondition; lastMaintained?: string; // ISO date string notes?: string; } export interface MaintenanceTips { sharpening: string; cleaning: string; storage: string; } export interface BonsaiAnalysis { species: string; healthAssessment: { overallHealth: string; healthScore: number; observations: string[]; foliageHealth: string; trunkAndNebariHealth: string; potAndSoilHealth: string; }; careSchedule: CareTask[]; pestAndDiseaseAlerts: PestAlert[]; stylingSuggestions: StylingSuggestion[]; environmentalFactors: EnvironmentalFactors; wateringAnalysis: WateringAnalysis; knowledgeNuggets: string[]; estimatedAge: string; fertilizerRecommendations: FertilizerRec[]; soilRecipe: SoilRecipe; potSuggestion: PotSuggestion; seasonalGuide: SeasonalGuide[]; diagnostics: DiagnosticIssue[]; pestLibrary: PestLibraryEntry[]; toolRecommendations: ToolRecommendation[]; } export interface SpeciesIdentification { commonName: string; scientificName: string; confidence: string; reasoning: string; generalCareSummary: string; } export interface SpeciesIdentificationResult { identifications: SpeciesIdentification[]; } export interface SoilAnalysisComponent { name: 'Akadama' | 'Pumice' | 'Lava Rock' | 'Organic Compost' | 'Kiryu' | 'Pine Bark' | 'Diatomaceous Earth' | 'Sand' | 'Grit' | 'Other'; percentage: number; } export interface SoilAnalysis { components: SoilAnalysisComponent[]; drainageRating: 'Poor' | 'Average' | 'Good' | 'Excellent'; waterRetention: 'Low' | 'Medium' | 'High'; suitabilityAnalysis: string; improvementSuggestions: string; } // --- AI Design Studio Blueprint Types --- export interface SvgPoint { x: number; y: number; } export enum AnnotationType { PruneLine = 'PRUNE_LINE', WireDirection = 'WIRE_DIRECTION', RemoveBranch = 'REMOVE_BRANCH', FoliageRefinement = 'FOLIAGE_REFINEMENT', JinShari = 'JIN_SHARI', TrunkLine = 'TRUNK_LINE', ExposeRoot = 'EXPOSE_ROOT', } export interface StylingAnnotation { type: AnnotationType; points?: SvgPoint[]; // For lines and polygons path?: string; // For complex curves like wiring direction label: string; } export interface StylingBlueprint { annotations: StylingAnnotation[]; summary: string; // AI provides coordinates based on a 1000x1000 canvas. // The frontend will scale these to the actual image dimensions. canvas: { width: number; height: number; }; }