mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
refactor: extract inline type definitions
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
} from '../base/ThingWithCategories';
|
||||
import {SCThingMeta, SCThingType} from '../Thing';
|
||||
import {SCTranslations} from '../types/i18n';
|
||||
import {SCMap} from '../types/Map';
|
||||
|
||||
/**
|
||||
* Categories of a room
|
||||
@@ -53,7 +54,7 @@ export interface SCRoomWithoutReferences
|
||||
/**
|
||||
* The inventory of the place/room as a list of items and their quantity.
|
||||
*/
|
||||
inventory?: Array<{ key: string, value: number }>;
|
||||
inventory?: SCMap<number>;
|
||||
|
||||
/**
|
||||
* Translations of specific values of the object
|
||||
|
||||
@@ -97,11 +97,7 @@ export interface SCTourStepTooltip {
|
||||
/**
|
||||
* How the step shall be resolved
|
||||
*/
|
||||
resolved?: { element: string } | { event: string } | { location: { is: string } | { match: string } } | {
|
||||
menu:
|
||||
'open-left'
|
||||
| 'open-right';
|
||||
};
|
||||
resolved?: SCTourResolvedElement | SCTourResolvedEvent | SCTourResolvedLocation | SCTourResolvedMenu;
|
||||
|
||||
/**
|
||||
* Text that the tooltip shall contain
|
||||
@@ -138,3 +134,63 @@ export interface SCTourStepMenu {
|
||||
*/
|
||||
type: 'menu';
|
||||
}
|
||||
|
||||
/**
|
||||
* Tour step resolved by an element
|
||||
*/
|
||||
export interface SCTourResolvedElement {
|
||||
/**
|
||||
* Element name
|
||||
*/
|
||||
element: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tour step resolved by an event
|
||||
*/
|
||||
export interface SCTourResolvedEvent {
|
||||
/**
|
||||
* Event name
|
||||
*/
|
||||
event: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tour step resolved by a location
|
||||
*/
|
||||
export interface SCTourResolvedLocation {
|
||||
/**
|
||||
* Matching location
|
||||
*/
|
||||
location: SCTourResolvedLocationTypeIs | SCTourResolvedLocationTypeMatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tour step resolved by a location for a specific location
|
||||
*/
|
||||
export interface SCTourResolvedLocationTypeIs {
|
||||
/**
|
||||
* Specific location name
|
||||
*/
|
||||
is: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tour step resolved by a location for a specific location
|
||||
*/
|
||||
export interface SCTourResolvedLocationTypeMatch {
|
||||
/**
|
||||
* Regex location name
|
||||
*/
|
||||
match: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tour step resolved by interacting with a menu
|
||||
*/
|
||||
export interface SCTourResolvedMenu {
|
||||
/**
|
||||
* Menu location
|
||||
*/
|
||||
menu: 'open-left' | 'open-right';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user