1d2a594f0a
* 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
35 lines
931 B
TypeScript
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 }
|