67b778b926
* feat: ensure consistent ordering of nodes to match ViewerLayoutPanel * feat: Order rootNodes based on resourceItems * Revert "feat: Order rootNodes based on resourceItems" This reverts commit 5029e361e762c0a6d9245638f7b269f7beeb8f37. * Revert "feat: ensure consistent ordering of nodes to match ViewerLayoutPanel" This reverts commit e2f557bf319f21ab5c477929021de1d12236ade9. * fix: change rawSpeckleData to computed. order scene explorer items. * Fix to unnamed models after call with Fabians
35 lines
951 B
TypeScript
35 lines
951 B
TypeScript
import type { MaybeNullOrUndefined } from '@speckle/shared'
|
|
import {
|
|
type NumericPropertyInfo,
|
|
type PropertyInfo,
|
|
type SpeckleObject,
|
|
type SpeckleReference,
|
|
type StringPropertyInfo
|
|
} from '@speckle/viewer'
|
|
import type { Raw } from 'vue'
|
|
|
|
export const isStringPropertyInfo = (
|
|
info: MaybeNullOrUndefined<PropertyInfo>
|
|
): info is StringPropertyInfo => info?.type === 'string'
|
|
export const isNumericPropertyInfo = (
|
|
info: MaybeNullOrUndefined<PropertyInfo>
|
|
): info is NumericPropertyInfo => info?.type === 'number'
|
|
|
|
// Note: minor typing hacks for less squiggly lines in the explorer.
|
|
// TODO: ask alex re viewer data tree types
|
|
|
|
export type ExplorerNode = {
|
|
guid?: string
|
|
data?: SpeckleObject
|
|
raw?: SpeckleObject
|
|
atomic?: boolean
|
|
model?: Record<string, unknown> & { id?: string }
|
|
children: ExplorerNode[]
|
|
}
|
|
|
|
export type TreeItemComponentModel = {
|
|
rawNode: Raw<ExplorerNode>
|
|
}
|
|
|
|
export type { SpeckleObject, SpeckleReference }
|