mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 16:42:56 +00:00
refactor: move to eslint
This commit is contained in:
204
src/meta.ts
204
src/meta.ts
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2021 StApps
|
||||
* Copyright (C) 2019-2022 Open 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.
|
||||
@@ -13,14 +13,22 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThingType} from './things/abstract/thing';
|
||||
import {SCAcademicEvent, SCAcademicEventMeta, SCAcademicEventWithoutReferences} from './things/academic-event';
|
||||
import {
|
||||
SCAcademicEvent,
|
||||
SCAcademicEventMeta,
|
||||
SCAcademicEventWithoutReferences,
|
||||
} from './things/academic-event';
|
||||
import {SCArticle, SCArticleMeta, SCArticleWithoutReferences} from './things/article';
|
||||
import {SCAssessment, SCAssessmentMeta, SCAssessmentWithoutReferences} from './things/assessment';
|
||||
import {SCBook, SCBookMeta, SCBookWithoutReferences} from './things/book';
|
||||
import {SCBuilding, SCBuildingMeta, SCBuildingWithoutReferences} from './things/building';
|
||||
import {SCCatalog, SCCatalogMeta, SCCatalogWithoutReferences} from './things/catalog';
|
||||
import {SCContactPoint, SCContactPointMeta, SCContactPointWithoutReferences} from './things/contact-point';
|
||||
import {SCCourseOfStudy, SCCourseOfStudyMeta, SCCourseOfStudyWithoutReferences} from './things/course-of-study';
|
||||
import {
|
||||
SCCourseOfStudy,
|
||||
SCCourseOfStudyMeta,
|
||||
SCCourseOfStudyWithoutReferences,
|
||||
} from './things/course-of-study';
|
||||
import {SCDateSeries, SCDateSeriesMeta, SCDateSeriesWithoutReferences} from './things/date-series';
|
||||
import {SCDiff, SCDiffMeta, SCDiffWithoutReferences} from './things/diff';
|
||||
import {SCDish, SCDishMeta, SCDishWithoutReferences} from './things/dish';
|
||||
@@ -30,7 +38,11 @@ import {SCMessage, SCMessageMeta, SCMessageWithoutReferences} from './things/mes
|
||||
import {SCOrganization, SCOrganizationMeta, SCOrganizationWithoutReferences} from './things/organization';
|
||||
import {SCPeriodical, SCPeriodicalMeta, SCPeriodicalWithoutReferences} from './things/periodical';
|
||||
import {SCPerson, SCPersonMeta, SCPersonWithoutReferences} from './things/person';
|
||||
import {SCPointOfInterest, SCPointOfInterestMeta, SCPointOfInterestWithoutReferences} from './things/point-of-interest';
|
||||
import {
|
||||
SCPointOfInterest,
|
||||
SCPointOfInterestMeta,
|
||||
SCPointOfInterestWithoutReferences,
|
||||
} from './things/point-of-interest';
|
||||
import {
|
||||
SCPublicationEvent,
|
||||
SCPublicationEventMeta,
|
||||
@@ -46,12 +58,10 @@ import {SCToDo, SCToDoMeta, SCToDoWithoutReferences} from './things/todo';
|
||||
import {SCTour, SCTourMeta, SCTourWithoutReferences} from './things/tour';
|
||||
import {SCVideo, SCVideoMeta, SCVideoWithoutReferences} from './things/video';
|
||||
|
||||
/* tslint:disable:variable-name */
|
||||
/**
|
||||
* A map of things, from type to meta data
|
||||
*/
|
||||
export const SCClasses: { [K in SCThingType]: object } = {
|
||||
/* tslint:enable */
|
||||
export const SCClasses: {[K in SCThingType]: object} = {
|
||||
'assessment': SCAssessmentMeta,
|
||||
'academic event': SCAcademicEventMeta,
|
||||
'article': SCArticleMeta,
|
||||
@@ -83,7 +93,7 @@ export const SCClasses: { [K in SCThingType]: object } = {
|
||||
};
|
||||
|
||||
export type SCIndexableThings =
|
||||
SCAssessment
|
||||
| SCAssessment
|
||||
| SCAcademicEvent
|
||||
| SCArticle
|
||||
| SCBook
|
||||
@@ -112,9 +122,7 @@ export type SCIndexableThings =
|
||||
/**
|
||||
* An object that exists in the StAppsCore
|
||||
*/
|
||||
export type SCThings =
|
||||
SCIndexableThings
|
||||
| SCDiff | SCFavorite | SCSetting;
|
||||
export type SCThings = SCIndexableThings | SCDiff | SCFavorite | SCSetting;
|
||||
|
||||
/**
|
||||
* A field of a thing
|
||||
@@ -124,67 +132,121 @@ export type SCThingsField = keyof SCThings | string;
|
||||
/**
|
||||
* Thing without references for a thing
|
||||
*/
|
||||
export type SCAssociatedThingWithoutReferences<THING extends SCThings> =
|
||||
THING extends SCAssessment ? SCAssessmentWithoutReferences :
|
||||
THING extends SCAcademicEvent ? SCAcademicEventWithoutReferences :
|
||||
THING extends SCArticle ? SCArticleWithoutReferences :
|
||||
THING extends SCBook ? SCBookWithoutReferences :
|
||||
THING extends SCBuilding ? SCBuildingWithoutReferences :
|
||||
THING extends SCCatalog ? SCCatalogWithoutReferences :
|
||||
THING extends SCContactPoint ? SCContactPointWithoutReferences :
|
||||
THING extends SCCourseOfStudy ? SCCourseOfStudyWithoutReferences :
|
||||
THING extends SCDateSeries ? SCDateSeriesWithoutReferences :
|
||||
THING extends SCDiff ? SCDiffWithoutReferences :
|
||||
THING extends SCDish ? SCDishWithoutReferences :
|
||||
THING extends SCFavorite ? SCFavoriteWithoutReferences :
|
||||
THING extends SCFloor ? SCFloorWithoutReferences :
|
||||
THING extends SCMessage ? SCMessageWithoutReferences :
|
||||
THING extends SCOrganization ? SCOrganizationWithoutReferences :
|
||||
THING extends SCPeriodical ? SCPeriodicalWithoutReferences :
|
||||
THING extends SCPerson ? SCPersonWithoutReferences :
|
||||
THING extends SCPointOfInterest ? SCPointOfInterestWithoutReferences :
|
||||
THING extends SCPublicationEvent ? SCPublicationEventWithoutReferences :
|
||||
THING extends SCRoom ? SCRoomWithoutReferences :
|
||||
THING extends SCSemester ? SCSemesterWithoutReferences :
|
||||
THING extends SCSetting ? SCSettingWithoutReferences :
|
||||
THING extends SCSportCourse ? SCSportCourseWithoutReferences :
|
||||
THING extends SCStudyModule ? SCStudyModuleWithoutReferences :
|
||||
THING extends SCTicket ? SCTicketWithoutReferences :
|
||||
THING extends SCToDo ? SCToDoWithoutReferences :
|
||||
THING extends SCTour ? SCTourWithoutReferences :
|
||||
THING extends SCVideo ? SCVideoWithoutReferences :
|
||||
never;
|
||||
export type SCAssociatedThingWithoutReferences<THING extends SCThings> = THING extends SCAssessment
|
||||
? SCAssessmentWithoutReferences
|
||||
: THING extends SCAcademicEvent
|
||||
? SCAcademicEventWithoutReferences
|
||||
: THING extends SCArticle
|
||||
? SCArticleWithoutReferences
|
||||
: THING extends SCBook
|
||||
? SCBookWithoutReferences
|
||||
: THING extends SCBuilding
|
||||
? SCBuildingWithoutReferences
|
||||
: THING extends SCCatalog
|
||||
? SCCatalogWithoutReferences
|
||||
: THING extends SCContactPoint
|
||||
? SCContactPointWithoutReferences
|
||||
: THING extends SCCourseOfStudy
|
||||
? SCCourseOfStudyWithoutReferences
|
||||
: THING extends SCDateSeries
|
||||
? SCDateSeriesWithoutReferences
|
||||
: THING extends SCDiff
|
||||
? SCDiffWithoutReferences
|
||||
: THING extends SCDish
|
||||
? SCDishWithoutReferences
|
||||
: THING extends SCFavorite
|
||||
? SCFavoriteWithoutReferences
|
||||
: THING extends SCFloor
|
||||
? SCFloorWithoutReferences
|
||||
: THING extends SCMessage
|
||||
? SCMessageWithoutReferences
|
||||
: THING extends SCOrganization
|
||||
? SCOrganizationWithoutReferences
|
||||
: THING extends SCPeriodical
|
||||
? SCPeriodicalWithoutReferences
|
||||
: THING extends SCPerson
|
||||
? SCPersonWithoutReferences
|
||||
: THING extends SCPointOfInterest
|
||||
? SCPointOfInterestWithoutReferences
|
||||
: THING extends SCPublicationEvent
|
||||
? SCPublicationEventWithoutReferences
|
||||
: THING extends SCRoom
|
||||
? SCRoomWithoutReferences
|
||||
: THING extends SCSemester
|
||||
? SCSemesterWithoutReferences
|
||||
: THING extends SCSetting
|
||||
? SCSettingWithoutReferences
|
||||
: THING extends SCSportCourse
|
||||
? SCSportCourseWithoutReferences
|
||||
: THING extends SCStudyModule
|
||||
? SCStudyModuleWithoutReferences
|
||||
: THING extends SCTicket
|
||||
? SCTicketWithoutReferences
|
||||
: THING extends SCToDo
|
||||
? SCToDoWithoutReferences
|
||||
: THING extends SCTour
|
||||
? SCTourWithoutReferences
|
||||
: THING extends SCVideo
|
||||
? SCVideoWithoutReferences
|
||||
: never;
|
||||
|
||||
/**
|
||||
* Thing for a thing without references
|
||||
*/
|
||||
export type SCAssociatedThing<THING extends SCThings> =
|
||||
THING extends SCAssessmentWithoutReferences ? SCAssessment :
|
||||
THING extends SCAcademicEventWithoutReferences ? SCAcademicEvent :
|
||||
THING extends SCArticleWithoutReferences ? SCArticle :
|
||||
THING extends SCBookWithoutReferences ? SCBook :
|
||||
THING extends SCBuildingWithoutReferences ? SCBuilding :
|
||||
THING extends SCCatalogWithoutReferences ? SCCatalog :
|
||||
THING extends SCContactPointWithoutReferences ? SCContactPoint :
|
||||
THING extends SCCourseOfStudyWithoutReferences ? SCCourseOfStudy :
|
||||
THING extends SCDateSeriesWithoutReferences ? SCDateSeries :
|
||||
THING extends SCDiffWithoutReferences ? SCDiff :
|
||||
THING extends SCDishWithoutReferences ? SCDish :
|
||||
THING extends SCFavoriteWithoutReferences ? SCFavorite :
|
||||
THING extends SCFloorWithoutReferences ? SCFloor :
|
||||
THING extends SCMessageWithoutReferences ? SCMessage :
|
||||
THING extends SCOrganizationWithoutReferences ? SCOrganization :
|
||||
THING extends SCPeriodicalWithoutReferences ? SCPeriodical :
|
||||
THING extends SCPersonWithoutReferences ? SCPerson :
|
||||
THING extends SCPointOfInterestWithoutReferences ? SCPointOfInterest :
|
||||
THING extends SCPublicationEventWithoutReferences ? SCPublicationEvent :
|
||||
THING extends SCRoomWithoutReferences ? SCRoom :
|
||||
THING extends SCSemesterWithoutReferences ? SCSemester :
|
||||
THING extends SCSettingWithoutReferences ? SCSetting :
|
||||
THING extends SCSportCourseWithoutReferences ? SCSportCourse :
|
||||
THING extends SCStudyModuleWithoutReferences ? SCStudyModule :
|
||||
THING extends SCTicketWithoutReferences ? SCTicket :
|
||||
THING extends SCToDoWithoutReferences ? SCToDo :
|
||||
THING extends SCTourWithoutReferences ? SCTour :
|
||||
THING extends SCVideoWithoutReferences ? SCVideo :
|
||||
never;
|
||||
export type SCAssociatedThing<THING extends SCThings> = THING extends SCAssessmentWithoutReferences
|
||||
? SCAssessment
|
||||
: THING extends SCAcademicEventWithoutReferences
|
||||
? SCAcademicEvent
|
||||
: THING extends SCArticleWithoutReferences
|
||||
? SCArticle
|
||||
: THING extends SCBookWithoutReferences
|
||||
? SCBook
|
||||
: THING extends SCBuildingWithoutReferences
|
||||
? SCBuilding
|
||||
: THING extends SCCatalogWithoutReferences
|
||||
? SCCatalog
|
||||
: THING extends SCContactPointWithoutReferences
|
||||
? SCContactPoint
|
||||
: THING extends SCCourseOfStudyWithoutReferences
|
||||
? SCCourseOfStudy
|
||||
: THING extends SCDateSeriesWithoutReferences
|
||||
? SCDateSeries
|
||||
: THING extends SCDiffWithoutReferences
|
||||
? SCDiff
|
||||
: THING extends SCDishWithoutReferences
|
||||
? SCDish
|
||||
: THING extends SCFavoriteWithoutReferences
|
||||
? SCFavorite
|
||||
: THING extends SCFloorWithoutReferences
|
||||
? SCFloor
|
||||
: THING extends SCMessageWithoutReferences
|
||||
? SCMessage
|
||||
: THING extends SCOrganizationWithoutReferences
|
||||
? SCOrganization
|
||||
: THING extends SCPeriodicalWithoutReferences
|
||||
? SCPeriodical
|
||||
: THING extends SCPersonWithoutReferences
|
||||
? SCPerson
|
||||
: THING extends SCPointOfInterestWithoutReferences
|
||||
? SCPointOfInterest
|
||||
: THING extends SCPublicationEventWithoutReferences
|
||||
? SCPublicationEvent
|
||||
: THING extends SCRoomWithoutReferences
|
||||
? SCRoom
|
||||
: THING extends SCSemesterWithoutReferences
|
||||
? SCSemester
|
||||
: THING extends SCSettingWithoutReferences
|
||||
? SCSetting
|
||||
: THING extends SCSportCourseWithoutReferences
|
||||
? SCSportCourse
|
||||
: THING extends SCStudyModuleWithoutReferences
|
||||
? SCStudyModule
|
||||
: THING extends SCTicketWithoutReferences
|
||||
? SCTicket
|
||||
: THING extends SCToDoWithoutReferences
|
||||
? SCToDo
|
||||
: THING extends SCTourWithoutReferences
|
||||
? SCTour
|
||||
: THING extends SCVideoWithoutReferences
|
||||
? SCVideo
|
||||
: never;
|
||||
|
||||
Reference in New Issue
Block a user