eligius 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,11 @@ import { IEventbus } from '../eventbus/types';
3
3
  import { TOperationData } from '../operation/types';
4
4
  import { IStrictDuration } from '../types';
5
5
  import { EndableAction } from './endable-action';
6
- export declare class TimelineAction extends EndableAction {
6
+ import { ITimelineAction } from './types';
7
+ export declare class TimelineAction extends EndableAction implements ITimelineAction {
7
8
  duration: IStrictDuration;
8
- active: boolean;
9
+ private _active;
10
+ get active(): boolean;
9
11
  constructor(name: string, startOperations: IResolvedOperation[], endOperations: IResolvedOperation[], duration: IStrictDuration, eventBus: IEventbus);
10
12
  start(initOperationData?: TOperationData): Promise<TOperationData>;
11
13
  end(initOperationData: TOperationData): Promise<TOperationData>;
@@ -12,6 +12,6 @@ export interface IEndableAction extends IAction {
12
12
  end(initOperationData?: TOperationData): Promise<TOperationData>;
13
13
  }
14
14
  export interface ITimelineAction extends IEndableAction {
15
- active: boolean;
15
+ get active(): boolean;
16
16
  duration: IStrictDuration;
17
17
  }
@@ -1,7 +1,8 @@
1
- import { ILabel, ILanguageLabel, TimelineTypes } from '../../types';
1
+ import { TimelineTypes } from '../../types';
2
2
  import { IActionConfiguration, IEngineConfiguration, ITimelineActionConfiguration, ITimelineConfiguration } from '../types';
3
3
  import { ActionCreatorFactory } from './action-creator-factory';
4
4
  import { ActionEditor, EndableActionEditor, TimelineActionEditor } from './action-editor';
5
+ import { LabelEditor } from './label-editor';
5
6
  import { TimelineProvidersSettingsEditor } from './timeline-provider-settings-editor';
6
7
  export declare type TEngineConfigurationLists = Pick<IEngineConfiguration, 'availableLanguages' | 'initActions' | 'actions' | 'eventActions' | 'timelines' | 'labels'>;
7
8
  declare type ConfigurationFactoryExtension = (this: ConfigurationFactory, ...rest: any[]) => void;
@@ -104,10 +105,10 @@ export declare class ConfigurationFactory {
104
105
  setDefaultLanguage(defaultLanguage: string): this;
105
106
  setContainerSelector(selector: string): this;
106
107
  editTimelineProviderSettings(): TimelineProvidersSettingsEditor;
107
- getConfiguration(callBack?: (copy: IEngineConfiguration) => IEngineConfiguration | undefined): IEngineConfiguration;
108
+ getConfiguration(callBack?: (copy: IEngineConfiguration) => IEngineConfiguration): IEngineConfiguration;
108
109
  addLanguage(languageCode: string, languageLabel: string): this;
109
- _internalAddAction(collectionName: keyof TEngineConfigurationLists, action: IActionConfiguration): void;
110
- _initializeCollection<T, K extends keyof T>(parent: T, name: K): T[K];
110
+ private _internalAddAction;
111
+ private _initializeCollection;
111
112
  addAction(action: IActionConfiguration): void;
112
113
  addInitAction(action: IActionConfiguration): void;
113
114
  addEventAction(action: IActionConfiguration): void;
@@ -119,9 +120,11 @@ export declare class ConfigurationFactory {
119
120
  addTimeline(uri: string, type: TimelineTypes, duration: number, loop: boolean, selector: string): this;
120
121
  getTimeline(uri: string): ITimelineConfiguration | undefined;
121
122
  removeTimeline(uri: string): this;
122
- _initializeLabel(id: string, labels: ILanguageLabel[]): ILanguageLabel;
123
- _getLabelTranslation(labelTranslations: ILabel[], languageCode: string): ILabel;
123
+ private _initializeLabel;
124
+ private _getLabelTranslation;
125
+ editLabel(id: string): LabelEditor;
124
126
  addLabel(id: string, code: string, translation: string): this;
127
+ addLabels(id: string, translations: Record<string, string>): this;
125
128
  removeLabel(id: string): this;
126
129
  editAction(id: string): EndableActionEditor<import("../types").IEndableActionConfiguration>;
127
130
  editEventAction(id: string): ActionEditor<import("../types").IEventActionConfiguration>;
@@ -0,0 +1,11 @@
1
+ import { ILanguageLabel } from '../../types';
2
+ import { ConfigurationFactory } from './configuration-factory';
3
+ export declare class LabelEditor {
4
+ private factory;
5
+ private languageLabel;
6
+ constructor(factory: ConfigurationFactory, languageLabel: ILanguageLabel);
7
+ private _internalGetLabel;
8
+ setLabel(languageCode: string, translation: string): this;
9
+ removeLabel(languageCode: string): this;
10
+ end(): ConfigurationFactory;
11
+ }
@@ -4,6 +4,7 @@ import { IController } from './types';
4
4
  export interface ILabelControllerMetadata {
5
5
  selectedElement: JQuery;
6
6
  labelId: string;
7
+ attributeName?: string;
7
8
  }
8
9
  /**
9
10
  * This controller attaches to the given selected element and renders the text associated with the given label id in it.
@@ -1,8 +1,15 @@
1
+ import { IEndableAction } from './action/types';
1
2
  import { IResolvedEngineConfiguration } from './configuration/types';
2
3
  import { IEventbus } from './eventbus/types';
3
4
  import { LanguageManager } from './language-manager';
4
5
  import { ITimelineProvider } from './timelineproviders/types';
5
6
  import { IEligiusEngine, ITimelineProviderInfo, TimelineTypes } from './types';
7
+ declare type ActionMethod = (IEndableAction['start'] & ActionMethodMetadata) | (IEndableAction['end'] & ActionMethodMetadata);
8
+ interface ActionMethodMetadata {
9
+ id: string;
10
+ isStart: boolean;
11
+ startPosition?: number;
12
+ }
6
13
  /**
7
14
  * This is where the magic happens. The engine is responsible for starting and stopping
8
15
  * the given timeline provider and triggering the actions associated with the positions along the timeline.
@@ -48,6 +55,8 @@ export declare class EligiusEngine implements IEligiusEngine {
48
55
  private _playRequest;
49
56
  private _toggleplay;
50
57
  private _createTimelineLookup;
58
+ static sortTimelines(timelines: Record<number, ActionMethod[]>[]): void;
59
+ static sortActionsPerPosition(actions: ActionMethod[]): ActionMethod[];
51
60
  private _addTimelineActionStart;
52
61
  private _addTimelineActionEnd;
53
62
  private _initializeUriLookup;
@@ -69,12 +78,11 @@ export declare class EligiusEngine implements IEligiusEngine {
69
78
  private _executeRelevantActions;
70
79
  private _handleRequestTimelinePosition;
71
80
  private _handleTimelineComplete;
72
- private _handleExecuteTimelineAction;
73
- private _resizeTimelineAction;
74
- private _getRelevantTimelineActions;
81
+ private _getTimelineActionsForCurrentTimeline;
75
82
  private _requestCurrentTimeline;
76
83
  private _getTimelineActionsForUri;
77
84
  private _onTimeHandler;
78
85
  private _executeActionsForPosition;
79
86
  private _executeSeekActions;
80
87
  }
88
+ export {};