import { Anchor, AxisType, DecorationType, DoorType, MarkerTextDisplayMode, MeasurementMode, ParkingMethod, Strategy, TransformGizmoMode, UEWidget, VideoStrategy, ViewType, vec2, vec3, ZoomStrategy } from "./Constants"; import { box } from "../utils/MathUtils"; import { MESSAGE_BODY, MESSAGE_ID, MESSAGE_TOKEN, MessageId } from "./MessageEnum"; import { UEEvent } from "./UEEventEnum"; export interface UELog { Content: string; LogVerbosity: "Info" | "Warning" | "Error"; Timestamp: string; } export interface Location { x: number; y: number; z: number; } export interface Rotation { pitch: number; yaw: number; roll: number; } export interface Scale { x: number; y: number; z: number; } export interface Position { location: vec3; forwardDirection: vec3; } export interface ActiveSectionParam { active: boolean; } export interface FamilyInstance { modelId: string; familyInstanceId: string; materialId?: string; } export interface MeshInstance { modelId?: string; familyInstanceId?: string; uniqueId?: string; elementIndex?: number; materialInstanceId?: string; materialLibraryRootPath?: string; materialId?: string; userData?: string; } export interface SetFamilyInstanceVisibilityParam { familyInstances: FamilyInstance[]; visible: boolean; unselectHiddenFamilyInstances?: boolean; } export interface HideFamilyInstancesByHeightParam { minHeight?: number; maxHeight?: number; } export interface OutputPanoramaParam { width: number; height?: number; format?: "jpg"; cameraLocation?: vec3; successCallback: RequestConfig; } export interface OutputRefinedPanoramaParam { resolution: "1k" | "2k" | "4k" | "8k" | "16k"; format?: "jpg"; cameraLocation?: vec3; sampleLevel?: number; thumbnailSize?: vec2; useFastVersion: boolean; successCallback: RequestConfig; } export interface SelectBackgroundParam { index: number; } export interface SetMaxFpsParam { maxFps: number; } export interface RequestConfig { url: string; method: "get" | "post"; params: { taskId?: string; modelId?: string; timeStamp?: number; }; } export interface SectionBox { sectionBox: box; activeAxis?: "NX" | "NY" | "NZ" | "PX" | "PY" | "PZ"; } export interface SectionPlane { location: vec3; normal: vec3; angle?: number; size?: vec2; } export interface Screenshot { width?: number; height?: number; options?: ScreenshotOptions; } export interface ScreenshotOptions { hideMarkers?: boolean; hideNavCube?: boolean; hideDebugInfo?: boolean; hideGroundGrid?: boolean; hideOutline?: boolean; hideSection?: boolean; } export interface NavCubeParam { anchorType: Omit; anchorOffset: Coordinates2D; size: Coordinates2D; } export interface ModelsParam { modelIds: string[]; visible: boolean; unselectHiddenFamilyInstances?: boolean; } export interface Listener { eventType: UEEvent; } export interface ReplaceMaterialsParam { materialId: string; modelId: string; familyInstanceIds: string[]; materialRootPath: string; successCallback?: RequestConfig; } export interface FamilyInstancesCollisionParam { modelId: string; familyInstanceIds: string[]; } export interface FlyToOptions { sectionBox: box; } export interface SaveModificationsParam { successCallback: RequestConfig; } export interface LoadModificationsParam { url: string; materialRootPath: string; } export interface LoadModelsParam { src: string; name?: string; type?: string; modelId?: string; matrix?: number[]; position?: vec3; scale?: vec3; rotation?: vec3; units?: "meter" | "decimeter" | "centimeter" | "millimeter"; uuid: string; fixFamilyInstancePosition?: boolean; viewDistanceScale?: number; } export interface UpdateModelParam { src: string; type?: string; uuid: string; modelId: string; matrix?: number[]; modifications: { add?: string[]; remove?: string[]; replace?: string[]; }; } export interface UnloadModelsParam { modelIds: string[]; } export interface SectionAxisParam { axis: AxisType; } export interface Marker { markerId: string; position: vec3; color?: vec3; size?: [number, number]; pivot?: [number, number]; icon?: string; occludable?: boolean; } export interface MarkerEx { markerId: string; position: vec3; viewDistance: number; displayText: string; scale: number; buildInStyleIndex?: number; } export interface AddMarkersParam { markers: Marker[]; } export interface RemoveMarkersParam { markerIds: string[]; } export interface SetMarkerTextParam { markerId: string; text: string; scale?: number; textColor?: RgbaColor; enableShadow?: boolean; shadowColor?: RgbaColor; enableOutline?: boolean; outlineColor?: RgbaColor; maxWidth?: number; maxHeight?: number; positionOffset?: Coordinates2D; backgroundColor?: RgbaColor; borderColor?: RgbaColor; } export interface ScreenPosition { x: number; y: number; } export interface BackgroundEnvSetting { index: number; brightness: number; horizontalRotation: number; } export interface SunEnvSettings { enabled: boolean; sourceAngle: number; intensity: number; raytraceDistance: number; azimuth: number; pitch: number; } export interface ColorCorrectionEnvSetting { colorTemperature: number; colorSaturation: number; colorContrast: number; colorGain: number; tonemapperSharpen: number; } export interface ImageDescription { width: number; height: number; startRegion?: { x: number; y: number; }; endRegion?: { x: number; y: number; }; location: Location; direction: Coordinates3D; url: string; envSetting?: { background?: BackgroundEnvSetting; sun?: SunEnvSettings; colorCorrection?: ColorCorrectionEnvSetting; }; } export declare type Units = "millimeter" | "centimeter" | "decimeter" | "meter" | "kilometer"; export interface SetCharacterLocationAndRotationParam { location: Location; rotation: Rotation; disableGravityUntilCharacterMove: boolean; } export interface SetSunAzimuthParam { latitude: number; longitude: number; year: number; month: number; day: number; } export interface RgbaColor { r: number; g: number; b: number; a?: number; } export interface AddSpaceParam { points: Location[]; height: number; color?: RgbaColor; } export interface Color { r: number; g: number; b: number; } export interface Coordinates2D { x: number; y: number; } export interface Coordinates3D { x: number; y: number; z: number; } export interface Viewport { viewportId: string; name: string; viewCenter: Coordinates3D; viewDir: Coordinates3D; viewUp: Coordinates3D; viewType: string; viewScale: number; viewportMin: Coordinates2D; viewportMax: Coordinates2D; } export interface ViewSheetParam { imageUrl: string; viewSheetId: string; name: string; viewSheetMin: Coordinates2D; viewSheetMax: Coordinates2D; viewports: Viewport[]; } export interface OutLineSettings { enabled: boolean; width: number; opacity: number; } export interface Texture { url: string; brightness: number; horizontalRotation: number; } export interface TextureTemplate { index: number; brightness: number; horizontalRotation: number; } export interface BackgroundSettings { mode: "color" | "texture" | "textureTemplate"; color?: Color; texture?: Texture; textureTemplate?: TextureTemplate; } export declare type DisplayMode = "PureColor" | "BlackAndWhite" | "Normal"; export interface DisplayModeSettings { mode: DisplayMode; } export interface GroundGridSettings { enabled: boolean; visible?: boolean; collisionEnabled?: boolean; } export interface SunSettings { enabled: boolean; intensity: number; shadow: ShadowSettings; azimuth: number; pitch: number; } export interface ShadowSettings { enabled: boolean; level: number; } export interface SectionFillParam { strategy: Strategy; componentThreshold?: number; } export interface SectionFillSettings { strategyBody: SectionFillParam; color: Color; } export interface Settings { outline?: OutLineSettings; background?: BackgroundSettings; displayMode?: DisplayModeSettings; groundGrid?: GroundGridSettings; sun?: SunSettings; shadow?: ShadowSettings; sectionFill?: SectionFillSettings; } export declare type LightType = "PointLight" | "SpotLight" | "RectLight" | "LightStrip"; export interface AddLightParam { id: string; type: LightType; name: string; location: Location; direction: Coordinates3D; } export interface Light { id: string; type: LightType; name?: string; isImported: boolean; designOptionId?: string; location?: Location; enabled?: boolean; intensity?: number; color?: Color; sourceRadius?: number; sourceLength?: number; radius?: number; castShadows?: boolean; temperature?: number; specularScale?: number; innerConeAngle?: number; outerConeAngle?: number; lightStripLength?: number; lightStripWidth?: number; lightStripHeight?: number; rectWidth?: number; rectHeight?: number; barnDoorAngle?: number; barnDoorLength?: number; twoSideEnabled?: boolean; associatedFamilyInstances?: string[]; } export interface ImportLightsParam { json: any[]; types: "spot" | "rect" | "point"[]; defaultTemperature: number; defaultIntensity: number; } export interface ImportLightsResultParam { result: { spot?: number; point?: number; rect?: number; }; success: boolean; } export declare type ModifyLightParam = Omit; export interface ActiveFirstPersonModeParam { resetCamera: boolean; } export interface FamilyInstanceParam { src: string; uuid: string; modelId?: string; familyInstanceId?: string; designOptionId?: string; visible?: boolean; name?: string; type?: string; matrix?: number[]; boundingBox?: box; userData?: string; resetOrigin?: boolean; } export interface FamilyInstanceInfoParam { modelId: string; familyInstanceId: string; associatedFamilyInstances: FamilyInstance[]; } export declare type ViewMode = "top" | "bottom" | "left" | "right" | "front" | "back" | "free"; export interface CaptureOverviewMapParam { imageHeight: number; imageWidth: number; min: Coordinates2D; max: Coordinates2D; imageBase64: string; } export interface SceneStatistics { componentNumber: number; firstPersonHeight: number; firstPersonMoveSpeed: number; materialNumber: number; triangleNumber: number; vertexNumber: number; } export interface RenderStatistics { fps: number; freezeStatus: boolean; componentNumber: number; triangleNumber: number; vertexNumber: number; materialNumber: number; meshLineNumber: number; } export interface ParkingSpace { familyInstanceId: string; position: Coordinates3D[]; direction: Coordinates3D; } export interface RegionParam { boundaries: Coordinates3D[]; id: string; lineWidth?: number; fillColor?: RgbaColor; lineColor?: RgbaColor; visible?: boolean; } export interface PawnInstance { id: string; name: string; location: Location; rotation?: Rotation; } export interface ActiveThirdPersonTopViewModeParam { distance: number; pitch: number; minDistance: number; maxDistance: number; } export interface Decoration { modelId: string; familyInstanceId: string; type: DecorationType; color: RgbaColor; } export interface Decorations { familyInstances: FamilyInstance[]; type: DecorationType; color: RgbaColor; } export interface MaterialOverrideRecord { overridedMaterialId: string; originalMaterialName: string; materialLibraryRootPath: string; userData: string; } export interface LightPreCreateState { lightType: Omit; location: Coordinates3D; direction: Coordinates3D; } export interface Path { start: Coordinates3D; end: Coordinates3D; } export interface OpenVehicleDoorsParam { pawnInstanceId: "string"; doorType: DoorType; angle: number; } export interface ParkingPathParam { modelId: string; familyInstanceId: string; parkingMethod: ParkingMethod; location?: Location; } export interface FiltersParam { modelIds?: string[]; levels?: string[]; categories?: string[]; properties?: { key: string; values: string[]; }[]; } export interface Dimension { id: string; points: Coordinates3D[]; normals: Coordinates3D[]; length: number; visible: boolean; } export interface MaterialEditSelectModeParam { assignMethod: "SingleAssign" | "BatchAssign"; assignRange: "Scene" | "Model"; } export declare type ColorKey = "R" | "G" | "B" | "A"; export interface SelectedMaterialParameters { parameterNames: string[]; channels: ColorKey[]; values?: number[]; } export interface SelectedMaterialParam extends Partial { materialId: string; basePath: string; name?: string; userData?: string; } export interface Measurement { type: string; id: string; points: Coordinates3D[]; visible: boolean; style: number; } export interface Room { name: string; boundary: Coordinates2D[]; minHeight?: number; maxHeight?: number; } export interface HiddenWorkParam { rooms: Room[]; modelIds: string[]; opacity?: number; } export interface PossessPawnParam { id: string; activeCamera?: "front" | "back"; perspectiveType?: "Normal" | "TopDown"; backCameraDistance?: number; backCameraPitch?: number; noAnimation?: boolean; } export interface NavigationPathParam { id: string; points: Coordinates3D[]; type?: "default" | "sketch"; lineColor?: RgbaColor; } export interface Message { [MESSAGE_ID]: MessageId | UEEvent; [MESSAGE_BODY]?: T; [MESSAGE_TOKEN]?: string; } export declare type UEMessageType = UELog | Position | { location: vec3; forwardDirection: vec3; noAnimation: boolean; } | ActiveSectionParam | SetFamilyInstanceVisibilityParam | HideFamilyInstancesByHeightParam | OutputPanoramaParam | OutputRefinedPanoramaParam | SelectBackgroundParam | SetMaxFpsParam | SectionBox | SectionPlane | Screenshot | Listener | ReplaceMaterialsParam | ModelsParam | SaveModificationsParam | LoadModificationsParam | LoadModelsParam[] | NavCubeParam | UnloadModelsParam | SectionAxisParam | AddMarkersParam | RemoveMarkersParam | SetMarkerTextParam | SetCharacterLocationAndRotationParam | { materialLibraryRootPath: string; } | { markerId: string; } | { screenPosition: ScreenPosition; tags?: string[]; } | { familyInstances: FamilyInstance[]; cameraDirection?: Coordinates3D; } | { familyInstances: FamilyInstancesCollisionParam[]; visible?: boolean; } | { familyInstances: FamilyInstance[]; opacity: number; } | { familyInstances?: FamilyInstance[]; select: boolean; filters?: FiltersParam; } | { units: Units; } | { precision: number; } | { moveSpeed: number; } | { hour: number; } | SetSunAzimuthParam | { sensitivity: 1 | 2 | 3 | 4 | 5; } | { height?: number; depth?: number; imageWidth?: number; imageHeight?: number; } | { options: string[]; defaultSelect: number; } | { type: MeasurementMode; } | AddSpaceParam | { space: string; } | { userDefinedMaxFps: number; } | { familyInstances: FamilyInstance[]; color: Color; } | { pattern?: number; } | { modelId: string; matrix: number[]; } | { fov: number; } | { factor: number; } | { color: Color; } | { level: number; } | { opacity: number; } | ViewSheetParam | { viewSheetId: string; } | { viewSheetId: string; viewportId: string; } | { positionInViewSheet: Coordinates2D; viewSheetId: string; viewportId: string; } | Settings | SectionFillParam | { mode?: DisplayMode | MarkerTextDisplayMode | "small" | "large"; } | AddLightParam | PossessPawnParam | { id: string; newId: string; newName: string; } | ImportLightsParam | { position: ScreenPosition; widget: UEWidget; anchor: Anchor; } | { time: number; } | { type: TransformGizmoMode | DecorationType; } | { type: string; } | ActiveFirstPersonModeParam | { brightness: number; } | UpdateModelParam | { location?: Location; rotation?: Rotation; scale?: Scale | number; } | { modelId: string; } | { modelId?: string; visible: boolean; filters?: FiltersParam; } | { checkEditable?: boolean; } | FamilyInstanceParam | { url: string; method?: "get" | "post"; } | { modelId?: string; familyInstanceId: string; axis?: AxisType; type?: DecorationType; } | { viewMode: ViewMode; } | { axis?: AxisType; location?: vec3; } | { familyInstance: FamilyInstance; newFamilyInstance: FamilyInstanceParam; } | { strategy: VideoStrategy | ZoomStrategy; } | { distance: number; } | { value: number; } | MeshInstance | { materialInstanceIds: string[]; } | { userDataArray: { materialInstanceId: string; userData: string; }[]; } | FamilyInstanceInfoParam | { ids: string[]; } | { alwaysVisible: boolean; } | { imageDescriptions: ImageDescription[]; } | { interval: number; } | { scriptFile: string; } | { srcModelId: string; destModelId: string; } | { direction?: Coordinates3D; screenPercentage?: number; bNoAnimation: boolean; } | { modelId: string; parkingSpaces: ParkingSpace[]; } | RegionParam | PawnInstance | Decoration | Decorations | ActiveThirdPersonTopViewModeParam | { style: "SinglePrimitive" | "PrimitivesWithSameMaterial" | 0 | 1; } | MaterialOverrideRecord | { originalMaterialName: string; } | { lightType: Omit; } | { killZ: number; } | { original?: boolean; } | { connections: Path[]; } | { from: Coordinates3D; to: Coordinates3D; } | { paths: Coordinates3D[]; type?: "default" | "sketch"; zoomToPath?: boolean; } | OpenVehicleDoorsParam | Omit | ParkingPathParam | { pawnInstanceId?: string; modelId?: string; familyInstanceId?: string; pathIds?: string[]; } | { categories?: string[]; } | { modelViewDistanceScales: Required>[]; } | { min: number; max: number; } | { maxDistance: number; } | { configFile: string; } | { projectPath: string; } | { minBitrate?: number; maxBitrate?: number; startBitrate?: number; } | { pawnName: string; } | { viewType: ViewType; } | { modelId?: string; filters: { key: string; values: string[]; }[]; } | { environment: string; signatureId: string; projectId: string; } | { basePath: string; } | { length: number; } | { visibility: boolean; } | { dimensions: Dimension[]; } | MaterialEditSelectModeParam | SelectedMaterialParameters | SelectedMaterialParam | { measurements: Measurement[]; } | { highlight: boolean; } | { enable: boolean; } | { rotate: number; zoom: number; pan: number; } | { categoryName: string; } | { consoleCommands: string[]; } | NavigationPathParam | { boundingBox: box; cameraDirection?: Coordinates3D; screenPercentage?: number; noAnimation: boolean; };