mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 00:52:55 +00:00
refactor: split api into api, api-cli & api-plugin
This commit is contained in:
@@ -36,7 +36,6 @@ export class SCThingTranslator {
|
||||
|
||||
/**
|
||||
* Setter for language property. Also flushes translation cache
|
||||
*
|
||||
* @param language The language the translator instance will use from now on
|
||||
*/
|
||||
set language(language: SCLanguageCode) {
|
||||
@@ -87,7 +86,6 @@ export class SCThingTranslator {
|
||||
|
||||
/**
|
||||
* Get field value translation recursively
|
||||
*
|
||||
* @param data The intermediate object / primitive returned by the Proxys get() method
|
||||
* @returns a T object allowing for access to translations or a translated value(s)
|
||||
*/
|
||||
@@ -101,7 +99,6 @@ export class SCThingTranslator {
|
||||
|
||||
/**
|
||||
* Applies only known field translations of the given SCThings meta class to an instance
|
||||
*
|
||||
* @param thingType The type of thing that will be translated
|
||||
* @param language The language the thing property values are translated to
|
||||
* @returns The thing with all known meta values translated
|
||||
@@ -132,7 +129,6 @@ export class SCThingTranslator {
|
||||
|
||||
/**
|
||||
* Returns meta class needed for translations given a SCThingType
|
||||
*
|
||||
* @param thingType Type of the thing
|
||||
* @returns An instance of the metaclass
|
||||
*/
|
||||
@@ -147,7 +143,6 @@ export class SCThingTranslator {
|
||||
/**
|
||||
* Applies known field value translations of the given SCThings meta class to an instance
|
||||
* Translated values overwrite current values inplace (destructive)
|
||||
*
|
||||
* @param instance The thing / object that will be translated
|
||||
* @param language The language the thing / object is translated to
|
||||
* @returns The thing with translated meta field values
|
||||
@@ -187,7 +182,6 @@ export class SCThingTranslator {
|
||||
/**
|
||||
* Recursively translates the given object in-place
|
||||
* Translated values overwrite current values (destructive)
|
||||
*
|
||||
* @param instance The thing / object that will be translated
|
||||
* @returns The thing translated
|
||||
*/
|
||||
@@ -219,7 +213,6 @@ export class SCThingTranslator {
|
||||
/**
|
||||
* Recursively translates the given object in-place
|
||||
* Translated values overwrite current values (destructive)
|
||||
*
|
||||
* @param thing The thing / object that will be translated
|
||||
* @returns The thing translated
|
||||
*/
|
||||
@@ -240,7 +233,6 @@ export class SCThingTranslator {
|
||||
|
||||
/**
|
||||
* Get field value translation recursively
|
||||
*
|
||||
* @example
|
||||
* const dish: SCDish = {...};
|
||||
* translator.translate(dish).offers[0].inPlace.categories[1]());
|
||||
@@ -274,7 +266,6 @@ export class SCThingTranslator {
|
||||
/**
|
||||
* Given a SCThingType this function returns an object with the same basic structure as the corresponding SCThing
|
||||
* All the values will be set to the known translations of the property/key name
|
||||
*
|
||||
* @example
|
||||
* const translatedMetaDish = translator.translatedPropertyNames<SCCourseOfStudy>(SCThingType.CourseOfStudy);
|
||||
* @param type The type whose property names will be translated
|
||||
@@ -287,7 +278,6 @@ export class SCThingTranslator {
|
||||
/**
|
||||
* Given a SCThingType and a corresponding property name it returns the known property value translation
|
||||
* Access pattern to the meta object containing the translation can be thought of as type.field[key] with key being optional
|
||||
*
|
||||
* @example
|
||||
* const singleValueTranslation = translator.translatedPropertyValue(SCThingType.Dish, 'categories', 'main dish');
|
||||
* @param type The type for whose property values a translation is required
|
||||
@@ -348,7 +338,6 @@ class LRUCache<T> {
|
||||
|
||||
/**
|
||||
* Get content from cache by key or by another objects uid
|
||||
*
|
||||
* @param somethingOrKey The key which maps to the cached content or an object for which content has been cached
|
||||
* @returns If available the content connected to the key or somethingOrKey.uid property
|
||||
*/
|
||||
@@ -374,7 +363,6 @@ class LRUCache<T> {
|
||||
|
||||
/**
|
||||
* Place content in cache by key
|
||||
*
|
||||
* @param key The key for which content should be cached
|
||||
* @param content The content that should be cached
|
||||
*/
|
||||
@@ -389,7 +377,6 @@ class LRUCache<T> {
|
||||
|
||||
/**
|
||||
* Place content in cache by another objects uid
|
||||
*
|
||||
* @param something The object that should be cached under something.uid
|
||||
*/
|
||||
public putObject<U extends SCThing>(something: U) {
|
||||
|
||||
Reference in New Issue
Block a user