Delete galaxy.d.ts
This commit is contained in:
parent
0efb385118
commit
60f5d3c446
1 changed files with 0 additions and 130 deletions
130
galaxy.d.ts
vendored
130
galaxy.d.ts
vendored
|
@ -1,130 +0,0 @@
|
||||||
/**
|
|
||||||
* The supports action tells galaxy what parts of the API you interact with, and hides/shows certain elements of the player accordingly.
|
|
||||||
*/
|
|
||||||
interface SupportsAction {
|
|
||||||
action: "supports";
|
|
||||||
/** If your game auto-saves or allows the user to make/load game saves from within the UI. */
|
|
||||||
saving: boolean;
|
|
||||||
/** If your game has a complete save manager integrated into it — save deletion, export, import, labels, all save slots, etc. */
|
|
||||||
save_manager: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The save_list action sends a retrieval request to Galaxy to get the player's cloud save list which contains all the save data the player has. The actual save data then will be retrieved through the save_list response.
|
|
||||||
* @see {@link SaveListResponse}
|
|
||||||
*/
|
|
||||||
interface SaveListAction {
|
|
||||||
action: "save_list";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The save action creates a cloud save and then puts it into a certain save slot. If a save is already present in that slot, the old save will be overridden. The save result can be determined through the returning saved response.
|
|
||||||
* @see {@link SavedResponse}
|
|
||||||
*/
|
|
||||||
interface SaveAction {
|
|
||||||
action: "save";
|
|
||||||
/** The save slot number. Must be an integer between 0 and 10, inclusive. */
|
|
||||||
slot: number;
|
|
||||||
/** The optional label of the save file. It is recommended for this to be a quick summary of the player's current progress (e.g. e1,000 points, Stage 64-25, Arcana level 308). Must be 100 characters in length or fewer. */
|
|
||||||
label?: string;
|
|
||||||
/** The actual save data. Must be 256,000 characters in length or fewer. */
|
|
||||||
data: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
The load action sends a retrieval request to Galaxy to get the cloud save data inside a certain save slot. The actual save data will then be retrieved through the save_content response.
|
|
||||||
* @see {@link SaveContentResponse}
|
|
||||||
*/
|
|
||||||
interface LoadAction {
|
|
||||||
action: "load";
|
|
||||||
/** The save slot number. Must be an integer between 0 and 10, inclusive. */
|
|
||||||
slot: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The info response is first sent when the page loads, and may be sent multiple times after page load if any of the values inside change.
|
|
||||||
*/
|
|
||||||
interface InfoResponse {
|
|
||||||
type: "info";
|
|
||||||
/** Whether you're talking to Galaxy. This should always be true. */
|
|
||||||
galaxy: boolean;
|
|
||||||
/** The version of the API. Will only increment for every breaking API change. It is not a bad idea to disable your implementation if this does not match. */
|
|
||||||
api_version: number;
|
|
||||||
/** The player's theme preference. Valid values are none, light, and dark. Use this to determine the color scheme of your game on the first startup. */
|
|
||||||
theme_preference: string;
|
|
||||||
/** Whether the player is logged in. Certain features (like cloud saving) require the player to be logged into a Galaxy account in order to work. */
|
|
||||||
logged_in: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The save_list response is requested by the save_list action and contains the requested list of save data.
|
|
||||||
* @see {@link SaveListAction}
|
|
||||||
*/
|
|
||||||
interface SaveListResponse {
|
|
||||||
type: "save_list";
|
|
||||||
/** A list of saves. Each key in the object is the save slot number / save ID. Will be an empty object ({}) when {@link error} is true. */
|
|
||||||
list: Record<number, {
|
|
||||||
/** The label describing the save. */
|
|
||||||
label: string;
|
|
||||||
/** The content of the save. */
|
|
||||||
content: string;
|
|
||||||
}>;
|
|
||||||
/** Whether the action encountered an error. */
|
|
||||||
error: boolean;
|
|
||||||
/**
|
|
||||||
* Present when error is true, tells the reason why the action encountered an error.
|
|
||||||
* Valid values are:
|
|
||||||
* - "no_account": The player was logged out.
|
|
||||||
* - "server_error": The game couldn't connect to Galaxy's servers.
|
|
||||||
*/
|
|
||||||
message?: "no_account" | "server_error";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The save_content response is requested by the load action and contains information about the action's load request along with the requested save data.
|
|
||||||
* @see {@link LoadAction}
|
|
||||||
*/
|
|
||||||
interface SaveContentResponse {
|
|
||||||
type: "save_content";
|
|
||||||
/** Whether the action encountered an error. */
|
|
||||||
error: boolean;
|
|
||||||
/**
|
|
||||||
* Present when error is true, tells the reason why the action encountered an error.
|
|
||||||
* Valid values are:
|
|
||||||
* - "no_account": The player was logged out.
|
|
||||||
* - "empty_slot": The save slot is empty.
|
|
||||||
* - "invalid_slot": The slot value was invalid.
|
|
||||||
* - "server_error": The game couldn't connect to Galaxy's servers.
|
|
||||||
*/
|
|
||||||
message?: "no_account" | "empty_slot" | "invalid_slot" | "server_error";
|
|
||||||
/** The save slot number. */
|
|
||||||
slot: number;
|
|
||||||
/** The save's label, or null if error is true. */
|
|
||||||
label?: string;
|
|
||||||
/** The save's actual data, or null if error is true. */
|
|
||||||
content?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The saved response is requested by the save action and contains information about the action's save request.
|
|
||||||
* @see {@link SaveAction}
|
|
||||||
*/
|
|
||||||
interface SavedResponse {
|
|
||||||
type: "saved";
|
|
||||||
/** Whether the action encountered an error. */
|
|
||||||
error: boolean;
|
|
||||||
/** The save slot number. */
|
|
||||||
slot: number;
|
|
||||||
/**
|
|
||||||
* Present when error is true, tells the reason why the action encountered an error.
|
|
||||||
* Valid values are:
|
|
||||||
* - "too_big": The save data exceeded the 256,000 character limit
|
|
||||||
* - "no_account": The player was logged out.
|
|
||||||
* - "invalid_slot": The slot value was invalid.
|
|
||||||
* - "server_error": The game couldn't connect to Galaxy's servers.
|
|
||||||
*/
|
|
||||||
message?: "no_account" | "empty_slot" | "invalid_slot" | "server_error";
|
|
||||||
}
|
|
||||||
|
|
||||||
type GalaxyResponse = InfoResponse | SaveListResponse | SaveContentResponse | SavedResponse;
|
|
Loading…
Add table
Reference in a new issue