mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 16:13:06 +00:00
refactor: extract inline type definitions
This commit is contained in:
@@ -24,42 +24,7 @@ export interface SCFeedbackRequest extends SCMessage {
|
||||
/**
|
||||
* Meta data that helps to understand the feedback
|
||||
*/
|
||||
metaData: {
|
||||
/**
|
||||
* Whether or not the user enabled the debug mode
|
||||
*/
|
||||
debug?: boolean;
|
||||
|
||||
/**
|
||||
* Platform identifier
|
||||
*/
|
||||
platform: string;
|
||||
|
||||
/**
|
||||
* Scope/app state at feedback invocation
|
||||
*/
|
||||
scope: any;
|
||||
|
||||
/**
|
||||
* Whether or not the feedback is sendable
|
||||
*/
|
||||
sendable?: boolean;
|
||||
|
||||
/**
|
||||
* App state that feedback was invoked from
|
||||
*/
|
||||
state: any;
|
||||
|
||||
/**
|
||||
* User agent
|
||||
*/
|
||||
userAgent: string;
|
||||
|
||||
/**
|
||||
* StApps version string
|
||||
*/
|
||||
version: string;
|
||||
};
|
||||
metaData: SCFeedbackRequestMetaData;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,3 +47,43 @@ export class SCFeedbackRoute extends SCAbstractRoute {
|
||||
this.urlFragment = '/feedback';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Request Meta Data
|
||||
*/
|
||||
export interface SCFeedbackRequestMetaData {
|
||||
/**
|
||||
* Whether or not the user enabled the debug mode
|
||||
*/
|
||||
debug?: boolean;
|
||||
|
||||
/**
|
||||
* Platform identifier
|
||||
*/
|
||||
platform: string;
|
||||
|
||||
/**
|
||||
* Scope/app state at feedback invocation
|
||||
*/
|
||||
scope: any;
|
||||
|
||||
/**
|
||||
* Whether or not the feedback is sendable
|
||||
*/
|
||||
sendable?: boolean;
|
||||
|
||||
/**
|
||||
* App state that feedback was invoked from
|
||||
*/
|
||||
state: any;
|
||||
|
||||
/**
|
||||
* User agent
|
||||
*/
|
||||
userAgent: string;
|
||||
|
||||
/**
|
||||
* StApps version string
|
||||
*/
|
||||
version: string;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {SCThings, SCThingsField} from '../../../Classes';
|
||||
import {SCMap} from '../../../types/Map';
|
||||
|
||||
/**
|
||||
* A search response
|
||||
@@ -39,32 +40,12 @@ export interface SCSearchResult {
|
||||
/**
|
||||
* Pagination information
|
||||
*/
|
||||
pagination: {
|
||||
/**
|
||||
* Count of given data. Same as data.length
|
||||
*/
|
||||
count: number;
|
||||
|
||||
/**
|
||||
* Offset of data on all matching data. Given by [[SCSearchQuery.from]]
|
||||
*/
|
||||
offset: number;
|
||||
|
||||
/**
|
||||
* Number of total matching data
|
||||
*/
|
||||
total: number
|
||||
};
|
||||
pagination: SCSearchResponsePagination;
|
||||
|
||||
/**
|
||||
* Stats of the search engine
|
||||
*/
|
||||
stats: {
|
||||
/**
|
||||
* Response time of the search engine in ms
|
||||
*/
|
||||
time: number;
|
||||
};
|
||||
stats: SCSearchResponseSearchEngineStats;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,15 +55,40 @@ export interface SCFacet {
|
||||
/**
|
||||
* Values for the aggregation
|
||||
*/
|
||||
buckets: Array<{
|
||||
/**
|
||||
* One value with its number of occurrences
|
||||
*/
|
||||
[key: string]: number;
|
||||
}>;
|
||||
buckets: Array<SCMap<number>>;
|
||||
|
||||
/**
|
||||
* Field of the aggregation
|
||||
*/
|
||||
field: SCThingsField;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores information about Pagination
|
||||
*/
|
||||
export interface SCSearchResponsePagination {
|
||||
/**
|
||||
* Count of given data. Same as data.length
|
||||
*/
|
||||
count: number;
|
||||
|
||||
/**
|
||||
* Offset of data on all matching data. Given by [[SCSearchQuery.from]]
|
||||
*/
|
||||
offset: number;
|
||||
|
||||
/**
|
||||
* Number of total matching data
|
||||
*/
|
||||
total: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Statistics of search engine
|
||||
*/
|
||||
export interface SCSearchResponseSearchEngineStats {
|
||||
/**
|
||||
* Response time of the search engine in ms
|
||||
*/
|
||||
time: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user