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. * 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) { constructor(name: string) {
this.name = source_name; this.name = name;
} }
/** /**
@ -56,10 +56,7 @@ export class SourceAPI {
* into the current page as you wish. * into the current page as you wish.
*/ */
createPlayer(): RufflePlayer { createPlayer(): RufflePlayer {
const player_element_name = register_element( const name = register_element("ruffle-player", RufflePlayer);
"ruffle-player", return <RufflePlayer>document.createElement(name);
RufflePlayer
);
return <RufflePlayer>document.createElement(player_element_name);
} }
} }