mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
feat: improve monorepo dev experience
This commit is contained in:
@@ -18,13 +18,13 @@
|
||||
export interface SCLanguage {
|
||||
/**
|
||||
* The two letter ISO 639-1 Code of the Language
|
||||
* @filterable
|
||||
* @elasticsearch filterable
|
||||
*/
|
||||
code: SCLanguageCode;
|
||||
|
||||
/**
|
||||
* The Fulltext name of the Language
|
||||
* @filterable
|
||||
* @elasticsearch filterable
|
||||
*/
|
||||
name: SCLanguageName;
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Capsulation for a map with a string as key with values of type `T`
|
||||
*
|
||||
* !!! BEWARE !!!
|
||||
* Can't be refactored to a `Map<K, V>`, because it can't be serialized via JSON.stringify(map)
|
||||
* @typeparam T Can be any type.
|
||||
*/
|
||||
export interface SCMap<T> {
|
||||
/**
|
||||
* One value for each key
|
||||
*/
|
||||
[key: string]: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restricted map with keys, limited to values of `U`, and corresponding values of type `T`
|
||||
*
|
||||
* !!! BEWARE !!!
|
||||
* Can't be refactored to a `Map<K, V>`, because it can't be serialized via JSON.stringify(map)
|
||||
* Also note, that this is a type not an interface
|
||||
* @typeparam U Must be a type the `in` operator can be applied to and contains only strings or numbers
|
||||
* @typeparam T Can be any type
|
||||
*/
|
||||
export type SCRestrictedMap<U extends string | number, T> = {
|
||||
/**
|
||||
* One value for each key
|
||||
*/
|
||||
[key in U]: T;
|
||||
};
|
||||
@@ -14,21 +14,18 @@
|
||||
*/
|
||||
/**
|
||||
* An ISO8601 date
|
||||
* @pattern ^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])(T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])([\.,][0-9]{0,7})?(Z|[+-](?:2[0-3]|[01][0-9])(:?[0-5][0-9])?)?)?$
|
||||
* @see https://gist.github.com/philipashlock/8830168
|
||||
* @date
|
||||
* @format date-time
|
||||
*/
|
||||
export type SCISO8601Date = string;
|
||||
|
||||
/**
|
||||
* An ISO8601 duration
|
||||
* @pattern ^(R\d*\/)?P(?:\d+(?:\.\d+)?Y)?(?:\d+(?:\.\d+)?M)?(?:\d+(?:\.\d+)?W)?(?:\d+(?:\.\d+)?D)?(?:T(?:\d+(?:\.\d+)?H)?(?:\d+(?:\.\d+)?M)?(?:\d+(?:\.\d+)?S)?)?$
|
||||
* @see https://gist.github.com/philipashlock/8830168
|
||||
* @format duration
|
||||
*/
|
||||
export type SCISO8601Duration = string;
|
||||
|
||||
/**
|
||||
* An ISO8601 time
|
||||
* @pattern ^(2[0-3]|[01][0-9]):?([0-5][0-9]):?([0-5][0-9])$
|
||||
* @format time
|
||||
*/
|
||||
export type SCISO8601Time = string;
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
*/
|
||||
/**
|
||||
* Universally unique identifier of the thing
|
||||
* @filterable
|
||||
* @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
|
||||
* @see http://stackoverflow.com/questions/7905929/how-to-test-valid-uuid-guid
|
||||
* @elasticsearch filterable
|
||||
* @format uuid
|
||||
*/
|
||||
export type SCUuid = string;
|
||||
|
||||
Reference in New Issue
Block a user