diff --git a/common/js/types.d.ts b/common/js/types.d.ts index 4b670bff1..6dfbfbe92 100644 --- a/common/js/types.d.ts +++ b/common/js/types.d.ts @@ -486,6 +486,43 @@ export interface TierlistDataDocument; chartID: string; } +interface TierlistPermissions { + edit: boolean; + submit: boolean; + vote: boolean; +} +export interface TierlistV2Parent extends MongoDBDocument { + game: G; + playtype: Playtypes[G]; + name: string; + isDefault: boolean; + tierlistID: string; + createdBy: integer; + createdAt: number; + permissions: Record & { + anyPlayer: TierlistPermissions; + }; + description: string; + lastUpdated: number; + config: { + autoHumanise: boolean; + flags: F[]; + }; +} +export interface TierlistV2DataDocument extends MongoDBDocument { + chartID: string; + tierlistID: string; + type: "grade" | "lamp" | "score"; + data: { + key: string; + value: number; + humanised: string; + flags: { + [flag in F]: boolean; + }; + }; + tierlistDataID: string; +} export interface SongDocument extends MongoDBDocument { id: integer; title: string; diff --git a/common/src/types.ts b/common/src/types.ts index 058b53e02..4e57c8862 100644 --- a/common/src/types.ts +++ b/common/src/types.ts @@ -690,6 +690,44 @@ export interface TierlistDataDocument< chartID: string; } +interface TierlistPermissions { + edit: boolean; + submit: boolean; + vote: boolean; +} + +export interface TierlistV2Parent extends MongoDBDocument { + game: G; + playtype: Playtypes[G]; + name: string; + isDefault: boolean; + tierlistID: string; + createdBy: integer; + createdAt: number; + permissions: Record & { anyPlayer: TierlistPermissions }; + description: string; + lastUpdated: number; + config: { + autoHumanise: boolean; + flags: F[]; + }; +} + +export interface TierlistV2DataDocument extends MongoDBDocument { + chartID: string; + tierlistID: string; + type: "grade" | "lamp" | "score"; + data: { + key: string; + value: number; + humanised: string; + flags: { + [flag in F]: boolean; + }; + }; + tierlistDataID: string; // used to xref changelog data +} + export interface SongDocument extends MongoDBDocument { id: integer; title: string;