diff --git a/js/app.ts b/js/app.ts index f922b653..adcec005 100644 --- a/js/app.ts +++ b/js/app.ts @@ -73,6 +73,9 @@ export interface LoginPromptResult { declare const host: string; +/** + * Main class that initializes app. + */ export class App { public currentPopup: string = null; public homePage: HomePage; diff --git a/js/appInit.ts b/js/appInit.ts index 52430109..51d8716f 100644 --- a/js/appInit.ts +++ b/js/appInit.ts @@ -26,6 +26,10 @@ function isRunningStandalone() { || ("standalone" in window.navigator && window.navigator["standalone"] === true)); } +/** + * Applies app configuration + * @param localConfiguration local saved configurations + */ export function bootstrap(localConfiguration?: Partial) { overrideConfiguration(localConfiguration || {}); diff --git a/js/appconfig.ts b/js/appconfig.ts index 89112e86..0b3300c7 100644 --- a/js/appconfig.ts +++ b/js/appconfig.ts @@ -17,6 +17,7 @@ class GameActionBlock { public hasSecondaryPanel = true; } +/** Local app configurations */ export class AppConfig { public auth = { automaticLogin: true, @@ -103,6 +104,10 @@ export type PartialConfiguration = { [P in keyof T]?: Partial; }; +/** + * This function overrides local configuration + * @param localConfiguration + */ export function overrideConfiguration(localConfiguration: PartialConfiguration) { appConfig = mergeDeep(appConfig, localConfiguration); } diff --git a/js/authmanager.ts b/js/authmanager.ts index 77ab82e9..090962e2 100644 --- a/js/authmanager.ts +++ b/js/authmanager.ts @@ -59,6 +59,7 @@ export interface IAuthenticationManager { loginAsGuest(): Promise; } +/** Manager that handles authentication */ export class AuthManager implements IAuthenticationInformation, IAuthenticationManager { /** * Returns authentication status of the application user. diff --git a/js/bindings.ts b/js/bindings.ts index b7bc3fdd..4c36f5c6 100644 --- a/js/bindings.ts +++ b/js/bindings.ts @@ -14,6 +14,7 @@ import * as timeService from "./timeservice"; declare var app: App; +/** Registers knokcoutjs bindings */ export function registerBindings() { // Binding set loading variable for short amount of time. ko.bindingHandlers["loading"] = { diff --git a/js/commandmanager.ts b/js/commandmanager.ts index 9f57b27a..448933f3 100644 --- a/js/commandmanager.ts +++ b/js/commandmanager.ts @@ -19,6 +19,7 @@ export interface ICommandManager extends ICommandExecutor { registerCommand(commandName: string, handler: CommandHandler): void; } +/** Register and executes commands */ export class CommandManager implements ICommandManager { public commands: any[] = []; diff --git a/js/components/registration.ts b/js/components/registration.ts index f3d7e7a0..c4d283c9 100644 --- a/js/components/registration.ts +++ b/js/components/registration.ts @@ -28,6 +28,7 @@ function getTemplateDefinition(name: string) { return window["PokerComponents"][name]; } +/** Register knockoutjs components */ export function registerComponents() { /** * Tournament lobby sub-components diff --git a/js/components/table/actionBlock/actionBlock.ts b/js/components/table/actionBlock/actionBlock.ts index 2d965941..7e87bed3 100644 --- a/js/components/table/actionBlock/actionBlock.ts +++ b/js/components/table/actionBlock/actionBlock.ts @@ -1,5 +1,6 @@ import { ActionBlock } from "../../../table/actionBlock"; +/** Action Block Component */ export class ActionBlockComponent { private actionBlock: ActionBlock; diff --git a/js/components/table/menu/menu.ts b/js/components/table/menu/menu.ts index 01a79d93..587d2167 100644 --- a/js/components/table/menu/menu.ts +++ b/js/components/table/menu/menu.ts @@ -1,5 +1,6 @@ import { TablesPage } from "../../../pages/tablespage"; +/** Table Menu Component */ export class TableMenuComponent { private page: TablesPage; diff --git a/js/components/table/raiseBlock/raiseBlock.ts b/js/components/table/raiseBlock/raiseBlock.ts index 3ce69601..818e1866 100644 --- a/js/components/table/raiseBlock/raiseBlock.ts +++ b/js/components/table/raiseBlock/raiseBlock.ts @@ -6,6 +6,7 @@ export interface IRaiseBlockComponentParameters { updateTranslator: () => void; } +/** Raise Block Component */ export class RaiseBlockComponent { private tableSlider: TableSlider; diff --git a/js/extenders.ts b/js/extenders.ts index 8c0a65e1..dc1f030d 100644 --- a/js/extenders.ts +++ b/js/extenders.ts @@ -3,6 +3,7 @@ import * as ko from "knockout"; import { SelectorItem } from "./selector"; +/** Register knockoutjs extenders */ export function registerExtenders() { ko.extenders["options"] = (target: KnockoutObservable, option: { caption: string; items: SelectorItem[]}) => { target.options = option.items; diff --git a/js/languagemanager.ts b/js/languagemanager.ts index 2e5aec3c..59a8c39f 100644 --- a/js/languagemanager.ts +++ b/js/languagemanager.ts @@ -1,5 +1,6 @@ declare var messages: any; +/** This manager is responsible for all text operations */ export class LanguageManager { public currentLang: string; constructor() { @@ -63,6 +64,12 @@ export class LanguageManager { } export const l = new LanguageManager(); + +/** + * Returns message value for current language + * @param message name of needed message + * @param parameters (optional) dynamic values that shoud be written in message + */ export function _(message: string, parameters: any = null) { return l.getMessage(message, parameters); } diff --git a/js/pageblock.ts b/js/pageblock.ts index e6bf3c68..50014cd4 100644 --- a/js/pageblock.ts +++ b/js/pageblock.ts @@ -2,6 +2,7 @@ import * as ko from "knockout"; import { Signal } from "signals"; +/** Forms app pages */ export class PageBlock { public static useDoubleView: boolean = false; public shown: Signal; diff --git a/js/pages/SeatPage.ts b/js/pages/SeatPage.ts index a29ccb6d..879613d2 100644 --- a/js/pages/SeatPage.ts +++ b/js/pages/SeatPage.ts @@ -22,6 +22,7 @@ import { version } from "../version"; declare var app: App; +/** Seat page of the player */ export class SeatPage extends PageBase { public currentTable: KnockoutComputed; public selectedTables: KnockoutComputed; diff --git a/js/pages/accountpage.ts b/js/pages/accountpage.ts index 9fd6ff63..4e91c76c 100644 --- a/js/pages/accountpage.ts +++ b/js/pages/accountpage.ts @@ -28,6 +28,7 @@ interface AccountPagePlayerModel { stars: number; } +/** Account Page */ export class AccountPage extends PageBase { public cashierCaption: KnockoutObservable; public loading: KnockoutObservable; diff --git a/js/pages/cashierpageblock.ts b/js/pages/cashierpageblock.ts index a375603c..318f82cc 100644 --- a/js/pages/cashierpageblock.ts +++ b/js/pages/cashierpageblock.ts @@ -7,6 +7,7 @@ import { OperationsHistoryPage } from "./operationshistorypage"; import { RatingPage } from "./ratingpage"; import { WithdrawalPage } from "./withdrawalpage"; +/** Cashier Page Block */ export class CashierPageBlock extends PageBlock { public accountPage: AccountPage; public ratingPage: RatingPage; diff --git a/js/pages/changepasswordpage.ts b/js/pages/changepasswordpage.ts index 859a96ac..4b3d021b 100644 --- a/js/pages/changepasswordpage.ts +++ b/js/pages/changepasswordpage.ts @@ -1,6 +1,7 @@ import * as ko from "knockout"; import { PageBase } from "../ui/pagebase"; +/** Change Password Page */ export class ChangePasswordPage extends PageBase implements KnockoutValidationGroup { public oldpassword: KnockoutObservable; public password: KnockoutObservable; diff --git a/js/pages/chatpage.ts b/js/pages/chatpage.ts index 81913d01..2b77cd84 100644 --- a/js/pages/chatpage.ts +++ b/js/pages/chatpage.ts @@ -10,6 +10,7 @@ import * as timeService from "../timeservice"; declare var host: string; declare var app: App; +/** Chat Page */ export class ChatPage implements Page { public currentMessage: KnockoutObservable; public messages: KnockoutObservableArray; diff --git a/js/pages/homepage.ts b/js/pages/homepage.ts index d17d49b9..e8955b30 100644 --- a/js/pages/homepage.ts +++ b/js/pages/homepage.ts @@ -15,6 +15,7 @@ import { PageBase } from "../ui/pagebase"; declare var app: App; +/** Home Page */ export class HomePage extends PageBase { public online: KnockoutObservable; public registered: KnockoutObservable; diff --git a/js/pages/infopage.ts b/js/pages/infopage.ts index 596a9a85..b1d12049 100644 --- a/js/pages/infopage.ts +++ b/js/pages/infopage.ts @@ -5,6 +5,7 @@ import { PageBase } from "../ui/pagebase"; declare var app: App; +/** Info Page */ export class InfoPage extends PageBase { constructor() { super(); diff --git a/js/pages/infopageblock.ts b/js/pages/infopageblock.ts index c73da2cd..1a7ea054 100644 --- a/js/pages/infopageblock.ts +++ b/js/pages/infopageblock.ts @@ -2,6 +2,7 @@ import { InfoPage } from "./infopage"; import { SupportPage } from "./supportpage"; +/** Info Page Block */ export class InfoPageBlock extends PageBlock { constructor() { super("info", "pagesList", new InfoPage()); diff --git a/js/pages/lobbypage.ts b/js/pages/lobbypage.ts index 00c603e1..932dc267 100644 --- a/js/pages/lobbypage.ts +++ b/js/pages/lobbypage.ts @@ -21,6 +21,7 @@ import { PageBase } from "../ui/pagebase"; declare var app: App; +/** Filter options for cash table */ export class CashOptions { public currency: KnockoutObservable; public limits: KnockoutObservable; @@ -74,6 +75,7 @@ export class CashOptions { } } +/** Filter options for tournaments */ export class TournamentOptions { public currency: KnockoutObservable; public buyin: KnockoutObservable; @@ -132,6 +134,7 @@ interface LobbyTournamentItemEx extends LobbyTournamentItem { duration: string; } +/** Page for players lobby */ export class LobbyPage extends PageBase { public online: KnockoutObservable; public registered: KnockoutObservable; diff --git a/js/pages/lobbypageblock.ts b/js/pages/lobbypageblock.ts index 4f35b355..5927c916 100644 --- a/js/pages/lobbypageblock.ts +++ b/js/pages/lobbypageblock.ts @@ -9,6 +9,7 @@ import { TournamentsListPage } from "./tournamentslistpage"; declare var app: App; +/** Lobby Page Block */ export class LobbyPageBlock extends PageBlock { public sngListPage: TournamentsListPage; public tournamentsListPage: TournamentsListPage; diff --git a/js/pages/operationshistorypage.ts b/js/pages/operationshistorypage.ts index 6076e7ea..703c7882 100644 --- a/js/pages/operationshistorypage.ts +++ b/js/pages/operationshistorypage.ts @@ -7,6 +7,7 @@ import { PageBase } from "../ui/pagebase"; declare var app: App; +/** Operations History Page */ export class OperationsHistoryPage extends PageBase implements KnockoutValidationGroup { public from: KnockoutObservable; public to: KnockoutObservable; diff --git a/js/pages/otherpageblock.ts b/js/pages/otherpageblock.ts index 0a3e90e8..62242d66 100644 --- a/js/pages/otherpageblock.ts +++ b/js/pages/otherpageblock.ts @@ -7,6 +7,7 @@ import { ChatPage } from "./chatpage"; import { RatingPage } from "./ratingpage"; import { SettingsPage } from "./settingspage"; +/** Page block for changePassword, more, rating, chat and accout pages */ export class OtherPageBlock extends PageBlock { public changePasswordPage: ChangePasswordPage; public morePage: SettingsPage; diff --git a/js/pages/ratingpage.ts b/js/pages/ratingpage.ts index 644623b2..2678b602 100644 --- a/js/pages/ratingpage.ts +++ b/js/pages/ratingpage.ts @@ -3,6 +3,7 @@ import { AccountManager } from "../services/accountManager"; declare var app: App; +/** RatingPage */ export class RatingPage implements Page { public ratings = ko.observableArray(); public loading = ko.observable(false); diff --git a/js/pages/settingspage.ts b/js/pages/settingspage.ts index 1aeab2ee..7ddb5e2f 100644 --- a/js/pages/settingspage.ts +++ b/js/pages/settingspage.ts @@ -1,6 +1,7 @@ import { _ } from "../languagemanager"; import * as metadataManager from "../metadatamanager"; +/** Settings page */ export class SettingsPage implements Page { public online: KnockoutObservable; public registered: KnockoutObservable; diff --git a/js/pages/supportpage.ts b/js/pages/supportpage.ts index a62ff9fb..529a1e8c 100644 --- a/js/pages/supportpage.ts +++ b/js/pages/supportpage.ts @@ -9,6 +9,7 @@ import { PageBase } from "../ui/pagebase"; declare var host: string; declare var app: App; +/** Support page */ export class SupportPage extends PageBase implements KnockoutValidationGroup { public displayFullName = false; public displaySubject = false; diff --git a/js/pages/tableslistpage.ts b/js/pages/tableslistpage.ts index 1328718d..642c77d4 100644 --- a/js/pages/tableslistpage.ts +++ b/js/pages/tableslistpage.ts @@ -12,6 +12,7 @@ import { PageBase } from "../ui/pagebase"; declare var host: string; declare var app: App; +/** Page that displyes tables list */ export class TablesListPage extends PageBase { public tablesCaption: KnockoutComputed; public tables: KnockoutObservableArray; diff --git a/js/pages/tablespage.ts b/js/pages/tablespage.ts index e975d744..82e0457e 100644 --- a/js/pages/tablespage.ts +++ b/js/pages/tablespage.ts @@ -22,6 +22,7 @@ import { PageBase } from "../ui/pagebase"; declare var app: App; +/** Tables Page */ export class TablesPage extends PageBase implements ICurrentTableProvider { public currentTable: KnockoutComputed; public selectedTables: KnockoutComputed; diff --git a/js/pages/tournamentlobbypage.ts b/js/pages/tournamentlobbypage.ts index e5cd2b43..8a5eeea8 100644 --- a/js/pages/tournamentlobbypage.ts +++ b/js/pages/tournamentlobbypage.ts @@ -43,6 +43,7 @@ interface TournamentTableListView { players: TournamentTablePlayerView[]; } +/** Lobby page for tournaments */ export class TournamentLobbyPage extends PageBase { public loading: KnockoutObservable; public tournamentId = 0; diff --git a/js/pages/tournamentslistpage.ts b/js/pages/tournamentslistpage.ts index aa82d24f..73cad2c7 100644 --- a/js/pages/tournamentslistpage.ts +++ b/js/pages/tournamentslistpage.ts @@ -16,6 +16,7 @@ import { TournamentOptions } from "./lobbypage"; declare var app: App; +/** Page with tournaments list */ export class TournamentsListPage extends PageBase { public tournamentsCaption: KnockoutComputed; public tournaments: KnockoutObservableArray; diff --git a/js/pages/withdrawalpage.ts b/js/pages/withdrawalpage.ts index a217ed8f..a50145ac 100644 --- a/js/pages/withdrawalpage.ts +++ b/js/pages/withdrawalpage.ts @@ -6,6 +6,7 @@ import { PageBase } from "../ui/pagebase"; declare var app: App; +/** Withdrawal Page */ export class WithdrawalPage extends PageBase { public player: KnockoutObservable; public withdrawalMethods: KnockoutObservableArray; diff --git a/js/popups/accountstatuspopup.ts b/js/popups/accountstatuspopup.ts index 8b7931c0..e3865426 100644 --- a/js/popups/accountstatuspopup.ts +++ b/js/popups/accountstatuspopup.ts @@ -9,6 +9,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Account Status Popup */ export class AccountStatusPopup extends PopupBase { public loading: KnockoutObservable; public information: KnockoutObservable; diff --git a/js/popups/addmoneypopup.ts b/js/popups/addmoneypopup.ts index c262e394..c6fe2882 100644 --- a/js/popups/addmoneypopup.ts +++ b/js/popups/addmoneypopup.ts @@ -11,6 +11,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Popup for adding money */ export class AddMoneyPopup { public buyin: KnockoutObservable; public minBuyin: KnockoutObservable; diff --git a/js/popups/authpopup.ts b/js/popups/authpopup.ts index ef535823..85e2f942 100644 --- a/js/popups/authpopup.ts +++ b/js/popups/authpopup.ts @@ -9,6 +9,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Authentication popup */ export class AuthPopup extends PopupBase { public login: KnockoutObservable; public password: KnockoutObservable; diff --git a/js/popups/changepasswordpopup.ts b/js/popups/changepasswordpopup.ts index b08f4d3f..f9308b88 100644 --- a/js/popups/changepasswordpopup.ts +++ b/js/popups/changepasswordpopup.ts @@ -9,6 +9,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Popup for password change */ export class ChangePasswordPopup extends PopupBase { public oldPassword = ko.observable().extend({ required: true }); public password: KnockoutObservable; diff --git a/js/popups/chatpopup.ts b/js/popups/chatpopup.ts index 9ae53df3..f55d38d8 100644 --- a/js/popups/chatpopup.ts +++ b/js/popups/chatpopup.ts @@ -11,6 +11,7 @@ import { ChatControl } from "../ui/chatcontrol"; declare var app: App; +/** Chat popup */ export class ChatPopup { public control: ChatControl; public caption: KnockoutObservable; diff --git a/js/popups/continueforgetpasswordpopup.ts b/js/popups/continueforgetpasswordpopup.ts index 43db1a7d..e7c32cae 100644 --- a/js/popups/continueforgetpasswordpopup.ts +++ b/js/popups/continueforgetpasswordpopup.ts @@ -7,6 +7,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Continue Forget Password Popup */ export class ContinueForgetPasswordPopup extends PopupBase { public token: KnockoutObservable; public password: KnockoutObservable; diff --git a/js/popups/custompopup.ts b/js/popups/custompopup.ts index a23c34a9..6114decd 100644 --- a/js/popups/custompopup.ts +++ b/js/popups/custompopup.ts @@ -5,6 +5,7 @@ import { PopupBase } from "../ui/popupbase"; type PromiseOrVoid = void | Promise; +/** Custom Popup */ export class CustomPopup extends PopupBase { public title: KnockoutObservable; public messages: KnockoutObservableArray; diff --git a/js/popups/forgetpasswordpopup.ts b/js/popups/forgetpasswordpopup.ts index 2bf4465b..296bf621 100644 --- a/js/popups/forgetpasswordpopup.ts +++ b/js/popups/forgetpasswordpopup.ts @@ -4,6 +4,7 @@ import { SimplePopup } from "../popups/simplepopup"; import { AccountManager } from "../services/accountManager"; import { PopupBase } from "../ui/popupbase"; +/** Forget Password Popup */ export class ForgetPasswordPopup extends PopupBase { public login: KnockoutObservable; public email: KnockoutObservable; diff --git a/js/popups/handhistorypopup.ts b/js/popups/handhistorypopup.ts index 7fb60ffb..2db7d955 100644 --- a/js/popups/handhistorypopup.ts +++ b/js/popups/handhistorypopup.ts @@ -13,6 +13,7 @@ enum HandHistoryDisplayMode { Detailed, } +/** Popup for showing of previous game history */ export class HandHistoryPopup extends PopupBase { public detailedOperations: KnockoutObservableArray; public shortOperations: KnockoutObservableArray; diff --git a/js/popups/jointablepopup.ts b/js/popups/jointablepopup.ts index b1056b0d..62570e62 100644 --- a/js/popups/jointablepopup.ts +++ b/js/popups/jointablepopup.ts @@ -10,6 +10,7 @@ import { SimplePopup } from "./simplepopup"; declare var app: App; +/** Join Table Popup */ export class JoinTablePopup { public buyin: KnockoutObservable; public ticketCode: KnockoutObservable; diff --git a/js/popups/morepopup.ts b/js/popups/morepopup.ts index d96e6886..0852347c 100644 --- a/js/popups/morepopup.ts +++ b/js/popups/morepopup.ts @@ -11,6 +11,7 @@ import { settings } from "../settings"; declare var host: string; declare var app: App; +/** More Popup */ export class MorePopup { public authenticated: KnockoutObservable; public login: KnockoutComputed; diff --git a/js/popups/newspopup.ts b/js/popups/newspopup.ts index 76af4e5f..9cfc7c7d 100644 --- a/js/popups/newspopup.ts +++ b/js/popups/newspopup.ts @@ -1,6 +1,7 @@ import * as ko from "knockout"; import { PopupBase } from "../ui/popupbase"; +/** News Popup */ export class NewsPopup extends PopupBase { public link = ko.observable(); public url = ko.observable(); diff --git a/js/popups/okcancelpopup.ts b/js/popups/okcancelpopup.ts index 5b46379a..67d345e6 100644 --- a/js/popups/okcancelpopup.ts +++ b/js/popups/okcancelpopup.ts @@ -5,6 +5,7 @@ import { App } from "../app"; declare var app: App; +/** Simple popup for confirm or cancel of current operation */ export class OkCancelPopup { public title: KnockoutObservable; public messages: KnockoutObservableArray; diff --git a/js/popups/registrationpopup.ts b/js/popups/registrationpopup.ts index 39d25981..0472efcb 100644 --- a/js/popups/registrationpopup.ts +++ b/js/popups/registrationpopup.ts @@ -10,6 +10,7 @@ import { SimplePopup } from "./simplepopup"; declare var app: App; +/** Registration Popup */ export class RegistrationPopup extends PopupBase { public login: KnockoutObservable; public email: KnockoutObservable; diff --git a/js/popups/rulespopup.ts b/js/popups/rulespopup.ts index 4dbf1753..84cb409e 100644 --- a/js/popups/rulespopup.ts +++ b/js/popups/rulespopup.ts @@ -3,6 +3,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Game rues popup */ export class RulesPopup extends PopupBase { } diff --git a/js/popups/selectavatarpopup.ts b/js/popups/selectavatarpopup.ts index 9d9673ed..e1f9215f 100644 --- a/js/popups/selectavatarpopup.ts +++ b/js/popups/selectavatarpopup.ts @@ -6,6 +6,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Select Avatar Popup */ export class SelectAvatarPopup extends PopupBase { public avatars = ko.observableArray(); public selectedAvatar = ko.observable(); diff --git a/js/popups/settingspopup.ts b/js/popups/settingspopup.ts index 3d00dbf4..209b17db 100644 --- a/js/popups/settingspopup.ts +++ b/js/popups/settingspopup.ts @@ -5,6 +5,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Settings Popup */ export class SettingsPopup { public loading: KnockoutObservable; public checkedRadio: KnockoutObservable; diff --git a/js/popups/simplepopup.ts b/js/popups/simplepopup.ts index d4b9fdde..8d6556b5 100644 --- a/js/popups/simplepopup.ts +++ b/js/popups/simplepopup.ts @@ -7,6 +7,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Simple popup for confirm of current operation */ export class SimplePopup extends PopupBase { public static display(title: string, message: string | string[]): Promise { app.simplePopup.title(title); diff --git a/js/popups/slowconnectionpopup.ts b/js/popups/slowconnectionpopup.ts index b71d92aa..04295613 100644 --- a/js/popups/slowconnectionpopup.ts +++ b/js/popups/slowconnectionpopup.ts @@ -6,6 +6,7 @@ import * as runtimeSettings from "../table/runtimesettings"; import * as timeService from "../timeservice"; import { PopupBase } from "../ui/popupbase"; +/** Popup for indicating slow internet connection */ export class SlowConnectionPopup extends PopupBase { public allowRetry: KnockoutObservable; public caption: KnockoutObservable; diff --git a/js/popups/sweepstakesrulespopup.ts b/js/popups/sweepstakesrulespopup.ts index 0d6ba80d..4fd1c5a4 100644 --- a/js/popups/sweepstakesrulespopup.ts +++ b/js/popups/sweepstakesrulespopup.ts @@ -3,6 +3,7 @@ import { PopupBase } from "../ui/popupbase"; declare var app: App; +/** Popup for sweepstakes game rules */ export class SweepstakesRulesPopup extends PopupBase { } diff --git a/js/popups/tablemenupopup.ts b/js/popups/tablemenupopup.ts index 8b328864..2e970175 100644 --- a/js/popups/tablemenupopup.ts +++ b/js/popups/tablemenupopup.ts @@ -13,6 +13,7 @@ import { TournamentView } from "../table/tournamentview"; declare var app: App; +/** Table Menu Popup */ export class TableMenuPopup { public soundEnabled: KnockoutComputed; public autoSwitchTables: KnockoutComputed; diff --git a/js/selector.ts b/js/selector.ts index a1195307..e46def3f 100644 --- a/js/selector.ts +++ b/js/selector.ts @@ -6,6 +6,7 @@ export interface SelectorItem { selected: boolean; } +/** App selector */ export class Selector { public caption: KnockoutObservable; public items: KnockoutObservableArray; diff --git a/js/services/accountManager.ts b/js/services/accountManager.ts index d32d36ca..0a435f81 100644 --- a/js/services/accountManager.ts +++ b/js/services/accountManager.ts @@ -5,6 +5,7 @@ export interface IAccountManager { getAccount(): Promise>; } +/** Manager for account operations */ export class AccountManager implements IAccountManager { public async getAccount() { const api = new Account(host); diff --git a/js/services/accountservice.ts b/js/services/accountservice.ts index 6ba3a612..5cd7eb16 100644 --- a/js/services/accountservice.ts +++ b/js/services/accountservice.ts @@ -1,6 +1,7 @@ import { authManager } from "poker/authmanager"; import { AccountManager } from "./accountManager"; +/** Account Service */ export class AccountService { private realMoneySupported: boolean; private gameMoneySupported: boolean; diff --git a/js/services/appreloadservice.ts b/js/services/appreloadservice.ts index 3d50ea89..6932f2ec 100644 --- a/js/services/appreloadservice.ts +++ b/js/services/appreloadservice.ts @@ -4,6 +4,7 @@ import { appConfig } from "../appconfig"; declare var host: string; +/** App Reload Service */ export class AppReloadService { public async getReload(tableId: number) { const api = this.getApi(); diff --git a/js/services/cancelError.ts b/js/services/cancelError.ts index 6667bbdc..b0d3f028 100644 --- a/js/services/cancelError.ts +++ b/js/services/cancelError.ts @@ -1,3 +1,4 @@ +/** Cancel Error */ export class CancelError extends Error { constructor(message?: string) { super(message); diff --git a/js/services/cancelToken.ts b/js/services/cancelToken.ts index fff3395c..79659238 100644 --- a/js/services/cancelToken.ts +++ b/js/services/cancelToken.ts @@ -2,6 +2,7 @@ import { CancelError } from "./cancelError"; type CancelAction = (reason?: string) => void; +/** Cancel Token */ export class CancelToken { /** * Returns an object that contains a new `CancelToken` and a function that, when called, diff --git a/js/services/connectionservice.ts b/js/services/connectionservice.ts index 08b93d22..9edb5371 100644 --- a/js/services/connectionservice.ts +++ b/js/services/connectionservice.ts @@ -9,6 +9,7 @@ import { slowInternetService } from "./index"; type CancelConnectionCallback = (reason: string) => void; +/** Connection Service */ export class ConnectionService { public static stateConversion = { 0: "connecting", diff --git a/js/services/connectionwrapper.ts b/js/services/connectionwrapper.ts index 925df153..f8b1aa8a 100644 --- a/js/services/connectionwrapper.ts +++ b/js/services/connectionwrapper.ts @@ -8,6 +8,7 @@ import { CancelToken } from "./cancelToken"; import { ConnectionService } from "./connectionservice"; import { connectionService, slowInternetService } from "./index"; +/** Connection Wrapper */ export class ConnectionWrapper { public terminated = false; private refreshHandle: number | null = null; diff --git a/js/services/duplicatefinder.ts b/js/services/duplicatefinder.ts index 9dc1ae31..0deae5d4 100644 --- a/js/services/duplicatefinder.ts +++ b/js/services/duplicatefinder.ts @@ -1,4 +1,5 @@ -export class DuplicateFinder { +/** DuplicateFinder */ +export class DuplicateFinder { private dataEvents: any[][]; constructor() { diff --git a/js/services/imagepreloadservice.ts b/js/services/imagepreloadservice.ts index 02d55aec..88787765 100644 --- a/js/services/imagepreloadservice.ts +++ b/js/services/imagepreloadservice.ts @@ -1,5 +1,6 @@ import { debugSettings } from "../debugsettings"; +/** Image Preload Service */ export class ImagePreloadService { public preload(url: string, useAbsolute = true) { const absoluteUrl = useAbsolute ? this.getAbsoluteUrl(url) : url; diff --git a/js/services/index.ts b/js/services/index.ts index 3aecdee6..a3d481a2 100644 --- a/js/services/index.ts +++ b/js/services/index.ts @@ -14,6 +14,8 @@ import { SoundManager } from "./soundmanager"; export { WebsiteService } from "./websiteService"; let soundManager: SoundManager; + +/** Get sount manager */ export function getSoundManager() { if (!soundManager) { soundManager = new SoundManager(appConfig.game.soundTheme, appConfig.game.hasHumanVoice); diff --git a/js/services/keyboardactivationservice.ts b/js/services/keyboardactivationservice.ts index b7d2e977..bb266f8f 100644 --- a/js/services/keyboardactivationservice.ts +++ b/js/services/keyboardactivationservice.ts @@ -8,6 +8,7 @@ import { uiManager } from "./uimanager"; declare var app: App; +/** Keyboard Activation Service */ export class KeyboardActivationService { public static keyboardShowModifier = "keyboard-shown"; private lastPage: string = null; diff --git a/js/services/orientationservice.ts b/js/services/orientationservice.ts index ea0ab961..8a1f4257 100644 --- a/js/services/orientationservice.ts +++ b/js/services/orientationservice.ts @@ -1,5 +1,6 @@ /// +/** Service that applies needed orientation for current page */ export class OrientationService { private lastOrientation: string = null; private disableRotation = false; diff --git a/js/services/pushservice.ts b/js/services/pushservice.ts index b45cb2ec..863261b5 100644 --- a/js/services/pushservice.ts +++ b/js/services/pushservice.ts @@ -1,5 +1,6 @@ /// +/** Push Service */ export class PushService { private hub: WindowsAzure.Messaging.NotificationHubInterface; diff --git a/js/services/reloadmanager.ts b/js/services/reloadmanager.ts index 85d9ecd3..b2b1a0ff 100644 --- a/js/services/reloadmanager.ts +++ b/js/services/reloadmanager.ts @@ -1,5 +1,6 @@ import { debugSettings } from "../debugsettings"; +/** Reload Manager */ export class ReloadManager { private callback: () => void; public setReloadCallback(callback: () => void) { diff --git a/js/services/slowinternetservice.ts b/js/services/slowinternetservice.ts index 6a078a9e..ad37f5eb 100644 --- a/js/services/slowinternetservice.ts +++ b/js/services/slowinternetservice.ts @@ -6,6 +6,7 @@ declare var app: App; type RetryHandler = () => void; +/** Service that handles slow internet connection */ export class SlowInternetService { public static popupName = "slowConnection"; public manualDisconnect: boolean; diff --git a/js/services/soundmanager.ts b/js/services/soundmanager.ts index 534dd964..a5b9fd85 100644 --- a/js/services/soundmanager.ts +++ b/js/services/soundmanager.ts @@ -2,6 +2,9 @@ import * as runtimeSettings from "../table/runtimesettings"; import { wait } from "./timedeferred"; +/** Manager that playes app sounds depending + * on current configurations + */ export class SoundManager { public enabled = ko.observable(false); public tableSoundsEnabled = ko.observable(false); diff --git a/js/services/timedeferred.ts b/js/services/timedeferred.ts index 4758ea3f..a66d2c81 100644 --- a/js/services/timedeferred.ts +++ b/js/services/timedeferred.ts @@ -1,5 +1,9 @@ import * as timeService from "../timeservice"; +/** + * Sets timeout + * @param time Wait time + */ export function wait(time: number) { return new Promise((resolve) => { timeService.setTimeout(resolve, time); diff --git a/js/services/uimanager.ts b/js/services/uimanager.ts index 79c4539c..62382bfe 100644 --- a/js/services/uimanager.ts +++ b/js/services/uimanager.ts @@ -6,6 +6,7 @@ import { PageBlock } from "../pageblock"; declare var app: App; +/** Manager that handles pages visibility */ export class UIManager { public static getTabBarItemForPage(pageName: string): string { if (UIManager.pageMappings[pageName]) { diff --git a/js/slider.ts b/js/slider.ts index 65521862..159d65e0 100644 --- a/js/slider.ts +++ b/js/slider.ts @@ -6,6 +6,7 @@ class SliderItem { public action: (() => void) | null; } +/** App slider */ export class Slider { public currentIndex: KnockoutObservable; public currentIndex1: KnockoutComputed; diff --git a/js/tabbar.ts b/js/tabbar.ts index 480a4454..af86ac00 100644 --- a/js/tabbar.ts +++ b/js/tabbar.ts @@ -16,6 +16,7 @@ class TabBarItem { } } +/** App tabbar */ export class TabBar { public items: KnockoutObservableArray; public visible: KnockoutObservable; diff --git a/js/table/SystemMessage.ts b/js/table/SystemMessage.ts index 11f7afeb..74bf04f9 100644 --- a/js/table/SystemMessage.ts +++ b/js/table/SystemMessage.ts @@ -1,5 +1,6 @@ import * as ko from "knockout"; +/** System messages */ export class SystemMessage { public messageId: number; public message: KnockoutObservable; diff --git a/js/table/actionBlock.ts b/js/table/actionBlock.ts index c4e3f44d..5b2b22db 100644 --- a/js/table/actionBlock.ts +++ b/js/table/actionBlock.ts @@ -19,6 +19,7 @@ import { TablePlaceModel } from "./tabpleplacemodel"; declare var host: string; declare var app: App; +/** Players game action block */ export class ActionBlock { public tableSlider: TableSlider; public dealsAllowed: KnockoutObservable; diff --git a/js/table/animationsettings.ts b/js/table/animationsettings.ts index e32b252d..0ca94d02 100644 --- a/js/table/animationsettings.ts +++ b/js/table/animationsettings.ts @@ -1,4 +1,5 @@ -export class AnimationSettings { +/** Set animation settings */ +export class AnimationSettings { public static platform = "default"; diff --git a/js/table/cardsHelper.ts b/js/table/cardsHelper.ts index 9baa9c07..16036526 100644 --- a/js/table/cardsHelper.ts +++ b/js/table/cardsHelper.ts @@ -9,6 +9,7 @@ export const allBacksClassesTwoCards = ["cards back", "cards back"]; export const allNoneClassesTwoCards = ["cards none", "cards none"]; // tslint:disable-next-line:no-unused-variable +/** Expose cards value constants */ export function exposeCardsConstants() { // tslint:disable-next-line:no-string-literal window["allBacks"] = allBacks; @@ -24,6 +25,10 @@ export function exposeCardsConstants() { window["allNoneClassesTwoCards"] = allNoneClassesTwoCards; } +/** + * Get card displayed value from its byte representation + * @param card A byte value of the card + */ export function cardValue(card: number) { /// /// Get card string @@ -165,6 +170,10 @@ export function decodeCardsArray(cardsData: string | null): number[] { return cards; } +/** + * Get cards displayed value from its byte representation + * @param data Array with cards byte representation + */ export function convertToCards(data: number[]): string[] { if (data == null) { return null; @@ -175,6 +184,10 @@ export function convertToCards(data: number[]): string[] { }); } +/** + * Get card string + * @param cardsData rray of the cards + */ export function cardsArray(cardsData: string): string[] { /// /// Get card string diff --git a/js/table/chipitem.ts b/js/table/chipitem.ts index 1ff37cb1..2f3e2f66 100644 --- a/js/table/chipitem.ts +++ b/js/table/chipitem.ts @@ -11,6 +11,7 @@ interface ChipStackCalcIntermediate { index: number; } +/** Chip Item */ export class ChipItem { public baseAmount: KnockoutObservable; private maxStackCount = 5; diff --git a/js/table/gameactionsqueue.ts b/js/table/gameactionsqueue.ts index d6739dc5..134170bd 100644 --- a/js/table/gameactionsqueue.ts +++ b/js/table/gameactionsqueue.ts @@ -2,6 +2,7 @@ type QueueWorker = () => Promise; +/** Handle app qued tasks */ export class GameActionsQueue { public static logging: boolean = false; public static waitDisabled = false; diff --git a/js/table/hand.ts b/js/table/hand.ts index 0b808380..742f3e36 100644 --- a/js/table/hand.ts +++ b/js/table/hand.ts @@ -72,6 +72,10 @@ return rankCountBitMask - isSameSuit * ((rankBitMask === 0x7c00) ? -5 : 1); } + /** + * Get cards string value from its byte representation + * @param v Card byte value + */ export function cardValue(v: number) { if (v === 14) { return "A"; @@ -92,6 +96,10 @@ return v.toString(); } + /** + * Get current combination type + * @param hand Current hand representation + */ export function getHandTypeEx(hand: HandRepresentation) { if (hand.Suits.length !== 5 || hand.Cards.length !== 5) { throw new Error("Should be passed 5 cards for extended interpretation."); @@ -335,6 +343,10 @@ | tempCards[4]; } + /** + * Convert string to internal representation. + * @param str String representation of the hand which should be converted. + */ export function parseHand(str: string): HandParseResult { /// Convert string to internal representation. /// String representation of the hand which should be converted. diff --git a/js/table/playerMessage.ts b/js/table/playerMessage.ts index 39948f3f..daa5bca3 100644 --- a/js/table/playerMessage.ts +++ b/js/table/playerMessage.ts @@ -1,6 +1,7 @@ import * as ko from "knockout"; import { authManager } from "poker/authmanager"; +/** Player chat messages */ export class PlayerMessage { public messageId: number; public sender: string; diff --git a/js/table/tableCardsPlace.ts b/js/table/tableCardsPlace.ts index d8d0d16f..d5f1eca5 100644 --- a/js/table/tableCardsPlace.ts +++ b/js/table/tableCardsPlace.ts @@ -2,6 +2,7 @@ import { convertToCards } from "./cardsHelper"; import * as runtimeSettings from "./runtimesettings"; +/** Place table cards */ export class TableCardsPlace { public tableCards: KnockoutObservableArray; public tableCardsData: KnockoutObservableArray; diff --git a/js/table/tableSlider.ts b/js/table/tableSlider.ts index 21b9b205..d4a14f55 100644 --- a/js/table/tableSlider.ts +++ b/js/table/tableSlider.ts @@ -14,6 +14,7 @@ interface TapEvent { originalEvent: Event & TapGestureEvent; } +/** TableSlider */ export class TableSlider { public current: KnockoutObservable; public currentValue: KnockoutComputed; diff --git a/js/table/tablemanager.ts b/js/table/tablemanager.ts index 8b7a9c57..87a71c43 100644 --- a/js/table/tablemanager.ts +++ b/js/table/tablemanager.ts @@ -34,6 +34,7 @@ export enum CardsDealedCodes { RiverDealed = 3, } +/** Manages player tables */ export class TableManager { public tables: KnockoutObservableArray; public currentIndex: KnockoutObservable; diff --git a/js/table/tableplaces.ts b/js/table/tableplaces.ts index fcd6110a..228080f8 100644 --- a/js/table/tableplaces.ts +++ b/js/table/tableplaces.ts @@ -1,6 +1,7 @@ import * as ko from "knockout"; import { TablePlaceModel } from "./tabpleplacemodel"; +/** Base class for table places */ export class TablePlaces { public placesRefreshTrigger: KnockoutObservable<{}>; diff --git a/js/table/tableview.ts b/js/table/tableview.ts index cf4f4f7f..e928cd19 100644 --- a/js/table/tableview.ts +++ b/js/table/tableview.ts @@ -41,6 +41,7 @@ interface CardsRepresentation { Suits: number[]; } +/** Main class for opened table view */ export class TableView { public static MaxMessagesCount: number = 100; public tableName: KnockoutObservable; diff --git a/js/table/tabpleplacemodel.ts b/js/table/tabpleplacemodel.ts index 87210536..aa95af8b 100644 --- a/js/table/tabpleplacemodel.ts +++ b/js/table/tabpleplacemodel.ts @@ -13,6 +13,7 @@ interface CardsRepresentation { Suits: number[]; } +/** Model for table place */ export class TablePlaceModel { /** * Default avatar for unspecified images, and diff --git a/js/table/tournamentManager.ts b/js/table/tournamentManager.ts index 89cbc8e4..40365290 100644 --- a/js/table/tournamentManager.ts +++ b/js/table/tournamentManager.ts @@ -1,6 +1,7 @@ import * as signals from "signals"; import { TournamentView } from "./tournamentview"; +/** Tournament Manager */ class TournamentManager { /** * Tournaments in which player registered. diff --git a/js/table/tournamentview.ts b/js/table/tournamentview.ts index 244824da..48b55775 100644 --- a/js/table/tournamentview.ts +++ b/js/table/tournamentview.ts @@ -16,6 +16,7 @@ import { tableManager } from "./tablemanager"; declare var host: string; declare var app: App; +/** Class for opened tournament view */ export class TournamentView { public tournamentData = ko.observable(); public loading = ko.observable(false); diff --git a/js/tablesfilterpage.ts b/js/tablesfilterpage.ts index 5311d5e1..a58ed66b 100644 --- a/js/tablesfilterpage.ts +++ b/js/tablesfilterpage.ts @@ -1,6 +1,7 @@ import * as ko from "knockout"; import { PageBase } from "./ui/pagebase"; +/** TablesFilterPage */ export class TablesFilterPage extends PageBase { public oldpassword: KnockoutObservable; public password: KnockoutObservable; diff --git a/js/ui/chatcontrol.ts b/js/ui/chatcontrol.ts index 73839204..ed23ffa6 100644 --- a/js/ui/chatcontrol.ts +++ b/js/ui/chatcontrol.ts @@ -5,6 +5,7 @@ import { connectionService } from "poker/services"; import { ConnectionWrapper } from "poker/services/connectionwrapper"; import * as timeService from "../timeservice"; +/** Control class of players chat */ export class ChatControl { public currentMessage: KnockoutObservable; public messages: KnockoutObservableArray; diff --git a/js/ui/pagebase.ts b/js/ui/pagebase.ts index 080de9bf..ef9412ff 100644 --- a/js/ui/pagebase.ts +++ b/js/ui/pagebase.ts @@ -2,6 +2,7 @@ import * as ko from "knockout"; import { debugSettings } from "../debugsettings"; +/** Interface for the pages base */ export class PageBase implements Page { /** * Indicating whether page is currently visible diff --git a/js/ui/popupbase.ts b/js/ui/popupbase.ts index 48e9f1b4..b2f60517 100644 --- a/js/ui/popupbase.ts +++ b/js/ui/popupbase.ts @@ -4,6 +4,7 @@ import { debugSettings } from "../debugsettings"; declare var app: App; +/** Interface for the popups base */ export class PopupBase { public visible: KnockoutObservable; diff --git a/js/validationConfiguration.ts b/js/validationConfiguration.ts index 35549be5..0f2558b0 100644 --- a/js/validationConfiguration.ts +++ b/js/validationConfiguration.ts @@ -1,6 +1,7 @@ import * as ko from "knockout"; import * as kov from "knockout.validation"; +/** Get form validation messages */ export function updateDefaultMessages() { // tslint:disable-next-line:no-unused-expression kov; diff --git a/tests/table/helper.ts b/tests/table/helper.ts index ba92914f..55b071c1 100644 --- a/tests/table/helper.ts +++ b/tests/table/helper.ts @@ -18,6 +18,12 @@ import { TableView, } from "../../js/table/tableview"; +/** + * Sit players on the table + * @param view Current table view. + * @param gameType Current game type. + * @param money Players money. + */ export async function simpleSit(view: TableView, gameType: number, money: number[]) { view.currentLogin("Player1"); view.onTableStatusInfo([], [], null, 2, 10, 10, 30, 0, 1, 0, 1, true, 0, false, true, null, null, gameType); @@ -30,6 +36,13 @@ export async function simpleSit(view: TableView, gameType: number, money: number return data; } +/** + * Initialize new game + * @param view Current table view. + * @param gameType Current game type. + * @param money Players money. + * @param dealer Dealers seat number. + */ export async function simpleInitialization(view: TableView, gameType: number, money: number[], dealer: number | null = null) { const data = await simpleSit(view, gameType, money); @@ -44,6 +57,7 @@ export async function simpleInitialization(view: TableView, gameType: number, mo view.onGameStarted(1, data, [], dealer); } +/** Returns game table object */ export function getTable() { return { TableId: 1, @@ -64,6 +78,7 @@ const statusResponse = (status: string) => { return Promise.resolve({ Status: status }); }; const successStatus = statusResponse("Ok"); + export const noopAccountApi: IAccount = { logout: () => successStatus, authenticate: (login: string, password: string, rememberMe: boolean) => Promise.resolve({ @@ -140,6 +155,7 @@ export const noopApiProvider: IApiProvider = { getTournament: () => noopTournamentApi, }; +/** Get tableview for tests */ export function getTestTableView(): TableView { const tableModel = getTable(); return new TableView(1, tableModel, noopApiProvider); @@ -191,6 +207,10 @@ export const baseTournament: TournamentDefinition = { MaxPlayers: 1000, }; +/** + * Get tournament table view for tests. + * @param tournamentDataOverride + */ export function getTestTournamentTableView(tournamentDataOverride?: Partial): TableView { const tableModel = getTable(); const view = new TableView(1, tableModel, noopApiProvider); @@ -212,6 +232,10 @@ export async function drainQueue(queue: GameActionsQueue) { } } +/** + * Log all tableView places + * @param tableView + */ export function printTableView(tableView: TableView) { console.log(tableView.places().filter((_) => _).map((_) => { return { diff --git a/tslint.json b/tslint.json index 256b1fae..3b1f3691 100644 --- a/tslint.json +++ b/tslint.json @@ -1,7 +1,14 @@ { "extends": "tslint:recommended", "rules": { - "class-name": true, + "class-name": true, + "completed-docs": [ + true, + { + "classes": { "visibilities": [ "exported" ] }, + "functions": { "visibilities": [ "exported" ] } + } + ], "comment-format": [ true, "check-space"