mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-01 03:18:06 +03:00
Goal interfaces
This commit is contained in:
Vendored
+53
-3
@@ -217,14 +217,14 @@ export interface CustomRatings {
|
||||
*/
|
||||
export declare type integer = number;
|
||||
export declare type Ratings = Record<Game, Record<Playtypes[Game], number>>;
|
||||
export interface GoalChartQuery {
|
||||
export interface LEGACY_GoalChartQuery {
|
||||
collection: ValidDatabases;
|
||||
query: Record<string, unknown>;
|
||||
}
|
||||
export interface GoalDocument extends MongoDBDocument {
|
||||
export interface LEGACY_GoalDocument extends MongoDBDocument {
|
||||
directChartID: string | null;
|
||||
directChartIDs?: string[] | null;
|
||||
chartQuery: GoalChartQuery | null;
|
||||
chartQuery: LEGACY_GoalChartQuery | null;
|
||||
scoreQuery: Record<string, unknown>;
|
||||
criteria: {
|
||||
type: "gte" | "lte" | "lt" | "gt" | "anyMatch" | "all";
|
||||
@@ -238,6 +238,56 @@ export interface GoalDocument extends MongoDBDocument {
|
||||
game: Game;
|
||||
playtype: Playtypes[Game];
|
||||
}
|
||||
export interface BaseGoalDocument extends MongoDBDocument {
|
||||
game: Game;
|
||||
playtype: Playtypes[Game];
|
||||
timeAdded: integer;
|
||||
createdBy: integer;
|
||||
title: string;
|
||||
goalID: string;
|
||||
criteria: GoalSingleCriteria | GoalCountCriteria;
|
||||
}
|
||||
interface GoalCriteria {
|
||||
key: "scoreData.percent" | "scoreData.lamp" | "scoreData.grade" | "scoreData.score";
|
||||
value: number;
|
||||
}
|
||||
export interface GoalSingleCriteria extends GoalCriteria {
|
||||
mode: "single";
|
||||
}
|
||||
/**
|
||||
* Criteria for a score to match this criteria - this is a "count" mode, which means that
|
||||
* atleast N scores have to match this criteria. This is for things like folders.
|
||||
*/
|
||||
export interface GoalCountCriteria extends GoalCriteria {
|
||||
mode: "abs" | "proportion";
|
||||
countNum: number;
|
||||
}
|
||||
export interface GoalDocumentSingle extends BaseGoalDocument {
|
||||
charts: {
|
||||
type: "single";
|
||||
data: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Goal Document - Multi. A goal document whos set of charts is the array of
|
||||
* chartIDs inside "charts".
|
||||
*/
|
||||
export interface GoalDocumentMulti extends BaseGoalDocument {
|
||||
charts: {
|
||||
type: "multi";
|
||||
data: string[];
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Goal Document - Folder. A goal document who's set of charts is derived from
|
||||
* the folderID inside "charts".
|
||||
*/
|
||||
export interface GoalDocumentFolder extends BaseGoalDocument {
|
||||
charts: {
|
||||
type: "folder";
|
||||
data: string;
|
||||
};
|
||||
}
|
||||
export interface RivalGroupDocument extends MongoDBDocument {
|
||||
name: string;
|
||||
desc: string;
|
||||
|
||||
+60
-3
@@ -346,15 +346,15 @@ export type integer = number;
|
||||
|
||||
export type Ratings = Record<Game, Record<Playtypes[Game], number>>;
|
||||
|
||||
export interface GoalChartQuery {
|
||||
export interface LEGACY_GoalChartQuery {
|
||||
collection: ValidDatabases;
|
||||
query: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface GoalDocument extends MongoDBDocument {
|
||||
export interface LEGACY_GoalDocument extends MongoDBDocument {
|
||||
directChartID: string | null;
|
||||
directChartIDs?: string[] | null;
|
||||
chartQuery: GoalChartQuery | null;
|
||||
chartQuery: LEGACY_GoalChartQuery | null;
|
||||
scoreQuery: Record<string, unknown>;
|
||||
criteria: {
|
||||
type: "gte" | "lte" | "lt" | "gt" | "anyMatch" | "all";
|
||||
@@ -369,6 +369,63 @@ export interface GoalDocument extends MongoDBDocument {
|
||||
playtype: Playtypes[Game];
|
||||
}
|
||||
|
||||
export interface BaseGoalDocument extends MongoDBDocument {
|
||||
game: Game;
|
||||
playtype: Playtypes[Game];
|
||||
timeAdded: integer;
|
||||
createdBy: integer;
|
||||
title: string;
|
||||
goalID: string;
|
||||
criteria: GoalSingleCriteria | GoalCountCriteria;
|
||||
}
|
||||
|
||||
interface GoalCriteria {
|
||||
key: "scoreData.percent" | "scoreData.lamp" | "scoreData.grade" | "scoreData.score";
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface GoalSingleCriteria extends GoalCriteria {
|
||||
mode: "single";
|
||||
}
|
||||
|
||||
/**
|
||||
* Criteria for a score to match this criteria - this is a "count" mode, which means that
|
||||
* atleast N scores have to match this criteria. This is for things like folders.
|
||||
*/
|
||||
export interface GoalCountCriteria extends GoalCriteria {
|
||||
mode: "abs" | "proportion";
|
||||
countNum: number;
|
||||
}
|
||||
|
||||
export interface GoalDocumentSingle extends BaseGoalDocument {
|
||||
charts: {
|
||||
type: "single";
|
||||
data: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Goal Document - Multi. A goal document whos set of charts is the array of
|
||||
* chartIDs inside "charts".
|
||||
*/
|
||||
export interface GoalDocumentMulti extends BaseGoalDocument {
|
||||
charts: {
|
||||
type: "multi";
|
||||
data: string[];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Goal Document - Folder. A goal document who's set of charts is derived from
|
||||
* the folderID inside "charts".
|
||||
*/
|
||||
export interface GoalDocumentFolder extends BaseGoalDocument {
|
||||
charts: {
|
||||
type: "folder";
|
||||
data: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface RivalGroupDocument extends MongoDBDocument {
|
||||
name: string;
|
||||
desc: string;
|
||||
|
||||
Reference in New Issue
Block a user