import { Polygon } from 'geojson'; import { MouseEvent } from 'react'; export type Theme = 'glow' | 'original'; export type Gradient = 'yellow-orange-black' | 'yellow-red-purple' | 'yellow-brown'; export interface PVSystemRequestParams { setback_distance?: number; panel_width?: number; panel_length?: number; min_solar_access_index?: number; target_num_panels?: number; target_system_size?: number; target_electricity_output?: number; default_preferred_orientation?: Orientation; face_layout_options?: FaceLayoutOptions; instant_design_components_version?: string; zoom_to_faces?: boolean; } export interface RooftopGeometryResponse { id: number; faces: Face[]; svg: string; image: { url: string; attribution: RooftopGeometryResponseImageAttribution; width: number; height: number; min_aspect_ratio: number; max_aspect_ratio: number; attribution_year?: RooftopGeometryResponseImageAttributionYear; }; poly_align_offset?: { x_offset: number; y_offset: number; }; metadata: { latitude: number; longitude: number; runtimes: { mesh?: string; total?: string; point_cloud?: string; classification?: string; reconstruction?: string; }; area?: number; n_faces?: number; ave_tilt?: number; n_points?: number; qa_score?: number; form_factor?: number; qa_score_avg?: number; qa_score_max?: number; surface_area?: number; ground_height: number; resolution_xy?: number; returned_mesh?: boolean; elevation_data_meta?: { survey_type: string; capture_date?: string; source_url?: string; geotiff_urls?: { dsmUrl: string; maskUrl: string; rgbUrl?: string; annualFluxUrl?: string; monthlyFluxUrl?: string; hourlyShadeUrls?: string[]; }; [other: string]: unknown; }; returned_obstructions?: boolean; intersection_over_union?: number; }; zoom_to_faces?: boolean; } export interface PVSystemResponse { system_metrics: { used_area: number; system_size: number; num_panels: number; max_number_of_panels: number; average_sai: number; electricity_output: number; output_per_month: number[]; output_per_hour?: number[]; }; svg: string; face_layouts: FaceLayout[]; parameters: PVSystemResponseParams; zoom_to_faces?: boolean; } export interface PVSystemResponseParams extends PVSystemRequestParams { building_id?: string; rooftop_geometry_id: string; } export interface Options { alignmentOffset?: AlignmentOffset; alignmentMode?: AlignmentMode; interactionMode?: InteractionMode; initialTargetNumPanels?: number; initialTargetSystemSize?: number; setbackEditable?: boolean; suppressLoadingSpinner?: boolean; } export interface FaceLayout { available_orientations: Orientation[]; face_id: FaceID; panels: Panel[]; disabled: boolean; orientation: Orientation | null; } export interface FaceLayoutOptions { [face_id: FaceID]: FaceLayoutOptionsForFace; } export interface FaceLayoutOptionsForFace { disabled?: boolean; preferred_orientation?: Orientation; disabled_panel_ids?: PanelID[] | ['*']; } export type FaceLayoutOptionsEntry = [FaceID, FaceLayoutOptionsForFace]; export type FaceID = string; export type PanelID = string; export type Orientation = 'landscape_with_orphans' | 'landscape' | 'portrait' | 'portrait_with_orphans'; export type BuildingSVGGroupClickHandler = (event: MouseEvent) => void; export type ButtonClickHandler = (event: MouseEvent) => void; export type InteractionMode = 'default' | 'roof_faces' | 'panel_orientation' | 'toggle_panels'; export type AlignmentMode = 'intro' | 'lightweight'; export type RooftopGeometryResponseImageAttribution = 'Google' | 'Mapbox, Maxar'; export type RooftopGeometryResponseImageAttributionYear = string | null; export interface BasicMapboxFeature { text: string; place_name: string; center: [number, number]; } export interface AlignmentOffset { xOffset: number; yOffset: number; } interface Face { id: FaceID; polygon: Polygon; sai_gradient: string; } interface Panel { id: PanelID; polygon: Polygon; sai: number; disabled: boolean; } export {};