Files
speckle-server/packages/frontend-2/lib/viewer/helpers/sceneExplorer.ts
T
Kristaps Fabians Geikins 1d2a594f0a chore: upgrade TS 5.2 -> 5.7.3 & ESLint to 9.20.1 (#4032)
* chore: upgrade TS 5.2 -> 5.7.3

* vite dts fix

* lint fix

* resolutions fix

* ui comp build fix

* precommit fix?

* latest eslint version

* autoloader fix

* undo unnecessary viewer change

* eslint fixes fe2 + trying disabled type linting

* lint fixes
2025-02-20 14:18:18 +02:00

35 lines
931 B
TypeScript

import type { MaybeNullOrUndefined } from '@speckle/shared'
import type {
NumericPropertyInfo,
PropertyInfo,
SpeckleObject,
SpeckleReference,
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 }