mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[chore] prettify + config prettier
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
export interface PartialBSVersion {
|
||||
BSVersion: string,
|
||||
name?: string
|
||||
BSVersion: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface BSVersion extends PartialBSVersion {
|
||||
BSManifest?: string,
|
||||
ReleaseURL?: string,
|
||||
ReleaseImg?: string,
|
||||
ReleaseDate?: string,
|
||||
year?: string,
|
||||
steam?: boolean,
|
||||
oculus?: boolean,
|
||||
color?: string
|
||||
}
|
||||
BSManifest?: string;
|
||||
ReleaseURL?: string;
|
||||
ReleaseImg?: string;
|
||||
ReleaseDate?: string;
|
||||
year?: string;
|
||||
steam?: boolean;
|
||||
oculus?: boolean;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export function splitIntoChunk<T = unknown>(arr: T[], chunkSize: number): T[][] {
|
||||
const resArr = [];
|
||||
for(let i = 0; i < arr.length; i += chunkSize){
|
||||
for (let i = 0; i < arr.length; i += chunkSize) {
|
||||
resArr.push(arr.slice(i, i + chunkSize));
|
||||
}
|
||||
return resArr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
export type AllSettledHelperOptions = {
|
||||
keepStructure?: boolean;
|
||||
removeFalsy?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
export async function allSettled<T>(promises: Promise<T>[], options?: AllSettledHelperOptions): Promise<T[]> {
|
||||
const settledPromises = await Promise.allSettled(promises);
|
||||
if(options?.keepStructure){
|
||||
return settledPromises.map(p => p.status === 'fulfilled' ? p.value : null);
|
||||
if (options?.keepStructure) {
|
||||
return settledPromises.map(p => (p.status === "fulfilled" ? p.value : null));
|
||||
}
|
||||
|
||||
return settledPromises.reduce((acc, p) => {
|
||||
if(p.status === 'fulfilled'){
|
||||
if(options?.removeFalsy && !p.value){ return acc; }
|
||||
if (p.status === "fulfilled") {
|
||||
if (options?.removeFalsy && !p.value) {
|
||||
return acc;
|
||||
}
|
||||
acc.push(p.value);
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
export function isValidUrl(url: string): boolean{
|
||||
try{
|
||||
export function isValidUrl(url: string): boolean {
|
||||
try {
|
||||
new URL(url);
|
||||
return true;
|
||||
}
|
||||
catch(e){
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface ArchiveProgress{
|
||||
export interface ArchiveProgress {
|
||||
totalFiles: number;
|
||||
prossesedFiles: number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { LauchOption } from "./launch-option.interface"
|
||||
export { LaunchResult } from "./launch-result.interface"
|
||||
export { LauchOption } from "./launch-option.interface";
|
||||
export { LaunchResult } from "./launch-result.interface";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
|
||||
export interface LauchOption {
|
||||
version: BSVersion,
|
||||
oculus: boolean,
|
||||
desktop: boolean,
|
||||
debug: boolean,
|
||||
additionalArgs?: string[]
|
||||
}
|
||||
version: BSVersion;
|
||||
oculus: boolean;
|
||||
desktop: boolean;
|
||||
debug: boolean;
|
||||
additionalArgs?: string[];
|
||||
}
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
export type LaunchResult = (
|
||||
"LAUNCHED"|
|
||||
"STEAM_NOT_RUNNING"|"OCULUS_NOT_RUNNING"|
|
||||
"EXE_NOT_FINDED"|
|
||||
"BS_ALREADY_RUNNING"
|
||||
)
|
||||
export type LaunchResult = "LAUNCHED" | "STEAM_NOT_RUNNING" | "OCULUS_NOT_RUNNING" | "EXE_NOT_FINDED" | "BS_ALREADY_RUNNING";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface BsmException extends Readonly<Omit<NodeJS.ErrnoException, "message">>{
|
||||
readonly title?: string,
|
||||
readonly message?: string,
|
||||
};
|
||||
export interface BsmException extends Readonly<Omit<NodeJS.ErrnoException, "message">> {
|
||||
readonly title?: string;
|
||||
readonly message?: string;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export { IpcRequest } from "./ipc-request.interface"
|
||||
export { IpcResponse } from "./ipc-response.interface"
|
||||
export { OpenSaveDialogOption } from "../os/dialog.model"
|
||||
export { IpcRequest } from "./ipc-request.interface";
|
||||
export { IpcResponse } from "./ipc-response.interface";
|
||||
export { OpenSaveDialogOption } from "../os/dialog.model";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
export interface IpcRequest<T>{
|
||||
args?: T,
|
||||
responceChannel?: string,
|
||||
export interface IpcRequest<T> {
|
||||
args?: T;
|
||||
responceChannel?: string;
|
||||
}
|
||||
|
||||
export type IpcReplier= <T>(data: Observable<T>) => void;
|
||||
export type IpcReplier = <T>(data: Observable<T>) => void;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { BsmException } from "../bsm-exception.model";
|
||||
|
||||
export interface IpcResponse<T>{
|
||||
data?: T,
|
||||
error?: BsmException,
|
||||
success: boolean,
|
||||
export interface IpcResponse<T> {
|
||||
data?: T;
|
||||
error?: BsmException;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
export type IpcErrorChannel = string & `${string}_error`;
|
||||
export type IpcCompleteChannel = string & `${string}_complete`;
|
||||
export type IpcCompleteChannel = string & `${string}_complete`;
|
||||
|
||||
@@ -1,228 +1,228 @@
|
||||
export interface BsvMapDetail {
|
||||
automapper: boolean,
|
||||
createdAt: string,
|
||||
curatedAt: BsvInstant,
|
||||
curator: BsvUserDetail,
|
||||
deletedAt: BsvInstant,
|
||||
description: string,
|
||||
id: string,
|
||||
lastPublishedAt: BsvInstant,
|
||||
metadata: BsvMapDetailMetadata,
|
||||
name: string,
|
||||
qualified: boolean,
|
||||
ranked: boolean,
|
||||
stats: BsvMapStats,
|
||||
tags: MapTag[],
|
||||
updatedAt: BsvInstant,
|
||||
uploaded: BsvInstant,
|
||||
uploader: BsvUserDetail,
|
||||
versions: BsvMapVersion[],
|
||||
automapper: boolean;
|
||||
createdAt: string;
|
||||
curatedAt: BsvInstant;
|
||||
curator: BsvUserDetail;
|
||||
deletedAt: BsvInstant;
|
||||
description: string;
|
||||
id: string;
|
||||
lastPublishedAt: BsvInstant;
|
||||
metadata: BsvMapDetailMetadata;
|
||||
name: string;
|
||||
qualified: boolean;
|
||||
ranked: boolean;
|
||||
stats: BsvMapStats;
|
||||
tags: MapTag[];
|
||||
updatedAt: BsvInstant;
|
||||
uploaded: BsvInstant;
|
||||
uploader: BsvUserDetail;
|
||||
versions: BsvMapVersion[];
|
||||
}
|
||||
|
||||
export interface BsvInstant {
|
||||
epochSeconds: number,
|
||||
nanosecondsOfSecond: number,
|
||||
value: string
|
||||
epochSeconds: number;
|
||||
nanosecondsOfSecond: number;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface BsvUserDetail {
|
||||
admin: boolean,
|
||||
avatar: string,
|
||||
curator: boolean,
|
||||
description: string,
|
||||
email: string,
|
||||
followData: BsvUserFollowData,
|
||||
hash: string,
|
||||
id: number,
|
||||
name: string,
|
||||
stats: BsvUserStats,
|
||||
testplay: boolean,
|
||||
type: string,
|
||||
uniqueSet: boolean,
|
||||
uploadLimit: number,
|
||||
verifiedMapper: boolean
|
||||
admin: boolean;
|
||||
avatar: string;
|
||||
curator: boolean;
|
||||
description: string;
|
||||
email: string;
|
||||
followData: BsvUserFollowData;
|
||||
hash: string;
|
||||
id: number;
|
||||
name: string;
|
||||
stats: BsvUserStats;
|
||||
testplay: boolean;
|
||||
type: string;
|
||||
uniqueSet: boolean;
|
||||
uploadLimit: number;
|
||||
verifiedMapper: boolean;
|
||||
}
|
||||
|
||||
export interface BsvUserFollowData {
|
||||
followers: number,
|
||||
following: boolean,
|
||||
follows: number
|
||||
followers: number;
|
||||
following: boolean;
|
||||
follows: number;
|
||||
}
|
||||
|
||||
export interface BsvUserStats {
|
||||
avgBpm: number,
|
||||
avgDuration: number,
|
||||
avgScore: number,
|
||||
diffStats: BsvUserDiffStats,
|
||||
firstUpload: BsvInstant,
|
||||
lastUpload: BsvInstant,
|
||||
rankedMaps: number,
|
||||
totalDownvotes: number,
|
||||
totalMaps: number,
|
||||
totalUpvotes: number
|
||||
avgBpm: number;
|
||||
avgDuration: number;
|
||||
avgScore: number;
|
||||
diffStats: BsvUserDiffStats;
|
||||
firstUpload: BsvInstant;
|
||||
lastUpload: BsvInstant;
|
||||
rankedMaps: number;
|
||||
totalDownvotes: number;
|
||||
totalMaps: number;
|
||||
totalUpvotes: number;
|
||||
}
|
||||
|
||||
export interface BsvUserDiffStats {
|
||||
easy: number,
|
||||
expert: number,
|
||||
expertPlus: number,
|
||||
hard: number,
|
||||
normal: number,
|
||||
total: number
|
||||
easy: number;
|
||||
expert: number;
|
||||
expertPlus: number;
|
||||
hard: number;
|
||||
normal: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface BsvMapDetailMetadata {
|
||||
bpm: number,
|
||||
duration: number,
|
||||
levelAuthorName: string,
|
||||
songAuthorName: string,
|
||||
songName: string,
|
||||
songSubName: string
|
||||
bpm: number;
|
||||
duration: number;
|
||||
levelAuthorName: string;
|
||||
songAuthorName: string;
|
||||
songName: string;
|
||||
songSubName: string;
|
||||
}
|
||||
|
||||
export interface BsvMapStats {
|
||||
downloads: number,
|
||||
downvotes: number,
|
||||
plays: number,
|
||||
score: number,
|
||||
scoreOneDP: number,
|
||||
upvotes: number,
|
||||
downloads: number;
|
||||
downvotes: number;
|
||||
plays: number;
|
||||
score: number;
|
||||
scoreOneDP: number;
|
||||
upvotes: number;
|
||||
}
|
||||
|
||||
export interface BsvMapVersion {
|
||||
coverURL: string,
|
||||
createdAt: BsvInstant,
|
||||
diffs: BsvMapDifficulty[],
|
||||
downloadURL: string,
|
||||
feedback: string,
|
||||
hash: string,
|
||||
key: string,
|
||||
previewURL: string,
|
||||
sageScore: number,
|
||||
scheduledAt: BsvInstant,
|
||||
state: string,
|
||||
testplayAt: BsvInstant,
|
||||
testplays: BsvMapTestplay[],
|
||||
coverURL: string;
|
||||
createdAt: BsvInstant;
|
||||
diffs: BsvMapDifficulty[];
|
||||
downloadURL: string;
|
||||
feedback: string;
|
||||
hash: string;
|
||||
key: string;
|
||||
previewURL: string;
|
||||
sageScore: number;
|
||||
scheduledAt: BsvInstant;
|
||||
state: string;
|
||||
testplayAt: BsvInstant;
|
||||
testplays: BsvMapTestplay[];
|
||||
}
|
||||
|
||||
export interface BsvMapTestplay {
|
||||
createdAt: BsvInstant,
|
||||
feedback: string,
|
||||
feedbackAt: BsvInstant,
|
||||
user: BsvUserDetail,
|
||||
video: string
|
||||
createdAt: BsvInstant;
|
||||
feedback: string;
|
||||
feedbackAt: BsvInstant;
|
||||
user: BsvUserDetail;
|
||||
video: string;
|
||||
}
|
||||
|
||||
export interface BsvMapDifficulty {
|
||||
bombs: number,
|
||||
characteristic: BsvMapCharacteristic,
|
||||
chroma: boolean,
|
||||
cinema: boolean,
|
||||
difficulty: BsvMapDifficultyType,
|
||||
events: number,
|
||||
length: number,
|
||||
maxScore: number,
|
||||
me: boolean,
|
||||
ne: boolean,
|
||||
njs: number,
|
||||
notes: number,
|
||||
nps: number,
|
||||
obstacles: number,
|
||||
offset: number,
|
||||
paritySummary: BsvMapParitySummary,
|
||||
seconds: number,
|
||||
stars: number
|
||||
bombs: number;
|
||||
characteristic: BsvMapCharacteristic;
|
||||
chroma: boolean;
|
||||
cinema: boolean;
|
||||
difficulty: BsvMapDifficultyType;
|
||||
events: number;
|
||||
length: number;
|
||||
maxScore: number;
|
||||
me: boolean;
|
||||
ne: boolean;
|
||||
njs: number;
|
||||
notes: number;
|
||||
nps: number;
|
||||
obstacles: number;
|
||||
offset: number;
|
||||
paritySummary: BsvMapParitySummary;
|
||||
seconds: number;
|
||||
stars: number;
|
||||
}
|
||||
|
||||
export interface BsvMapParitySummary {
|
||||
errors: number,
|
||||
resets: number,
|
||||
warns: number,
|
||||
errors: number;
|
||||
resets: number;
|
||||
warns: number;
|
||||
}
|
||||
|
||||
export type BsvMapCharacteristic = ("Standard" | "OneSaber" | "NoArrows" | "90Degree" | "360Degree" | "Lightshow" | "Lawless")
|
||||
export type BsvMapDifficultyType = ("Easy" | "Normal" | "Hard" | "Expert" | "ExpertPlus")
|
||||
export type BsvMapCharacteristic = "Standard" | "OneSaber" | "NoArrows" | "90Degree" | "360Degree" | "Lightshow" | "Lawless";
|
||||
export type BsvMapDifficultyType = "Easy" | "Normal" | "Hard" | "Expert" | "ExpertPlus";
|
||||
|
||||
export type MapStyle = ("dance" | "swing" | "nightcore" | "folk" | "family" | "ambient" | "funk" | "jazz" | "soul" | "speedcore" | "punk" | "rb" | "holiday" | "vocaloid" | "jrock" | "trance" | "drumbass" | "comedy" | "instrumental" | "hardcore" | "kpop" | "indie" | "techno" | "house" | "game" | "film" | "alt" | "dubstep" | "metal" | "anime" | "hiphop" | "jpop" | "rock" | "pop" | "electronic" | "classical-orchestral")
|
||||
export type MapType = ("accuracy" | "balanced" | "challenge" | "dancestyle" | "fitness" | "speed" | "tech")
|
||||
export type MapTag = MapStyle | MapType
|
||||
export type MapStyle = "dance" | "swing" | "nightcore" | "folk" | "family" | "ambient" | "funk" | "jazz" | "soul" | "speedcore" | "punk" | "rb" | "holiday" | "vocaloid" | "jrock" | "trance" | "drumbass" | "comedy" | "instrumental" | "hardcore" | "kpop" | "indie" | "techno" | "house" | "game" | "film" | "alt" | "dubstep" | "metal" | "anime" | "hiphop" | "jpop" | "rock" | "pop" | "electronic" | "classical-orchestral";
|
||||
export type MapType = "accuracy" | "balanced" | "challenge" | "dancestyle" | "fitness" | "speed" | "tech";
|
||||
export type MapTag = MapStyle | MapType;
|
||||
|
||||
export type MapRequirement = ("chroma" | "noodle" | "me" | "cinema")
|
||||
export type MapSpecificity = ("automapper" | "ranked" | "curated" | "verified" | "fullSpread")
|
||||
export type MapRequirement = "chroma" | "noodle" | "me" | "cinema";
|
||||
export type MapSpecificity = "automapper" | "ranked" | "curated" | "verified" | "fullSpread";
|
||||
|
||||
export interface MapFilter {
|
||||
automapper?: boolean,
|
||||
chroma?: boolean,
|
||||
cinema?: boolean,
|
||||
noodle?: boolean,
|
||||
me?: boolean,
|
||||
curated?: boolean,
|
||||
verified?: boolean,
|
||||
from?: number,
|
||||
to?: number,
|
||||
fullSpread?: boolean,
|
||||
ranked?: boolean,
|
||||
minDuration?: number,
|
||||
maxDuration?: number,
|
||||
minNps?: number,
|
||||
maxNps?: number,
|
||||
enabledTags?: Set<MapTag>,
|
||||
excludedTags?: Set<MapTag>
|
||||
automapper?: boolean;
|
||||
chroma?: boolean;
|
||||
cinema?: boolean;
|
||||
noodle?: boolean;
|
||||
me?: boolean;
|
||||
curated?: boolean;
|
||||
verified?: boolean;
|
||||
from?: number;
|
||||
to?: number;
|
||||
fullSpread?: boolean;
|
||||
ranked?: boolean;
|
||||
minDuration?: number;
|
||||
maxDuration?: number;
|
||||
minNps?: number;
|
||||
maxNps?: number;
|
||||
enabledTags?: Set<MapTag>;
|
||||
excludedTags?: Set<MapTag>;
|
||||
}
|
||||
|
||||
export interface SearchResponse {
|
||||
docs: BsvMapDetail[],
|
||||
redirect: string
|
||||
docs: BsvMapDetail[];
|
||||
redirect: string;
|
||||
}
|
||||
|
||||
export interface SearchParams {
|
||||
sortOrder: SearchOrder,
|
||||
filter?: MapFilter,
|
||||
page?: number,
|
||||
q?: string,
|
||||
includeEmpty?: boolean
|
||||
sortOrder: SearchOrder;
|
||||
filter?: MapFilter;
|
||||
page?: number;
|
||||
q?: string;
|
||||
includeEmpty?: boolean;
|
||||
}
|
||||
|
||||
export type SearchOrder = "Latest"|"Relevance"|"Rating"|"Curated";
|
||||
export type SearchOrder = "Latest" | "Relevance" | "Rating" | "Curated";
|
||||
|
||||
export interface BsvMapDetailWithOrder {
|
||||
map: BsvMapDetail,
|
||||
order: number
|
||||
map: BsvMapDetail;
|
||||
order: number;
|
||||
}
|
||||
|
||||
export interface BsvPlaylist {
|
||||
createdAt: BsvInstant,
|
||||
curatedAt: BsvInstant,
|
||||
curator: BsvUserDetail,
|
||||
deletedAt: BsvInstant,
|
||||
description: string,
|
||||
downloadURL: string,
|
||||
name: string,
|
||||
owner: BsvUserDetail,
|
||||
playlistId: number,
|
||||
playlistImage: string,
|
||||
playlistImage512: string,
|
||||
public: boolean,
|
||||
songsChangedAt: BsvInstant,
|
||||
stats: BsvPlaylistStats,
|
||||
updatedAt: BsvInstant,
|
||||
createdAt: BsvInstant;
|
||||
curatedAt: BsvInstant;
|
||||
curator: BsvUserDetail;
|
||||
deletedAt: BsvInstant;
|
||||
description: string;
|
||||
downloadURL: string;
|
||||
name: string;
|
||||
owner: BsvUserDetail;
|
||||
playlistId: number;
|
||||
playlistImage: string;
|
||||
playlistImage512: string;
|
||||
public: boolean;
|
||||
songsChangedAt: BsvInstant;
|
||||
stats: BsvPlaylistStats;
|
||||
updatedAt: BsvInstant;
|
||||
}
|
||||
|
||||
export interface BsvPlaylistStats {
|
||||
avgScore: number,
|
||||
downVotes: number,
|
||||
mapperCount: number,
|
||||
maxNps: number,
|
||||
maxNpsTwoDP: number,
|
||||
minNps: number,
|
||||
minNpsTwoDP: number,
|
||||
scoreOneDP: number,
|
||||
totalDuration: number,
|
||||
totalMaps: number,
|
||||
upVotes: number
|
||||
avgScore: number;
|
||||
downVotes: number;
|
||||
mapperCount: number;
|
||||
maxNps: number;
|
||||
maxNpsTwoDP: number;
|
||||
minNps: number;
|
||||
minNpsTwoDP: number;
|
||||
scoreOneDP: number;
|
||||
totalDuration: number;
|
||||
totalMaps: number;
|
||||
upVotes: number;
|
||||
}
|
||||
|
||||
export interface BsvPlaylistPage {
|
||||
maps: BsvMapDetailWithOrder[],
|
||||
playlist: BsvPlaylist
|
||||
maps: BsvMapDetailWithOrder[];
|
||||
playlist: BsvPlaylist;
|
||||
}
|
||||
|
||||
@@ -2,21 +2,21 @@ import { BsvMapDetail } from "./beat-saver.model";
|
||||
import { RawMapInfoData } from "./raw-map.model";
|
||||
|
||||
export interface BsmLocalMap {
|
||||
hash: string,
|
||||
coverUrl: string,
|
||||
songUrl: string,
|
||||
rawInfo: RawMapInfoData,
|
||||
bsaverInfo?: BsvMapDetail
|
||||
path: string
|
||||
hash: string;
|
||||
coverUrl: string;
|
||||
songUrl: string;
|
||||
rawInfo: RawMapInfoData;
|
||||
bsaverInfo?: BsvMapDetail;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface BsmLocalMapsProgress {
|
||||
total: number,
|
||||
loaded: number,
|
||||
maps: BsmLocalMap[],
|
||||
total: number;
|
||||
loaded: number;
|
||||
maps: BsmLocalMap[];
|
||||
}
|
||||
|
||||
export interface DeleteMapsProgress {
|
||||
total: number,
|
||||
deleted: number
|
||||
}
|
||||
total: number;
|
||||
deleted: number;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
export { RawMapInfoData, RawMapDifficulty, RawDifficultySet } from "./raw-map.model";
|
||||
|
||||
export {
|
||||
BsvInstant,
|
||||
BsvMapDetail,
|
||||
BsvMapDetailMetadata,
|
||||
BsvMapDifficulty,
|
||||
BsvMapParitySummary,
|
||||
BsvMapStats,
|
||||
BsvMapTestplay,
|
||||
BsvMapVersion,
|
||||
BsvUserDetail
|
||||
} from "./beat-saver.model";
|
||||
export { BsvInstant, BsvMapDetail, BsvMapDetailMetadata, BsvMapDifficulty, BsvMapParitySummary, BsvMapStats, BsvMapTestplay, BsvMapVersion, BsvUserDetail } from "./beat-saver.model";
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
import { BsvMapCharacteristic, BsvMapDifficultyType } from "./beat-saver.model"
|
||||
import { BsvMapCharacteristic, BsvMapDifficultyType } from "./beat-saver.model";
|
||||
|
||||
export interface RawMapInfoData<T = unknown> {
|
||||
_version: string,
|
||||
_songName: string,
|
||||
_songSubName: string,
|
||||
_songAuthorName: string,
|
||||
_levelAuthorName: string,
|
||||
_beatsPerMinute: number,
|
||||
_shuffle: number,
|
||||
_shufflePeriod: number,
|
||||
_previewStartTime: number,
|
||||
_previewDuration: number,
|
||||
_songFilename: string,
|
||||
_coverImageFilename: string,
|
||||
_environmentName: string,
|
||||
_allDirectionsEnvironmentName: string,
|
||||
_songTimeOffset: number,
|
||||
_customData: T,
|
||||
_difficultyBeatmapSets: RawDifficultySet[]
|
||||
_version: string;
|
||||
_songName: string;
|
||||
_songSubName: string;
|
||||
_songAuthorName: string;
|
||||
_levelAuthorName: string;
|
||||
_beatsPerMinute: number;
|
||||
_shuffle: number;
|
||||
_shufflePeriod: number;
|
||||
_previewStartTime: number;
|
||||
_previewDuration: number;
|
||||
_songFilename: string;
|
||||
_coverImageFilename: string;
|
||||
_environmentName: string;
|
||||
_allDirectionsEnvironmentName: string;
|
||||
_songTimeOffset: number;
|
||||
_customData: T;
|
||||
_difficultyBeatmapSets: RawDifficultySet[];
|
||||
}
|
||||
|
||||
export interface RawDifficultySet {
|
||||
_beatmapCharacteristicName: BsvMapCharacteristic,
|
||||
_difficultyBeatmaps: RawMapDifficulty[]
|
||||
_beatmapCharacteristicName: BsvMapCharacteristic;
|
||||
_difficultyBeatmaps: RawMapDifficulty[];
|
||||
}
|
||||
|
||||
export interface RawMapDifficulty {
|
||||
_difficulty: BsvMapDifficultyType,
|
||||
_difficultyRank: string,
|
||||
_beatmapFilename: string,
|
||||
_noteJumpMovementSpeed: number,
|
||||
_noteJumpStartBeatOffset: number,
|
||||
_customData?: RawMapDifficultyCustomData
|
||||
_difficulty: BsvMapDifficultyType;
|
||||
_difficultyRank: string;
|
||||
_beatmapFilename: string;
|
||||
_noteJumpMovementSpeed: number;
|
||||
_noteJumpStartBeatOffset: number;
|
||||
_customData?: RawMapDifficultyCustomData;
|
||||
}
|
||||
|
||||
export interface RawMapDifficultyCustomData {
|
||||
_difficultyLabel?: string
|
||||
}
|
||||
_difficultyLabel?: string;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { MSModel, MSModelType } from "./model-saber.model";
|
||||
|
||||
export interface BsmLocalModel{
|
||||
export interface BsmLocalModel {
|
||||
readonly path: string;
|
||||
readonly fileName: string;
|
||||
readonly hash: string;
|
||||
readonly type: MSModelType;
|
||||
readonly model?: MSModel
|
||||
readonly model?: MSModel;
|
||||
readonly version?: BSVersion;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,24 +6,24 @@ export const MODEL_TYPE_FOLDERS = {
|
||||
[MSModelType.Avatar]: "CustomAvatars",
|
||||
[MSModelType.Bloq]: "CustomNotes",
|
||||
[MSModelType.Platfrom]: "CustomPlatforms",
|
||||
[MSModelType.Saber]: "CustomSabers"
|
||||
}
|
||||
[MSModelType.Saber]: "CustomSabers",
|
||||
};
|
||||
|
||||
export const MODELS_TYPE_MS_PAGE_ROOT = {
|
||||
[MSModelType.Avatar]: "Avatars",
|
||||
[MSModelType.Bloq]: "Bloqs",
|
||||
[MSModelType.Platfrom]: "Platforms",
|
||||
[MSModelType.Saber]: "Sabers"
|
||||
}
|
||||
[MSModelType.Saber]: "Sabers",
|
||||
};
|
||||
|
||||
export const MODEL_FILE_EXTENSIONS = {
|
||||
[MSModelType.Avatar]: ".avatar",
|
||||
[MSModelType.Bloq]: ".bloq",
|
||||
[MSModelType.Platfrom]: ".plat",
|
||||
[MSModelType.Saber]: ".saber"
|
||||
}
|
||||
[MSModelType.Saber]: ".saber",
|
||||
};
|
||||
|
||||
export const MODEL_TYPES = Array.from(Object.values(MSModelType));
|
||||
export const MS_GET_QUERY_SORTS = Array.from(Object.values(MSGetSort));
|
||||
|
||||
export const MS_QUERY_FILTER_TYPES = Array.from(Object.values(MSGetQueryFilterType));
|
||||
export const MS_QUERY_FILTER_TYPES = Array.from(Object.values(MSGetQueryFilterType));
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
export interface MSModel {
|
||||
tags: string[],
|
||||
type: MSModelType,
|
||||
name: string,
|
||||
author: string,
|
||||
thumbnail: string,
|
||||
id: number,
|
||||
hash: string,
|
||||
bsaber: string,
|
||||
status: string,
|
||||
discordid: string,
|
||||
discord?: string,
|
||||
variationid?: number,
|
||||
platform: MSModelPlatform,
|
||||
download: string,
|
||||
install_link: string,
|
||||
date: string
|
||||
tags: string[];
|
||||
type: MSModelType;
|
||||
name: string;
|
||||
author: string;
|
||||
thumbnail: string;
|
||||
id: number;
|
||||
hash: string;
|
||||
bsaber: string;
|
||||
status: string;
|
||||
discordid: string;
|
||||
discord?: string;
|
||||
variationid?: number;
|
||||
platform: MSModelPlatform;
|
||||
download: string;
|
||||
install_link: string;
|
||||
date: string;
|
||||
}
|
||||
|
||||
export enum MSModelType {
|
||||
Avatar = "avatar",
|
||||
Saber = "saber",
|
||||
Platfrom = "platform",
|
||||
Bloq = "bloq"
|
||||
};
|
||||
Bloq = "bloq",
|
||||
}
|
||||
|
||||
export enum MSModelPlatform {
|
||||
PC = "pc",
|
||||
QUEST = "quest",
|
||||
ALL = "all"
|
||||
};
|
||||
ALL = "all",
|
||||
}
|
||||
|
||||
export interface MSGetQuery {
|
||||
type?: MSModelType;
|
||||
platform?: MSModelPlatform,
|
||||
start?: number,
|
||||
end?: number,
|
||||
sort?: MSGetSort,
|
||||
sortDirection?: MSGetSortDirection,
|
||||
filter?: MSGetQueryFilter[]
|
||||
platform?: MSModelPlatform;
|
||||
start?: number;
|
||||
end?: number;
|
||||
sort?: MSGetSort;
|
||||
sortDirection?: MSGetSortDirection;
|
||||
filter?: MSGetQueryFilter[];
|
||||
}
|
||||
|
||||
export interface MSGetQueryFilter {
|
||||
type:MSGetQueryFilterType,
|
||||
value: string|number,
|
||||
isNegative?: boolean
|
||||
type: MSGetQueryFilterType;
|
||||
value: string | number;
|
||||
isNegative?: boolean;
|
||||
}
|
||||
|
||||
export type MSGetResponse<T extends string = string> = Record<T, MSModel>;
|
||||
@@ -51,11 +51,11 @@ export type MSGetResponse<T extends string = string> = Record<T, MSModel>;
|
||||
export enum MSGetSort {
|
||||
Date = "date",
|
||||
Name = "name",
|
||||
Author = "author"
|
||||
Author = "author",
|
||||
}
|
||||
export enum MSGetSortDirection {
|
||||
Ascending = "asc",
|
||||
Descending = "desc"
|
||||
Descending = "desc",
|
||||
}
|
||||
|
||||
export enum MSGetQueryFilterType {
|
||||
@@ -65,6 +65,5 @@ export enum MSGetQueryFilterType {
|
||||
Hash = "hash",
|
||||
DiscordID = "discordid",
|
||||
ID = "id",
|
||||
SearchName = "searchName"
|
||||
SearchName = "searchName",
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { ModInstallProgression, InstallModsResult, UninstallModsResult } from "./mod-ipc.model"
|
||||
export { Mod, DownloadLink, DownloadLinkType, FileHashes, ModAuthor } from "./mod.interface"
|
||||
export { ModInstallProgression, InstallModsResult, UninstallModsResult } from "./mod-ipc.model";
|
||||
export { Mod, DownloadLink, DownloadLinkType, FileHashes, ModAuthor } from "./mod.interface";
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
export interface ModInstallProgression{
|
||||
name: string,
|
||||
progression: number
|
||||
export interface ModInstallProgression {
|
||||
name: string;
|
||||
progression: number;
|
||||
}
|
||||
|
||||
export interface InstallModsResult {
|
||||
nbModsToInstall: number,
|
||||
nbInstalledMods: number
|
||||
nbModsToInstall: number;
|
||||
nbInstalledMods: number;
|
||||
}
|
||||
|
||||
export interface UninstallModsResult {
|
||||
nbModsToUninstall: number,
|
||||
nbUninstalledMods: number
|
||||
}
|
||||
nbModsToUninstall: number;
|
||||
nbUninstalledMods: number;
|
||||
}
|
||||
|
||||
@@ -1,37 +1,36 @@
|
||||
export interface Mod {
|
||||
_id: string,
|
||||
name: string,
|
||||
version: string,
|
||||
gameVersion: string,
|
||||
authorId: string,
|
||||
uploadedDate: string,
|
||||
updatedDate: string,
|
||||
author: ModAuthor,
|
||||
description: string,
|
||||
link: string,
|
||||
category: string,
|
||||
downloads: DownloadLink[],
|
||||
required: boolean,
|
||||
dependencies: Mod[],
|
||||
status: string
|
||||
|
||||
_id: string;
|
||||
name: string;
|
||||
version: string;
|
||||
gameVersion: string;
|
||||
authorId: string;
|
||||
uploadedDate: string;
|
||||
updatedDate: string;
|
||||
author: ModAuthor;
|
||||
description: string;
|
||||
link: string;
|
||||
category: string;
|
||||
downloads: DownloadLink[];
|
||||
required: boolean;
|
||||
dependencies: Mod[];
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface ModAuthor {
|
||||
_id: string,
|
||||
username: string,
|
||||
lastLogin: string,
|
||||
_id: string;
|
||||
username: string;
|
||||
lastLogin: string;
|
||||
}
|
||||
|
||||
export interface DownloadLink {
|
||||
type: DownloadLinkType,
|
||||
url: string,
|
||||
hashMd5: FileHashes[]
|
||||
type: DownloadLinkType;
|
||||
url: string;
|
||||
hashMd5: FileHashes[];
|
||||
}
|
||||
|
||||
export type DownloadLinkType = "universal"|"steam"|"oculus";
|
||||
export type DownloadLinkType = "universal" | "steam" | "oculus";
|
||||
|
||||
export interface FileHashes {
|
||||
hash: string,
|
||||
file: string
|
||||
}
|
||||
hash: string;
|
||||
file: string;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export interface Notification {
|
||||
title: string,
|
||||
type?: NotificationType
|
||||
desc?: string,
|
||||
actions?: NotificationAction[],
|
||||
duration?: number,
|
||||
title: string;
|
||||
type?: NotificationType;
|
||||
desc?: string;
|
||||
actions?: NotificationAction[];
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
export enum NotificationType {
|
||||
@@ -14,12 +14,12 @@ export enum NotificationType {
|
||||
}
|
||||
|
||||
export interface NotificationAction {
|
||||
id: string,
|
||||
title: string,
|
||||
cancel?: boolean
|
||||
id: string;
|
||||
title: string;
|
||||
cancel?: boolean;
|
||||
}
|
||||
|
||||
export enum NotificationResult {
|
||||
NO_CHOICE = "no_choice",
|
||||
CLOSE = "close",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface SystemNotificationOptions {
|
||||
title?: string,
|
||||
body?: string
|
||||
}
|
||||
title?: string;
|
||||
body?: string;
|
||||
}
|
||||
|
||||
@@ -1,44 +1,49 @@
|
||||
export class Optionnal<T = unknown>{
|
||||
|
||||
export class Optionnal<T = unknown> {
|
||||
private static readonly EMPTY = new Optionnal<null>(null);
|
||||
|
||||
public static empty(): Optionnal<null>{
|
||||
public static empty(): Optionnal<null> {
|
||||
return Optionnal.EMPTY;
|
||||
}
|
||||
|
||||
public static of<T>(value: T): Optionnal<T>{
|
||||
if(value == null){
|
||||
public static of<T>(value: T): Optionnal<T> {
|
||||
if (value == null) {
|
||||
throw new Error("Value cannot be null");
|
||||
}
|
||||
return new Optionnal<T>(value);
|
||||
}
|
||||
|
||||
public static ofNullable<T>(value: T): Optionnal<T>{
|
||||
public static ofNullable<T>(value: T): Optionnal<T> {
|
||||
return value == null ? Optionnal.empty() : new Optionnal<T>(value);
|
||||
}
|
||||
|
||||
private readonly value: T;
|
||||
|
||||
constructor(value: T){
|
||||
constructor(value: T) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public get(): T{
|
||||
if(this.isEmpty()){
|
||||
public get(): T {
|
||||
if (this.isEmpty()) {
|
||||
throw new Error("No value present");
|
||||
}
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public isPresent(): boolean{ return this.value != null; }
|
||||
public isEmpty(): boolean{ return this.value == null; }
|
||||
public isPresent(): boolean {
|
||||
return this.value != null;
|
||||
}
|
||||
public isEmpty(): boolean {
|
||||
return this.value == null;
|
||||
}
|
||||
|
||||
public map<U>(mapper: (value: T) => U): Optionnal<U>{
|
||||
if(this.isEmpty()){ return Optionnal.empty(); }
|
||||
public map<U>(mapper: (value: T) => U): Optionnal<U> {
|
||||
if (this.isEmpty()) {
|
||||
return Optionnal.empty();
|
||||
}
|
||||
return Optionnal.ofNullable(mapper(this.value));
|
||||
}
|
||||
|
||||
public orElse(other: T): T{
|
||||
public orElse(other: T): T {
|
||||
return this.isEmpty() ? other : this.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface OpenSaveDialogOption {
|
||||
filename?: string,
|
||||
filters?: Electron.FileFilter[]
|
||||
}
|
||||
filename?: string;
|
||||
filters?: Electron.FileFilter[];
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
import { BsvMapDetail } from "../maps"
|
||||
import { BsvMapDetail } from "../maps";
|
||||
|
||||
export interface BPList {
|
||||
playlistTitle: string,
|
||||
playlistAuthor: string,
|
||||
playlistDescription?: string,
|
||||
image: string,
|
||||
customData: unknown,
|
||||
songs: PlaylistSong[]
|
||||
playlistTitle: string;
|
||||
playlistAuthor: string;
|
||||
playlistDescription?: string;
|
||||
image: string;
|
||||
customData: unknown;
|
||||
songs: PlaylistSong[];
|
||||
}
|
||||
|
||||
export interface PlaylistSong {
|
||||
key: string,
|
||||
hash: string,
|
||||
songName: string,
|
||||
uploader?: string
|
||||
key: string;
|
||||
hash: string;
|
||||
songName: string;
|
||||
uploader?: string;
|
||||
}
|
||||
|
||||
export interface DownloadPlaylistProgression {
|
||||
mapsPath: string[],
|
||||
downloadedMaps: BsvMapDetail[],
|
||||
bpListPath: string,
|
||||
current: BsvMapDetail,
|
||||
progression: number
|
||||
}
|
||||
mapsPath: string[];
|
||||
downloadedMaps: BsvMapDetail[];
|
||||
bpListPath: string;
|
||||
current: BsvMapDetail;
|
||||
progression: number;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export { ProgressionInterface } from "./progress-bar.model"
|
||||
export { ProgressionInterface } from "./progress-bar.model";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface ProgressionInterface {
|
||||
progression: number,
|
||||
label?: string
|
||||
};
|
||||
progression: number;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export interface Service<T> {
|
||||
getInstance: () => T;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { SupporterType } from "./supporter.type";
|
||||
export { Supporter } from "./supporter.interface";
|
||||
export { Supporter } from "./supporter.interface";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { SupporterType } from "./supporter.type";
|
||||
|
||||
export interface Supporter {
|
||||
username: string,
|
||||
type?: SupporterType,
|
||||
link?: string,
|
||||
img?: string,
|
||||
}
|
||||
username: string;
|
||||
type?: SupporterType;
|
||||
link?: string;
|
||||
img?: string;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export type SupporterType = "gold"|"diamond"|"sponsor"
|
||||
export type SupporterType = "gold" | "diamond" | "sponsor";
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
export type AppWindow = (
|
||||
"index.html" |
|
||||
"launcher.html" |
|
||||
"oneclick-download-map.html"|
|
||||
"oneclick-download-playlist.html"|
|
||||
"oneclick-download-model.html"
|
||||
);
|
||||
export type AppWindow = "index.html" | "launcher.html" | "oneclick-download-map.html" | "oneclick-download-playlist.html" | "oneclick-download-model.html";
|
||||
|
||||
Reference in New Issue
Block a user