Files
frontend-miniapp/src/domain/museum.ts
2026-06-26 04:21:12 +08:00

270 lines
5.4 KiB
TypeScript

export interface MuseumFloor {
id: string
label: string
order: number
}
export type GuideDiagnosticsStatus = 'OK' | 'WARN' | 'ERROR'
export type GuideDataIssueSeverity = 'info' | 'warn' | 'error'
export interface GuideFloorDetail extends MuseumFloor {
sourceCode?: string
sourceName?: string
modelReady?: boolean
poiCount?: number
spaceCount?: number
guideStopCount?: number
navigablePlaceCount?: number
routeNodeCount?: number
routeEdgeCount?: number
routePlanningReady?: boolean
warnings: string[]
}
export interface GuideMapDiagnosticsSummary {
floorCount: number
modelReadyFloorCount: number
poiCount: number
spaceCount: number
guideStopCount: number
navigablePlaceCount: number
routeNodeCount: number
routeEdgeCount: number
}
export interface GuideMapDiagnostics {
mapId: string
mapName: string
sdkVersion?: string
status: GuideDiagnosticsStatus
floors: GuideFloorDetail[]
summary: GuideMapDiagnosticsSummary
warnings: string[]
}
export interface GuideDataIntegrityIssue {
id: string
scope: 'floor' | 'poi'
severity: GuideDataIssueSeverity
message: string
floorId?: string
floorLabel?: string
poiId?: string
fields?: string[]
}
export interface GuideDataIntegrityReport {
status: GuideDiagnosticsStatus
summary: {
floorCount: number
poiCount: number
issueCount: number
errorCount: number
warningCount: number
}
issues: GuideDataIntegrityIssue[]
warnings: string[]
}
export interface MuseumCategory {
id: string
label: string
iconType?: string
}
export interface MuseumPoi {
id: string
name: string
floorId: string
floorLabel: string
primaryCategory: MuseumCategory
categories: MuseumCategory[]
positionGltf?: [number, number, number]
sourceObjectName?: string
sourceConfidence?: string
navigationReadiness?: string
accessible: boolean
}
export type GuideLocationResolutionStatus = 'exact' | 'hallFallback' | 'candidate' | 'unavailable'
export interface GuideLocationResolution {
status: GuideLocationResolutionStatus
poiId?: string
sourcePoiId?: string
actionText: string
previewOnly: boolean
confidence?: string
method?: string
floorId?: string
floorLabel?: string
note?: string
}
export interface MuseumHall {
id: string
name: string
floorId?: string
floorLabel?: string
description?: string
image?: string
exhibitCount?: number
area?: string
poiId?: string
location?: GuideLocationResolution
}
export interface MuseumExhibit {
id: string
name: string
hallId?: string
hallName?: string
floorId?: string
floorLabel?: string
image?: string
description?: string
poiId?: string
sourcePoiId?: string
location?: GuideLocationResolution
artist?: string
year?: string
material?: string
size?: string
tags?: string[]
guideContentId?: string
guideTitle?: string
guideText?: string
audioUrl?: string
audioDuration?: number
audioAvailable?: boolean
playTargetType?: AudioPlayTargetType
playTargetId?: string
}
export interface GuideLocationPreview {
poiId: string
name: string
floorId: string
floorLabel: string
primaryCategoryZh?: string
positionGltf?: [number, number, number]
sourceObjectName?: string
}
export interface GuideStartLocation {
label: string
floor?: string
source?: string
}
export interface GuidePreviewStep {
id: string
text: string
}
export interface GuideLocationPreviewPlan {
id: string
facilityId: string
target: string
summary: string
steps: GuidePreviewStep[]
targetLocation: GuideLocationPreview | null
startLocation: GuideStartLocation | null
}
export interface GuideRouteReadiness {
ready: boolean
message: string
requiredData: string[]
}
export interface GuideRouteTarget {
poiId: string
name: string
floorId: string
floorLabel: string
categoryLabel?: string
positionGltf?: [number, number, number]
routeNodeId: string
}
export interface GuideRoutePoint {
nodeId: string
floorId: string
position: [number, number, number]
}
export interface GuideRouteFloorSegment {
floorId: string
floorLabel: string
points: GuideRoutePoint[]
}
export interface GuideRouteConnectorPoint {
nodeId: string
floorId: string
floorLabel: string
position: [number, number, number]
connectorType?: string
}
export interface GuideRouteEndpoint {
poiId: string
name: string
floorId: string
floorLabel: string
routeNodeId: string
position: [number, number, number]
}
export interface GuideRouteResult {
id: string
start: GuideRouteEndpoint
end: GuideRouteEndpoint
distanceMeters: number
nodeIds: string[]
points: GuideRoutePoint[]
floorSegments: GuideRouteFloorSegment[]
connectorPoints: GuideRouteConnectorPoint[]
}
export interface MediaAsset {
id: string
type: 'audio' | 'image' | 'transcript'
url?: string
duration?: number
language?: string
available: boolean
unavailableReason?: string
}
export type AudioPlayTargetType = 'ITEM' | 'STOP'
export interface ExplainTrack {
id: string
exhibitId?: string
hallId?: string
title: string
summary?: string
mediaId?: string
coverImage?: string
poiId?: string
sourcePoiId?: string
location?: GuideLocationResolution
floorId?: string
available: boolean
playTargetType?: AudioPlayTargetType
playTargetId?: string
}
export interface SearchIndexItem {
id: string
name: string
desc: string
type: 'exhibit' | 'hall' | 'facility'
poiId?: string
floorId?: string
exhibitId?: string
hallId?: string
}