Initial commit
This commit is contained in:
44
src/types/map.types.ts
Normal file
44
src/types/map.types.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
// 地圖元素相關型別
|
||||
|
||||
export type MapElementType = 'aisle' | 'cashier' | 'entrance' | 'storage' | 'curved' | 'promo'
|
||||
|
||||
export interface Position3D {
|
||||
x: number
|
||||
y: number
|
||||
z: number
|
||||
}
|
||||
|
||||
export interface Dimensions3D {
|
||||
width: number
|
||||
height: number
|
||||
depth: number
|
||||
}
|
||||
|
||||
export interface MapElement {
|
||||
id: string
|
||||
type: MapElementType
|
||||
floorIndex: number
|
||||
position: Position3D
|
||||
rotation: number // Y 軸旋轉角度(弧度)
|
||||
dimensions: Dimensions3D
|
||||
categoryId?: string // 指派的類別 ID
|
||||
label?: string // 顯示標籤
|
||||
}
|
||||
|
||||
export interface CurvedElement extends MapElement {
|
||||
type: 'curved'
|
||||
curvePoints: Position3D[] // 曲線控制點
|
||||
curveType: 'arc' | 'bezier'
|
||||
}
|
||||
|
||||
export interface StoreMap {
|
||||
storeId: string
|
||||
elements: MapElement[]
|
||||
curvedElements: CurvedElement[]
|
||||
}
|
||||
|
||||
// 編輯器模式
|
||||
export type EditorMode = 'select' | 'move' | 'scale' | 'rotate' | 'add'
|
||||
|
||||
// 新增元素類型
|
||||
export type AddElementType = MapElementType
|
||||
Reference in New Issue
Block a user