@@ -5,19 +5,18 @@ import type {
55 VerifySystemSavedataRequest ,
66 VerifySystemSavedataResponse ,
77} from "#types/api-types" ;
8+ import type { SystemSaveData } from "#types/system-data" ;
89
9- /**
10- * A wrapper for system savedata API requests.
11- */
10+ /** A wrapper for system savedata API requests. */
1211export class SystemSavedataApi extends ApiBase {
1312 //#region Public
1413
1514 /**
16- * Get a system savedata.
17- * @param params The {@linkcode GetSystemSavedataRequest} to send
18- * @returns The system savedata as `string` or `null` on error
15+ * Get the system savedata.
16+ * @param params - The {@linkcode GetSystemSavedataRequest} to send
17+ * @returns The system savedata as `string`, or `null` on error
1918 */
20- public async get ( params : GetSystemSavedataRequest ) {
19+ public async get ( params : GetSystemSavedataRequest ) : Promise < string | null > {
2120 try {
2221 const urlSearchParams = this . toUrlSearchParams ( params ) ;
2322 const response = await this . doGet ( `/savedata/system/get?${ urlSearchParams } ` ) ;
@@ -32,13 +31,12 @@ export class SystemSavedataApi extends ApiBase {
3231
3332 /**
3433 * Verify if the session is valid.
35- * If not the { @linkcode SystemSaveData} is returned.
36- * @param params The {@linkcode VerifySystemSavedataRequest} to send
34+ * If not, the ` SystemSaveData` is returned.
35+ * @param params - The {@linkcode VerifySystemSavedataRequest} to send
3736 * @returns A {@linkcode SystemSaveData} if **NOT** valid, otherwise `null`.
38- *
39- * TODO: add handling for errors
4037 */
41- public async verify ( params : VerifySystemSavedataRequest ) {
38+ // TODO: add handling for errors
39+ public async verify ( params : VerifySystemSavedataRequest ) : Promise < SystemSaveData | null > {
4240 const urlSearchParams = this . toUrlSearchParams ( params ) ;
4341 const response = await this . doGet ( `/savedata/system/verify?${ urlSearchParams } ` ) ;
4442
@@ -57,12 +55,12 @@ export class SystemSavedataApi extends ApiBase {
5755 }
5856
5957 /**
60- * Update a system savedata.
61- * @param params The {@linkcode UpdateSystemSavedataRequest} to send
62- * @param rawSystemData The raw {@linkcode SystemSaveData}
58+ * Update the system savedata.
59+ * @param params - The {@linkcode UpdateSystemSavedataRequest} to send
60+ * @param rawSystemData - The raw {@linkcode SystemSaveData}
6361 * @returns An error message if something went wrong
6462 */
65- public async update ( params : UpdateSystemSavedataRequest , rawSystemData : string ) {
63+ public async update ( params : UpdateSystemSavedataRequest , rawSystemData : string ) : Promise < string > {
6664 try {
6765 const urSearchParams = this . toUrlSearchParams ( params ) ;
6866 const response = await this . doPost ( `/savedata/system/update?${ urSearchParams } ` , rawSystemData ) ;
@@ -74,4 +72,6 @@ export class SystemSavedataApi extends ApiBase {
7472
7573 return "Unknown Error" ;
7674 }
75+
76+ //#endregion
7777}
0 commit comments