refactor: refactor SCThingTypes from union-type to enum. SCThingType-type-attributes are now string-type-attributes.

This commit is contained in:
Michel Jonathan Schmitz
2018-12-05 18:51:28 +01:00
parent 641eff15b8
commit f9056eeb33
25 changed files with 134 additions and 192 deletions

View File

@@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCThing, SCThingMeta} from '../Thing';
import {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCISO8601Date} from '../types/Time';
import {SCAcademicEventWithoutReferences} from './AcademicEvent';
import {SCArticleWithoutReferences} from './Article';
@@ -23,11 +23,6 @@ import {SCPointOfInterestWithoutReferences} from './PointOfInterest';
import {SCRoomWithoutReferences} from './Room';
import {SCSportCourseWithoutReferences} from './SportCourse';
/**
* Type of a favorite
*/
export type SCFavoriteType = 'favorite';
/**
* A favorite without references
*/
@@ -50,7 +45,7 @@ export interface SCFavoriteWithoutReferences extends SCThing {
/**
* Type of a favorite
*/
type: SCFavoriteType;
type: SCThingType.Favorite;
}
/**
@@ -69,6 +64,11 @@ export interface SCFavorite extends SCFavoriteWithoutReferences {
| SCPointOfInterestWithoutReferences
| SCRoomWithoutReferences
| SCSportCourseWithoutReferences;
/**
* Type of a favorite
*/
type: SCThingType.Favorite;
}
/**