Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @flow
- /*
- * Core Structure for CasinoGames redux store
- */
- type CasinoGamesStore = {
- categories: Object<CategoryId, Category>,
- currencies: Object<CurrencyId, Currency>,
- games: Object<GameId, Game>,
- jackpots: Object<JackpotId, Jackpot>,
- langPack: LanguagePack<string, string>,
- lastUpdated: Object<ApiId, ApiLastUpdated>,
- winners: Winner[],
- };
- /*
- * Games Reducer
- */
- type GameId = mixed;
- type Game = {
- title: string,
- description: string,
- thumbnail: GameThumbnail,
- type: ?string,
- width: ?number,
- height: ?number,
- sticker: ?string,
- jackpotGroup: ?JackpotId,
- featured: ?boolean,
- };
- type GameThumbnail = {
- default: string,
- featured: ?string,
- video: ?string,
- };
- type GameStub = {
- id: GameId,
- sticker: ?string,
- featured: ?boolean,
- };
- /*
- * Categories Reducer
- */
- type CategoryId = mixed;
- type Category = {
- title: string,
- isDefault: ?boolean,
- position: number,
- games: GameStub[],
- };
- /*
- * Jackpots Reducer
- */
- type JackpotId = mixed;
- type Jackpot = {
- title: string,
- amount: number,
- currency: CurrencyId,
- subJackpots: SubJackpot[],
- games: GameStub[],
- };
- type SubJackpot = {
- title: string,
- amount: number,
- };
- /*
- * Winners Reducer
- */
- type Winner = {
- username: string,
- game: GameId,
- amount: number,
- currency: CurrencyId,
- timestamp: number, // time converted to ms since epoch, can then be converted to date object as necessary
- };
- /*
- * Currencies Reducer
- */
- type CurrencyId = String;
- type Currency = {
- format: string,
- symbol: string,
- symbolBefore: boolean,
- };
- /*
- * LangPack Reducer
- */
- type LanguagePack = {
- playNow: string,
- showMore: string,
- addToFavourites: string,
- recentWinners: string,
- favourites: string,
- search: string,
- searchPlaceholder: string,
- sort: string,
- sortGrid: string,
- sortList: string,
- sortAlphabetically: string,
- sortPopular: string,
- winnersUsername: string,
- winnersAmount: string,
- winnersTimestamp: string,
- winnersGame: string,
- };
- /*
- * Api Metadata Reducer
- */
- type ApiId = String;
- type ApiLastUpdated = {
- lastUpdated: ?number,
- lastRequested: ?number,
- };
- /*
- * Core Structure for User redux store
- */
- type UserStore = {
- id: ?UserId,
- username: ?string,
- balances: Balance[],
- recommendedGames: GameId[],
- favouriteGames: GameId[],
- recentGames: RecentGame,
- sessionId: ?string,
- }
- /*
- * id reducer
- */
- type UserId = number;
- /*
- * Balances reducer
- */
- type Balance = {
- balance: number,
- currency: CurrencyId,
- type: string,
- };
- /*
- * Recent games reducer
- */
- type RecentGame = {
- id: GameId,
- lastPlayed: number, // timestamp
- playCount: number,
- score: number,
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement