File size: 7,581 Bytes
be02369 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
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;
};
} |