diff --git a/src/core/Thing.ts b/src/core/Thing.ts index 56353b8e..24d0b1e5 100644 --- a/src/core/Thing.ts +++ b/src/core/Thing.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 StApps + * Copyright (C) 2018, 2019 StApps * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation, version 3. @@ -96,7 +96,13 @@ export interface SCThing { url?: string; } -export type SCThingOriginType = 'remote' | 'user'; +/** + * Possible types of an origin + */ +export enum SCThingOriginType { + Remote = 'remote', + User = 'user', +} /** * Origin of a thing @@ -149,7 +155,7 @@ export interface SCThingRemoteOrigin extends SCThingOrigin { /** * Type of the origin */ - type: 'remote'; + type: SCThingOriginType.Remote; /** * Main URL of the origin @@ -174,7 +180,7 @@ export interface SCThingUserOrigin extends SCThingOrigin { /** * Type of the origin */ - type: 'user'; + type: SCThingOriginType.User; /** * When the saved thing was last updated with the latest state (e.g. from the backend) diff --git a/src/core/things/Favorite.ts b/src/core/things/Favorite.ts index 6ed75359..cac53680 100644 --- a/src/core/things/Favorite.ts +++ b/src/core/things/Favorite.ts @@ -41,6 +41,9 @@ export type SCFavoriteDataTypes = SCAcademicEventWithoutReferences * @validatable */ export interface SCFavorite extends SCSaveableThing { + /** + * Type of a favorite + */ type: SCThingType.Favorite; }