refactor: component viewer (#2377)
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
||||
ComponentArea,
|
||||
ComponentPermission,
|
||||
EditorFeatureDescription,
|
||||
FindNativeFeature,
|
||||
NativeFeatureIdentifier,
|
||||
NoteType,
|
||||
ThemeDockIcon,
|
||||
@@ -47,6 +48,10 @@ export class UIFeature<F extends UIFeatureDescriptionTypes> implements UIFeature
|
||||
throw new Error('Cannot cast item to feature description')
|
||||
}
|
||||
|
||||
get isNativeFeature(): boolean {
|
||||
return FindNativeFeature(this.featureIdentifier) !== undefined
|
||||
}
|
||||
|
||||
get uniqueIdentifier(): NativeFeatureIdentifier | Uuid {
|
||||
if (isNativeFeature(this.item)) {
|
||||
const nativeFeature = NativeFeatureIdentifier.create(this.item.identifier)
|
||||
|
||||
@@ -17,6 +17,7 @@ export interface UIFeatureInterface<F extends UIFeatureDescriptionTypes> {
|
||||
get isThemeComponent(): boolean
|
||||
get asComponent(): ComponentInterface
|
||||
get asFeatureDescription(): F
|
||||
get isNativeFeature(): boolean
|
||||
get uniqueIdentifier(): NativeFeatureIdentifier | Uuid
|
||||
get featureIdentifier(): string
|
||||
get noteType(): NoteType
|
||||
|
||||
Reference in New Issue
Block a user