web: Fixed up documentation and return types inside SourceAPI

This commit is contained in:
Nathan Adams 2020-11-14 22:23:10 +01:00 committed by Mike Welsh
parent bc3b6ade4e
commit f869812464
1 changed files with 5 additions and 8 deletions

View File

@ -16,10 +16,10 @@ export class SourceAPI {
/**
* Construct a Source API.
*
* @param source_name The name of this particular source.
* @param name The name of this particular source.
*/
constructor(source_name: string) {
this.name = source_name;
constructor(name: string) {
this.name = name;
}
/**
@ -56,10 +56,7 @@ export class SourceAPI {
* into the current page as you wish.
*/
createPlayer(): RufflePlayer {
const player_element_name = register_element(
"ruffle-player",
RufflePlayer
);
return <RufflePlayer>document.createElement(player_element_name);
const name = register_element("ruffle-player", RufflePlayer);
return <RufflePlayer>document.createElement(name);
}
}