diff --git a/src/component/Component.ts b/src/component/Component.ts index f300aaf6..4a9e3321 100644 --- a/src/component/Component.ts +++ b/src/component/Component.ts @@ -19,13 +19,15 @@ import { EventEmitter } from "../util/EventEmitter"; import { SubscriptionHolder } from "../util/SubscriptionHolder"; import { IComponent } from "./interfaces/IComponent"; import { ComponentEventType } from "./events/ComponentEventType"; +import { ComponentName } from "./ComponentName"; +import { FallbackComponentName } from "./fallback/FallbackComponentName"; export abstract class Component extends EventEmitter implements IComponent { - public static componentName: string = "not_worthy"; + public static componentName: ComponentName | FallbackComponentName; protected _activated: boolean; protected _container: Container; diff --git a/src/component/ComponentName.ts b/src/component/ComponentName.ts new file mode 100644 index 00000000..1f742495 --- /dev/null +++ b/src/component/ComponentName.ts @@ -0,0 +1,16 @@ +export type ComponentName = + | "attribution" + | "bearing" + | "cache" + | "cover" + | "direction" + | "image" + | "keyboard" + | "marker" + | "mouse" + | "popup" + | "sequence" + | "slider" + | "spatial" + | "tag" + | "zoom"; diff --git a/src/component/attribution/AttributionComponent.ts b/src/component/attribution/AttributionComponent.ts index 5b287c4f..dd6901f7 100644 --- a/src/component/attribution/AttributionComponent.ts +++ b/src/component/attribution/AttributionComponent.ts @@ -12,9 +12,10 @@ import { Navigator } from "../../viewer/Navigator"; import { Component } from "../Component"; import { ComponentConfiguration } from "../interfaces/ComponentConfiguration"; +import { ComponentName } from "../ComponentName"; export class AttributionComponent extends Component { - public static componentName: string = "attribution"; + public static componentName: ComponentName = "attribution"; constructor( name: string, diff --git a/src/component/bearing/BearingComponent.ts b/src/component/bearing/BearingComponent.ts index ebdaa26e..29a52cbb 100644 --- a/src/component/bearing/BearingComponent.ts +++ b/src/component/bearing/BearingComponent.ts @@ -33,6 +33,7 @@ import { ComponentSize } from "../util/ComponentSize"; import { Container } from "../../viewer/Container"; import { Navigator } from "../../viewer/Navigator"; import { isSpherical } from "../../geo/Geo"; +import { ComponentName } from "../ComponentName"; type ImageFov = [number, number]; @@ -61,7 +62,7 @@ interface ImageFovOperation { * ``` */ export class BearingComponent extends Component { - public static componentName: string = "bearing"; + public static componentName: ComponentName = "bearing"; private _spatial: Spatial; private _viewportCoords: ViewportCoords; diff --git a/src/component/cache/CacheComponent.ts b/src/component/cache/CacheComponent.ts index 5fff6d98..9612dc59 100644 --- a/src/component/cache/CacheComponent.ts +++ b/src/component/cache/CacheComponent.ts @@ -34,11 +34,12 @@ import { NavigationDirection } from "../../graph/edge/NavigationDirection"; import { Container } from "../../viewer/Container"; import { Navigator } from "../../viewer/Navigator"; import { isSpherical } from "../../geo/Geo"; +import { ComponentName } from "../ComponentName"; type EdgesDepth = [NavigationEdge[], number]; export class CacheComponent extends Component { - public static componentName: string = "cache"; + public static componentName: ComponentName = "cache"; /** @ignore */ constructor(name: string, container: Container, navigator: Navigator) { diff --git a/src/component/cover/CoverComponent.ts b/src/component/cover/CoverComponent.ts index 0b11f56a..8ec2731e 100644 --- a/src/component/cover/CoverComponent.ts +++ b/src/component/cover/CoverComponent.ts @@ -31,9 +31,10 @@ import { Container } from "../../viewer/Container"; import { Navigator } from "../../viewer/Navigator"; import { ImagesContract } from "../../api/contracts/ImagesContract"; import { CoverState } from "./CoverState"; +import { ComponentName } from "../ComponentName"; export class CoverComponent extends Component { - public static componentName: string = "cover"; + public static componentName: ComponentName = "cover"; constructor(name: string, container: Container, navigator: Navigator) { super(name, container, navigator); diff --git a/src/component/direction/DirectionComponent.ts b/src/component/direction/DirectionComponent.ts index d01adca1..e50780e9 100644 --- a/src/component/direction/DirectionComponent.ts +++ b/src/component/direction/DirectionComponent.ts @@ -32,6 +32,7 @@ import { DirectionDOMRenderer } from "./DirectionDOMRenderer"; import { ComponentEventType } from "../events/ComponentEventType"; import { ComponentHoverEvent } from "../events/ComponentHoverEvent"; import { ComponentStateEvent } from "../events/ComponentStateEvent"; +import { ComponentName } from "../ComponentName"; /** * @class DirectionComponent @@ -39,7 +40,7 @@ import { ComponentStateEvent } from "../events/ComponentStateEvent"; */ export class DirectionComponent extends Component { /** @inheritdoc */ - public static componentName: string = "direction"; + public static componentName: ComponentName = "direction"; private _renderer: DirectionDOMRenderer; diff --git a/src/component/fallback/FallbackComponentName.ts b/src/component/fallback/FallbackComponentName.ts new file mode 100644 index 00000000..664677e4 --- /dev/null +++ b/src/component/fallback/FallbackComponentName.ts @@ -0,0 +1,3 @@ +export type FallbackComponentName = + | "imagefallback" + | "navigationfallback" diff --git a/src/component/fallback/image/ImageFallbackComponent.ts b/src/component/fallback/image/ImageFallbackComponent.ts index 47854301..64e1c6b3 100644 --- a/src/component/fallback/image/ImageFallbackComponent.ts +++ b/src/component/fallback/image/ImageFallbackComponent.ts @@ -19,9 +19,10 @@ import { Container } from "../../../viewer/Container"; import { Navigator } from "../../../viewer/Navigator"; import { ViewportSize } from "../../../render/interfaces/ViewportSize"; import { DOM } from "../../../util/DOM"; +import { FallbackComponentName } from "../FallbackComponentName"; export class ImageFallbackComponent extends Component { - public static componentName: string = "imagefallback"; + public static componentName: FallbackComponentName = "imagefallback"; private _canvasId: string; private _dom: DOM; diff --git a/src/component/fallback/navigation/NavigationFallbackComponent.ts b/src/component/fallback/navigation/NavigationFallbackComponent.ts index aceae713..696a9e89 100644 --- a/src/component/fallback/navigation/NavigationFallbackComponent.ts +++ b/src/component/fallback/navigation/NavigationFallbackComponent.ts @@ -23,6 +23,7 @@ import { VirtualNodeHash } from "../../../render/interfaces/VirtualNodeHash"; import { Container } from "../../../viewer/Container"; import { Navigator } from "../../../viewer/Navigator"; import { isSpherical } from "../../../geo/Geo"; +import { FallbackComponentName } from "../FallbackComponentName"; /** * @class NavigationFallbackComponent @@ -33,7 +34,7 @@ import { isSpherical } from "../../../geo/Geo"; */ export class NavigationFallbackComponent extends Component { - public static componentName: string = "navigationfallback"; + public static componentName: FallbackComponentName = "navigationfallback"; private _seqNames: { [dir: string]: string }; private _spaTopNames: { [dir: string]: string }; diff --git a/src/component/image/ImageComponent.ts b/src/component/image/ImageComponent.ts index f203b75a..65d06ad7 100644 --- a/src/component/image/ImageComponent.ts +++ b/src/component/image/ImageComponent.ts @@ -50,6 +50,7 @@ import { TextureProvider } from "../../tile/TextureProvider"; import { ComponentConfiguration } from "../interfaces/ComponentConfiguration"; import { Transform } from "../../geo/Transform"; import { ViewerConfiguration } from "../../viewer/ViewerConfiguration"; +import { ComponentName } from "../ComponentName"; interface ImageGLRendererOperation { (renderer: ImageGLRenderer): ImageGLRenderer; @@ -58,7 +59,7 @@ interface ImageGLRendererOperation { type PositionLookat = [THREE.Vector3, THREE.Vector3, number, number, number]; export class ImageComponent extends Component { - public static componentName: string = "image"; + public static componentName: ComponentName = "image"; private _rendererOperation$: Subject; private _renderer$: Observable; diff --git a/src/component/interfaces/NavigationFallbackConfiguration.ts b/src/component/interfaces/NavigationFallbackConfiguration.ts index 89d0ae5f..c7f0c5a2 100644 --- a/src/component/interfaces/NavigationFallbackConfiguration.ts +++ b/src/component/interfaces/NavigationFallbackConfiguration.ts @@ -9,7 +9,7 @@ import { ComponentConfiguration } from "./ComponentConfiguration"; * var viewer = new mapillary.Viewer({ * ... * component: { -* fallback: { + * fallback: { * navigation: { * spatial: false, * }, diff --git a/src/component/keyboard/KeyboardComponent.ts b/src/component/keyboard/KeyboardComponent.ts index f30f5604..9c19770e 100644 --- a/src/component/keyboard/KeyboardComponent.ts +++ b/src/component/keyboard/KeyboardComponent.ts @@ -1,5 +1,3 @@ -import { Subscription } from "rxjs"; - import { Component } from "../Component"; import { Container } from "../../viewer/Container"; @@ -11,6 +9,7 @@ import { KeySequenceNavigationHandler } from "./KeySequenceNavigationHandler"; import { KeySpatialNavigationHandler } from "./KeySpatialNavigationHandler"; import { KeyZoomHandler } from "./KeyZoomHandler"; import { KeyPlayHandler } from "./KeyPlayHandler"; +import { ComponentName } from "../ComponentName"; /** * @class KeyboardComponent @@ -27,7 +26,7 @@ import { KeyPlayHandler } from "./KeyPlayHandler"; * ``` */ export class KeyboardComponent extends Component { - public static componentName: string = "keyboard"; + public static componentName: ComponentName = "keyboard"; private _keyPlayHandler: KeyPlayHandler; private _keySequenceNavigationHandler: KeySequenceNavigationHandler; diff --git a/src/component/marker/MarkerComponent.ts b/src/component/marker/MarkerComponent.ts index 02506eb5..5b6d0402 100644 --- a/src/component/marker/MarkerComponent.ts +++ b/src/component/marker/MarkerComponent.ts @@ -44,6 +44,7 @@ import { } from "../../geo/GeoCoords"; import { ComponentMarkerEvent } from "../events/ComponentMarkerEvent"; import { ComponentEvent } from "../events/ComponentEvent"; +import { ComponentName } from "../ComponentName"; /** * @class MarkerComponent @@ -78,7 +79,7 @@ import { ComponentEvent } from "../events/ComponentEvent"; * ``` */ export class MarkerComponent extends Component { - public static componentName: string = "marker"; + public static componentName: ComponentName = "marker"; private _graphCalculator: GraphCalculator; private _markerScene: MarkerScene; diff --git a/src/component/mouse/MouseComponent.ts b/src/component/mouse/MouseComponent.ts index a8e5b426..d1e00fe9 100644 --- a/src/component/mouse/MouseComponent.ts +++ b/src/component/mouse/MouseComponent.ts @@ -9,6 +9,7 @@ import { DragPanHandler } from "./DragPanHandler"; import { EarthControlHandler } from "./EarthControlHandler"; import { ScrollZoomHandler } from "./ScrollZoomHandler"; import { TouchZoomHandler } from "./TouchZoomHandler"; +import { ComponentName } from "../ComponentName"; /** * @class MouseComponent @@ -26,7 +27,7 @@ import { TouchZoomHandler } from "./TouchZoomHandler"; */ export class MouseComponent extends Component { /** @inheritdoc */ - public static componentName: string = "mouse"; + public static componentName: ComponentName = "mouse"; private _bounceHandler: BounceHandler; private _dragPanHandler: DragPanHandler; diff --git a/src/component/popup/PopupComponent.ts b/src/component/popup/PopupComponent.ts index cdb8c897..220f90c0 100644 --- a/src/component/popup/PopupComponent.ts +++ b/src/component/popup/PopupComponent.ts @@ -23,6 +23,7 @@ import { DOM } from "../../util/DOM"; import { ComponentConfiguration } from "../interfaces/ComponentConfiguration"; import { Component } from "../Component"; import { Popup } from "./popup/Popup"; +import { ComponentName } from "../ComponentName"; /** * @class PopupComponent @@ -50,7 +51,7 @@ import { Popup } from "./popup/Popup"; * ``` */ export class PopupComponent extends Component { - public static componentName: string = "popup"; + public static componentName: ComponentName = "popup"; private _dom: DOM; diff --git a/src/component/sequence/SequenceComponent.ts b/src/component/sequence/SequenceComponent.ts index 430db222..adb5f9a9 100644 --- a/src/component/sequence/SequenceComponent.ts +++ b/src/component/sequence/SequenceComponent.ts @@ -47,6 +47,7 @@ import { Component } from "../Component"; import { ComponentEventType } from "../events/ComponentEventType"; import { ComponentPlayEvent } from "../events/ComponentPlayEvent"; import { ComponentHoverEvent } from "../events/ComponentHoverEvent"; +import { ComponentName } from "../ComponentName"; /** * @class SequenceComponent @@ -55,7 +56,7 @@ import { ComponentHoverEvent } from "../events/ComponentHoverEvent"; */ export class SequenceComponent extends Component { /** @inheritdoc */ - public static componentName: string = "sequence"; + public static componentName: ComponentName = "sequence"; private _sequenceDOMRenderer: SequenceDOMRenderer; private _scheduler: Scheduler; diff --git a/src/component/slider/SliderComponent.ts b/src/component/slider/SliderComponent.ts index 45cabdc9..84bce58f 100644 --- a/src/component/slider/SliderComponent.ts +++ b/src/component/slider/SliderComponent.ts @@ -65,6 +65,7 @@ import { Transform } from "../../geo/Transform"; import { SliderDOMRenderer } from "./SliderDOMRenderer"; import { isSpherical } from "../../geo/Geo"; import { ViewerConfiguration } from "../../viewer/ViewerConfiguration"; +import { ComponentName } from "../ComponentName"; /** * @class SliderComponent @@ -92,7 +93,7 @@ import { ViewerConfiguration } from "../../viewer/ViewerConfiguration"; * ``` */ export class SliderComponent extends Component { - public static componentName: string = "slider"; + public static componentName: ComponentName = "slider"; private _viewportCoords: ViewportCoords; private _domRenderer: SliderDOMRenderer; diff --git a/src/component/spatial/SpatialComponent.ts b/src/component/spatial/SpatialComponent.ts index 4db59efb..f9092bea 100644 --- a/src/component/spatial/SpatialComponent.ts +++ b/src/component/spatial/SpatialComponent.ts @@ -52,6 +52,7 @@ import { SpatialCache } from "./SpatialCache"; import { CameraType } from "../../geo/interfaces/CameraType"; import { geodeticToEnu } from "../../geo/GeoCoords"; import { LngLat } from "../../api/interfaces/LngLat"; +import { ComponentName } from "../ComponentName"; type IntersectEvent = MouseEvent | FocusEvent; @@ -69,7 +70,7 @@ interface IntersectConfiguration { } export class SpatialComponent extends Component { - public static componentName: string = "spatial"; + public static componentName: ComponentName = "spatial"; private _cache: SpatialCache; private _scene: SpatialScene; diff --git a/src/component/tag/TagComponent.ts b/src/component/tag/TagComponent.ts index ff6b71ca..4b9e662f 100644 --- a/src/component/tag/TagComponent.ts +++ b/src/component/tag/TagComponent.ts @@ -57,6 +57,7 @@ import { ComponentEventType } from "../events/ComponentEventType"; import { ComponentTagModeEvent } from "../events/ComponentTagModeEvent"; import { ComponentGeometryEvent } from "../events/ComponentGeometryEvent"; import { ComponentStateEvent } from "../events/ComponentStateEvent"; +import { ComponentName } from "../ComponentName"; /** * @class TagComponent @@ -94,7 +95,7 @@ import { ComponentStateEvent } from "../events/ComponentStateEvent"; */ export class TagComponent extends Component { /** @inheritdoc */ - public static componentName: string = "tag"; + public static componentName: ComponentName = "tag"; private _tagDomRenderer: TagDOMRenderer; private _tagScene: TagScene; diff --git a/src/component/zoom/ZoomComponent.ts b/src/component/zoom/ZoomComponent.ts index 085d18db..7160fc01 100644 --- a/src/component/zoom/ZoomComponent.ts +++ b/src/component/zoom/ZoomComponent.ts @@ -24,6 +24,7 @@ import { AnimationFrame } from "../../state/interfaces/AnimationFrame"; import { ComponentSize } from "../util/ComponentSize"; import { Container } from "../../viewer/Container"; import { Navigator } from "../../viewer/Navigator"; +import { ComponentName } from "../ComponentName"; /** * @class ZoomComponent @@ -39,7 +40,7 @@ import { Navigator } from "../../viewer/Navigator"; * ``` */ export class ZoomComponent extends Component { - public static componentName: string = "zoom"; + public static componentName: ComponentName = "zoom"; private _viewportCoords: ViewportCoords; diff --git a/src/external/component.ts b/src/external/component.ts index 21bfc24c..abef61a5 100644 --- a/src/external/component.ts +++ b/src/external/component.ts @@ -28,11 +28,15 @@ export { ComponentHoverEvent } from "../component/events/ComponentHoverEvent"; export { ComponentGeometryEvent } from "../component/events/ComponentGeometryEvent"; export { ComponentMarkerEvent } from "../component/events/ComponentMarkerEvent"; +export { ComponentName } from "../component/ComponentName"; + export { ComponentPlayEvent } from "../component/events/ComponentPlayEvent"; export { ComponentSize } from "../component/util/ComponentSize"; export { ComponentStateEvent } from "../component/events/ComponentStateEvent"; export { ComponentTagModeEvent } from "../component/events/ComponentTagModeEvent"; +export { FallbackComponentName } + from "../component/fallback/FallbackComponentName"; export { IComponent } from "../component/interfaces/IComponent"; // Direction diff --git a/src/mapillary.ts b/src/mapillary.ts index f1b19fb8..5a4bb49a 100644 --- a/src/mapillary.ts +++ b/src/mapillary.ts @@ -25,16 +25,16 @@ TraversingState.register(UnitBezier); */ import { ComponentService } from "./component/ComponentService"; -import { ImageFallbackComponent } - from "./component/fallback/image/ImageFallbackComponent"; -import { NavigationFallbackComponent } - from "./component/fallback/navigation/NavigationFallbackComponent"; +// Cover +import { CoverComponent } from "./component/cover/CoverComponent"; +ComponentService.registerCover(CoverComponent); + +// Component import { AttributionComponent } from "./component/attribution/AttributionComponent"; import { BearingComponent } from "./component/bearing/BearingComponent"; import { CacheComponent } from "./component/cache/CacheComponent"; -import { CoverComponent } from "./component/cover/CoverComponent"; import { DirectionComponent } from "./component/direction/DirectionComponent"; import { ImageComponent } from "./component/image/ImageComponent"; @@ -49,11 +49,6 @@ import { SpatialComponent } import { TagComponent } from "./component/tag/TagComponent"; import { ZoomComponent } from "./component/zoom/ZoomComponent"; -ComponentService.registerCover(CoverComponent); - -ComponentService.register(ImageFallbackComponent); -ComponentService.register(NavigationFallbackComponent); - ComponentService.register(AttributionComponent); ComponentService.register(BearingComponent); ComponentService.register(CacheComponent); @@ -69,6 +64,15 @@ ComponentService.register(SpatialComponent); ComponentService.register(TagComponent); ComponentService.register(ZoomComponent); +// Fallback +import { ImageFallbackComponent } + from "./component/fallback/image/ImageFallbackComponent"; +import { NavigationFallbackComponent } + from "./component/fallback/navigation/NavigationFallbackComponent"; + +ComponentService.register(ImageFallbackComponent); +ComponentService.register(NavigationFallbackComponent); + /** * External exports * diff --git a/src/viewer/ComponentController.ts b/src/viewer/ComponentController.ts index df273cc0..1d55f88f 100644 --- a/src/viewer/ComponentController.ts +++ b/src/viewer/ComponentController.ts @@ -23,6 +23,8 @@ import { CoverConfiguration } from "../component/interfaces/CoverConfiguration"; import { Image } from "../graph/Image"; import { CoverState } from "../component/cover/CoverState"; +import { FallbackComponentName } from "../component/fallback/FallbackComponentName"; +import { ComponentName } from "../component/ComponentName"; export class ComponentController { private _container: Container; @@ -90,7 +92,7 @@ export class ComponentController { return this._componentService.get(name); } - public activate(name: string): void { + public activate(name: ComponentName | FallbackComponentName): void { this._componentService.activate(name); } @@ -98,7 +100,7 @@ export class ComponentController { this._coverComponent.configure({ state: CoverState.Visible }); } - public deactivate(name: string): void { + public deactivate(name: ComponentName | FallbackComponentName): void { this._componentService.deactivate(name); } @@ -209,7 +211,9 @@ export class ComponentController { }); } - private _uFalse(option: boolean | TConfiguration, name: string): void { + private _uFalse( + option: boolean | TConfiguration, + name: ComponentName | FallbackComponentName): void { if (option === undefined) { this._componentService.deactivate(name); return; @@ -226,7 +230,9 @@ export class ComponentController { this._componentService.activate(name); } - private _uTrue(option: boolean | TConfiguration, name: string): void { + private _uTrue( + option: boolean | TConfiguration, + name: ComponentName | FallbackComponentName): void { if (option === undefined) { this._componentService.activate(name); return; diff --git a/src/viewer/Viewer.ts b/src/viewer/Viewer.ts index 96c59bdd..58a56935 100644 --- a/src/viewer/Viewer.ts +++ b/src/viewer/Viewer.ts @@ -38,6 +38,9 @@ import { ViewerNavigationEdgeEvent } from "./events/ViewerNavigationEdgeEvent"; import { ViewerImageEvent } from "./events/ViewerImageEvent"; import { ViewerStateEvent } from "./events/ViewerStateEvent"; +import { ComponentName } from "../component/ComponentName"; +import { FallbackComponentName } + from "../component/fallback/FallbackComponentName"; /** * @class Viewer @@ -185,14 +188,16 @@ export class Viewer extends EventEmitter implements IViewer { /** * Activate a component. * - * @param {string} name - Name of the component which will become active. + * @param {ComponentName | FallbackComponentName} name - Name of + * the component which will become active. * * @example * ```js * viewer.activateComponent("marker"); * ``` */ - public activateComponent(name: string): void { + public activateComponent( + name: ComponentName | FallbackComponentName): void { this._componentController.activate(name); } @@ -228,14 +233,16 @@ export class Viewer extends EventEmitter implements IViewer { /** * Deactivate a component. * - * @param {string} name - Name of component which become inactive. + * @param {ComponentName | FallbackComponentName} name - Name + * of component which become inactive. * * @example * ```js * viewer.deactivateComponent("mouse"); * ``` */ - public deactivateComponent(name: string): void { + public deactivateComponent( + name: ComponentName | FallbackComponentName): void { this._componentController.deactivate(name); } @@ -383,7 +390,8 @@ export class Viewer extends EventEmitter implements IViewer { * var mouseComponent = viewer.getComponent("mouse"); * ``` */ - public getComponent>(name: string): TComponent { + public getComponent>( + name: ComponentName | FallbackComponentName): TComponent { return this._componentController.get(name); } diff --git a/test/viewer/ComponentController.test.ts b/test/viewer/ComponentController.test.ts index f2845c4f..cc27b453 100644 --- a/test/viewer/ComponentController.test.ts +++ b/test/viewer/ComponentController.test.ts @@ -24,10 +24,13 @@ import { ComponentConfiguration } import { CoverState } from "../../src/component/cover/CoverState"; import { ViewerNavigableEvent } from "../../src/viewer/events/ViewerNavigableEvent"; +import { ComponentName } from "../../src/component/ComponentName"; +import { FallbackComponentName } + from "../../src/component/fallback/FallbackComponentName"; class CMock extends Component { - protected static _cn: string = "mock"; - public static get componentName(): string { + protected static _cn: ComponentName | FallbackComponentName; + public static get componentName(): ComponentName | FallbackComponentName { return this._cn; }; protected _activate(): void { /*noop*/ } @@ -37,44 +40,43 @@ class CMock extends Component { } } -class IC extends CMock { protected static _cn: string = "imagefallback"; } -class NC extends CMock { protected static _cn: string = "navigationfallback"; } +class IFC extends CMock { + protected static _cn: FallbackComponentName = "imagefallback"; +} +class NFC extends CMock { + protected static _cn: FallbackComponentName = "navigationfallback"; +} -class AC extends CMock { protected static _cn: string = "attribution"; }; -class BaC extends CMock { protected static _cn: string = "background"; } -class BeC extends CMock { protected static _cn: string = "bearing"; } -class CC extends CMock { protected static _cn: string = "cache"; } -class DiC extends CMock { protected static _cn: string = "direction"; } -class DeC extends CMock { protected static _cn: string = "debug"; } -class IPC extends CMock { protected static _cn: string = "image"; } -class KC extends CMock { protected static _cn: string = "keyboard"; } -class MaC extends CMock { protected static _cn: string = "marker"; } -class MoC extends CMock { protected static _cn: string = "mouse"; } -class PC extends CMock { protected static _cn: string = "popup"; } -class RC extends CMock { protected static _cn: string = "route"; } -class SeC extends CMock { protected static _cn: string = "sequence"; } -class SlC extends CMock { protected static _cn: string = "slider"; } -class SDC extends CMock { protected static _cn: string = "spatial"; } -class TC extends CMock { protected static _cn: string = "tag"; } -class ZC extends CMock { protected static _cn: string = "zoom"; } +ComponentService.register(IFC); +ComponentService.register(NFC); + +class AC extends CMock { protected static _cn: ComponentName = "attribution"; }; +class BeC extends CMock { protected static _cn: ComponentName = "bearing"; } +class CC extends CMock { protected static _cn: ComponentName = "cache"; } +class DiC extends CMock { protected static _cn: ComponentName = "direction"; } +class IC extends CMock { protected static _cn: ComponentName = "image"; } +class KC extends CMock { protected static _cn: ComponentName = "keyboard"; } +class MaC extends CMock { protected static _cn: ComponentName = "marker"; } +class MoC extends CMock { protected static _cn: ComponentName = "mouse"; } +class PC extends CMock { protected static _cn: ComponentName = "popup"; } +class SeC extends CMock { protected static _cn: ComponentName = "sequence"; } +class SlC extends CMock { protected static _cn: ComponentName = "slider"; } +class SpC extends CMock { protected static _cn: ComponentName = "spatial"; } +class TC extends CMock { protected static _cn: ComponentName = "tag"; } +class ZC extends CMock { protected static _cn: ComponentName = "zoom"; } ComponentService.register(AC); -ComponentService.register(BaC); ComponentService.register(BeC); ComponentService.register(CC); ComponentService.register(DiC); -ComponentService.register(DeC); ComponentService.register(IC); -ComponentService.register(IPC); ComponentService.register(KC); ComponentService.register(MaC); ComponentService.register(MoC); -ComponentService.register(NC); ComponentService.register(PC); -ComponentService.register(RC); ComponentService.register(SeC); ComponentService.register(SlC); -ComponentService.register(SDC); +ComponentService.register(SpC); ComponentService.register(TC); ComponentService.register(ZC);