Made interface that represents file on CurseForge

This commit is contained in:
Kir_Antipov 2023-04-08 12:23:01 +00:00
parent 3b9f28eb3a
commit 5358309a4e

View file

@ -0,0 +1,59 @@
import { FileInfo } from "@/utils/io";
import { CurseForgeVersionInit } from "./curseforge-version";
/**
* Represents a file uploaded to a project on CurseForge.
*/
export interface CurseForgeFile {
/**
* The unique identifier for the file.
*/
id: number;
/**
* The display name of the file.
*/
name: string;
/**
* The URL to download the file.
*/
url: string;
/**
* The unique identifier for the project that the file belongs to.
*/
project_id: number;
/**
* The unique identifier for the version that the file belongs to.
*/
version_id: number;
}
/**
* Represents the information required to initialize a CurseForge version file.
*/
export interface CurseForgeFileInit {
/**
* The CurseForge version initialization data.
*/
version: CurseForgeVersionInit;
/**
* The file path or `FileInfo` object for the file to be uploaded.
*/
file: string | FileInfo;
/**
* A 2D array containing variants of supported game version IDs.
*/
game_versions: number[][];
/**
* The parent CurseForge version, if any.
*
* If this field is not specified, the file will be treated as a standalone version.
*/
version_id?: number;
}