Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more detailed functionality to vino/wiiu APIs. #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
405 changes: 246 additions & 159 deletions wiiu/vino/vino.ts

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions wiiu/wiiuBOSS/boss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export default interface WiiUBOSSAPI {

/**
* Unknown. Registers a BOSS task?
* @param unk - Unknown
* @returns Unknown. Triggers no network requests. Only ever returns error code 111-4000
* @param languageCode - Result from wiiuSystemSetting.getLanguage().code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did this come from? This doesn't make much sense in this context. Also like the previous points, the parameter docs should be for types, descriptions, and values

* @returns Empty object if success, else returns an error object.
*/
registerBossTask: (unk: string) => {
registerBossTask: (languageCode: string) => {
error?: {
code: number;
}
Expand All @@ -32,7 +32,9 @@ export default interface WiiUBOSSAPI {
*
* @returns Unknown
*/
isRegisteredDirectMessageTask: () => Record<any, any>;
isRegisteredDirectMessageTask: () => {
isRegistered: boolean;
};

/**
* Unknown. Registers the DM BOSS task?
Expand All @@ -45,16 +47,16 @@ export default interface WiiUBOSSAPI {
registerDirectMessageTask: () => Record<any, any>;

/**
* Unknown. Registers the DM BOSS task with extra data?
* Registers the DM BOSS task with an lifetime and interval
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"an" is not grammatically correct here

* @remark
*
* Only present in Miiverse
*
* @param unk1 - Unknown
* @param unk2 - Unknown
* @returns Unknown
* @param lifetime - Lifetime of the request
* @param interval - Interval of the request
Comment on lines +55 to +56
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did this come from? "Lifetime of the request" doesn't seem to make much sense in this context, I've never seen anything in the BOSS module which handles the lifetime of a specific request

* @returns Empty object if success, else returns an error object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is an "error object" in this context?

*/
registerDirectMessageTaskEx: (unk1: number, unk2: number) => Record<any, any>;
registerDirectMessageTaskEx: (lifetime: number, interval: number) => Record<any, any>;

/**
* Unknown. Unregisters the DM BOSS task?
Expand All @@ -65,4 +67,4 @@ export default interface WiiUBOSSAPI {
* @returns Unknown
*/
unregisterDirectMessageTask: () => Record<any, any>;
}
}
20 changes: 10 additions & 10 deletions wiiu/wiiuBrowser/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export default interface WiiUBrowserAPI {
*
* Only seen in Miiverse?
*
* @param unk - Unknown. Link?
* @param query - eShop query format (version=1.0.0&scene=detail&dst_title_id=ID_HERE&src_title_id=ID_HERE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Examples should not be used in the parameter docs. The parameter docs are for types, values, and descriptions

*/
jumpToEshop: (unk: string) => void;
jumpToEshop: (query: string) => void;

/**
* Opens TVii
Expand All @@ -63,18 +63,18 @@ export default interface WiiUBrowserAPI {
jumpToTvii: () => void;

/**
* Opens a specific title
* Opens a title with optional app params
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You say things are optional, but haven't made that clear in the parametetrs. The docs don't really mention it, and optional parameters in TypeScript are indicated via a ? suffix https://www.typescripttutorial.net/typescript-tutorial/typescript-optional-parameters/

* @remark
*
* Only seen in Miiverse?
*
* @param unk1 - Unknown
* @param unk2 - Unknown
* @param unk3 - Unknown
* @param unk4 - Unknown
* @param unk5 - Unknown
* @param tid - Application Title ID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name should be the full name

* @param flags - Spoiler flags? Miiverse JS call it like this, yet it always sets it to 1
* @param nexCommunityID - Miiverse JS calls it NEX Community ID, but its more likely the community ID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did this come from? Also the documentation should try and be as accurate as possible, if you're unsure what data is then avoid assumptions if possible

* @param appData - Post app data string
* @param postID - Post ID? Miiverse JS always sets it to empty string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the data is unknown, leave it as unknown. If you're unsure if this is a post ID or not then don't document it as such

*/
jumpToApplication: (unk1: string, unk2: number, unk3: number, unk4: string, unk5: string) => void;
jumpToApplication: (tid: string, flags: number, nexCommunityID: number, appData: string, postID: string) => void;

/**
* Tells the applet it can stop the loading screen at boot. eShop requires a boolean flag, Miiverse does not
Expand Down Expand Up @@ -159,4 +159,4 @@ export default interface WiiUBrowserAPI {
*
*/
returnToCaller: () => void;
}
}
6 changes: 3 additions & 3 deletions wiiu/wiiuCurtain/curtain.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export default interface WiiUCurtainAPI {
/**
* Unknown
* Hides the TV screen to show an screen prompting to use the Wii U GamePad (used on eShop for Credit Card settings)
*/
open: () => void;

/**
* Unknown
* Unhides the TV screen prompt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Unhides" isn't great phrasing. Should just say "closes" or something?

*/
close: () => void;
}
}
6 changes: 3 additions & 3 deletions wiiu/wiiuDialog/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export default interface WiiUDialogAPI {
confirm: (message: string, rightButton: string, leftButton: string) => boolean;

/**
* Shows the loading spinner
* Shows an loading message with a center loading spinner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This phrasing doesn't make much sense as is. It doesn't do a good job at giving a visual. Is the message in the center? Is this a standard system popup? Is the spinner slapped in the middle of the message? It's not clear what this means

* @param message - Message in dialog
*/
showLoading: (message: string) => void;

/**
* Stops the loading spinner
* Stops the loading message
*/
hideLoading: () => void;
}
}
4 changes: 2 additions & 2 deletions wiiu/wiiuKeyboard/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default interface WiiUKeyboardAPI {

/**
* Sets the keyboard language
* @param language - Keyboard language. Allowed values unknown
* @param language - Keyboard language. Result from wiiuSystemSetting.getLanguage().code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you know what the allowed values are, they should be in an enum. The parameters should only document their types, values, and descriptions. They should not dictate the source of the values. That should be left for an example script or something, which is out of scope of this repository atm. There is an @example tag in TSDoc but I'm not sure it's worth adding to these types atm

* @returns True if success?
*
* @remarks
Expand All @@ -24,4 +24,4 @@ export default interface WiiUKeyboardAPI {
* @returns Unknown
*/
setUserDictionary: (unk: string) => Record<any, any>;
}
}
4 changes: 2 additions & 2 deletions wiiu/wiiuLocalStorage/local-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default interface WiiULocalStorageAPI {
clear: () => void;

/**
* Unknown
* Flushes the localStorage elements
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make much sense. The method name is write, however typically phrases like flush tend to mean something more like "purge" or "empty" when it comes to stored data. That contradicts the method name

*/
write: () => void;
}
}
10 changes: 5 additions & 5 deletions wiiu/wiiuMainApplication/main-application.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default interface WiiUMainApplicationAPI {
/**
* Unknown
* @param unk - Unknown. Maybe a screen ID?
* @returns Unknown
* Returns a JPEG base64 screenshot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slight reword for clarity

Suggested change
* Returns a JPEG base64 screenshot
* Returns a base64 encoded JPEG screenshot of the selected screen

* @param screen - True for TV screen, False for GamePad screen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is False capitalized here? Also this sounds like it may be more of a number than a boolean now. Where did this information come from?

This might be better as an enum too tbh?

* @returns JPEG base64 screenshot
*/
getScreenShot: (unk: boolean) => string;
getScreenShot: (screen: boolean) => string;

/**
* Gets the background titles AppData
Expand All @@ -23,4 +23,4 @@ export default interface WiiUMainApplicationAPI {
* @returns Unknown
*/
getExternalBinaryData: () => string;
}
}
10 changes: 5 additions & 5 deletions wiiu/wiiuSound/sound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ export default interface WiiUSoundAPI {
/**
* Unknown. Plays a sound by an ID?
* @param unk1 - Unknown
* @param unk2 - Unknown
* @param soundDevice - 1 for GamePad, 2 for TV, 3 for both
* @returns An object. Always empty
*/
playSound: (unk1: number, unk2: number) => {};
playSound: (unk1: number, soundDevice: number) => {};

/**
* Plays the given sound
* @param label - Label for the sound
* @param unk - Unknown
* @param soundDevice - 1 for GamePad, 2 for TV, 3 for both
* @returns An object. Always empty
*
* @remark
*
* Not all labels are available in every applet. Using an unsupported label plays no sound
*/
playSoundByName: (label: SoundEffect, unk: number) => {};
playSoundByName: (label: SoundEffect, soundDevice: number) => {};
Comment on lines +62 to +77
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soundDevice should be an enum if it's limited to certain values


/**
* Unknown. Stops a sound?
Expand All @@ -86,4 +86,4 @@ export default interface WiiUSoundAPI {
* @returns An object. Always empty
*/
stopNfcSound: (unk: number) => {};
}
}