react-memory-optimization 0.0.21 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  import { ESocketCallbackStep, ISocketSettings, SocketInterface, TBettingSettings, TCasinoSettings } from './types';
2
2
  import { ResponseAdapter } from '../service/responseAdapter';
3
3
  import { SubscribeSportInfoBySportIdProps, SubscribeSportsProps } from '../store/betting/entities/sports/types';
4
- import { SubscribeCountryInfoProps, SubscribeMinDepositInfoProps, SubscribeUserCurrencyInfoProps, SubscribeUserStateProps } from '../store/user/types';
5
4
  import { ReadModuleKeys, ReadModuleType } from '../binary/types';
6
5
  import { CashOutTicketProps, SubscribeComposeTransactionsProps } from './methodTypes';
7
6
  import { SubscribeBettingEventsByTournamentIdProps, SubscribeBettingTopEventsProps, SubscribeEventDetailsMarketTabs, SubscribeEventDetailsMarketsByGroupIdProps, SubscribeEventShortInfoProps, SubscribeLineEntitiesProps, SubscribeOdd, SubscribeEventEntitiesProps } from '../store/betting/entities/events/types';
@@ -28,6 +27,7 @@ import { CashBonusChannelType } from 'store/operations/entities/cashBonuses/type
28
27
  import { JackpotSettings } from 'store/casino/entities/jackpots/types';
29
28
  import { CasinoHistoryGamesSubscriber } from 'store/operations/entities/casinoHistory/types';
30
29
  import { BettingEntitySubscribers } from 'store/betting/types';
30
+ import { SubscribeUserKeys } from 'store/user/types';
31
31
  export declare class Socket implements SocketInterface {
32
32
  socketServices: SocketServices;
33
33
  initialSettings: ISocketSettings;
@@ -68,13 +68,9 @@ export declare class Socket implements SocketInterface {
68
68
  decode(stream: Uint8Array, step: number): void;
69
69
  subscribeEntity(method: () => boolean): boolean;
70
70
  logout(): void;
71
- subscribeCountryInfo(props: SubscribeCountryInfoProps): boolean;
72
- subscribeMinDepOdd(props: SubscribeMinDepositInfoProps): boolean;
73
- subscribeUserCurrencyInfo(props: SubscribeUserCurrencyInfoProps): boolean;
71
+ subscribeUserEntity(props: BaseObservableSubscriber & SubscribeUserKeys): boolean;
74
72
  subscribeCasinoFrameUrl(props: BaseObservableSubscriber): boolean;
75
73
  unsubscribeCasinoFrameUrl(uid: string): boolean;
76
- subscribeUserState(props: SubscribeUserStateProps): boolean;
77
- subscribeUserInfo(props: SubscribeUserStateProps): boolean;
78
74
  subscribeStories(props: BaseObservableSubscriber): boolean;
79
75
  unsubscribeUserEntity(uid: string): boolean;
80
76
  subscribeBalanceInfo(props: BaseObservableSubscriber): boolean;
@@ -1,6 +1,5 @@
1
1
  import { SubscribeSportInfoBySportIdProps, SubscribeSportsProps } from '../store/betting/entities/sports/types';
2
2
  import { SubscriberCategoriesProps, SubscriberCategoryProps } from '../store/betting/entities/categories/types';
3
- import { SubscribeCountryInfoProps, SubscribeMinDepositInfoProps, SubscribeUserCurrencyInfoProps, SubscribeUserStateProps } from '../store/user/types';
4
3
  import { CashOutTicketProps, SubscribeComposeTransactionsProps } from './methodTypes';
5
4
  import { SubscribeBettingEventsByTournamentIdProps, SubscribeBettingTopEventsProps, SubscribeEventDetailsMarketTabs, SubscribeEventDetailsMarketsByGroupIdProps, SubscribeEventEntitiesProps, SubscribeEventShortInfoProps, SubscribeLineEntitiesProps, SubscribeOdd } from '../store/betting/entities/events/types';
6
5
  import { SubscribeLiveScoreProps } from '../store/betting/entities/events/live/types';
@@ -26,6 +25,7 @@ import { JackpotSettings, JackpotSubscribes } from 'store/casino/entities/jackpo
26
25
  import { CasinoHistoryGamesSubscriber } from 'store/operations/entities/casinoHistory/types';
27
26
  import { SubscribeCasinoCategoriesInfoProps } from 'store/casino/entities/categories/types';
28
27
  import { BettingEntitySubscribers } from 'store/betting/types';
28
+ import { SubscribeUserKeys } from 'store/user/types';
29
29
  export declare enum ESocketCallbackStep {
30
30
  Unknown = 0,
31
31
  Init = 1,
@@ -136,13 +136,9 @@ export interface SocketInterface {
136
136
  sendCommand: SendCommand;
137
137
  subscribeEntity: (method: () => boolean) => boolean;
138
138
  logout: () => void;
139
- subscribeCountryInfo: (props: SubscribeCountryInfoProps) => boolean;
140
- subscribeMinDepOdd: (props: SubscribeMinDepositInfoProps) => boolean;
141
- subscribeUserCurrencyInfo: (props: SubscribeUserCurrencyInfoProps) => boolean;
142
- subscribeUserState: (props: SubscribeUserStateProps) => boolean;
143
- subscribeUserInfo: (props: SubscribeUserStateProps) => boolean;
144
- subscribeStories: (props: BaseObservableSubscriber) => boolean;
139
+ subscribeUserEntity: (props: BaseObservableSubscriber & SubscribeUserKeys) => boolean;
145
140
  unsubscribeUserEntity: (uid: string) => boolean;
141
+ subscribeStories: (props: BaseObservableSubscriber) => boolean;
146
142
  subscribeBalanceInfo: (props: BaseObservableSubscriber) => boolean;
147
143
  subscribeBonusBalanceCoins: (props: BaseObservableSubscriber) => boolean;
148
144
  unsubscribeBalanceEntity: (uid: string) => boolean;
@@ -1,5 +1,5 @@
1
1
  import { Observable } from '../../service/observable';
2
- import { CountryInfo, CountryInfoResponse, CurrencyInfo, HandleAuthResponseProps, ObservableSettings, SubscribeCountryInfoProps, SubscribeMinDepositInfoProps, SubscribeUserCurrencyInfoProps, SubscribeUserStateProps, UserInfo } from './types';
2
+ import { CountryInfo, CountryInfoResponse, CurrencyInfo, HandleAuthResponseProps, SubscribeUserKeys, UserInfo } from './types';
3
3
  import { UserFavorites } from './entities/favorites';
4
4
  import { UserServices } from './services';
5
5
  import { Balance } from './entities/balance';
@@ -14,7 +14,9 @@ import { DailyActivities } from './entities/daily';
14
14
  import { Avatar } from './entities/avatar';
15
15
  import { PromoCode } from './entities/promoCode';
16
16
  import { Stories } from './entities/stories';
17
- export declare class User {
17
+ import { ObservableEntity } from 'service/observableEntity';
18
+ import { BaseObservableSubscriber, UpdateData } from 'service/observable/type';
19
+ export declare class User extends ObservableEntity<undefined> {
18
20
  userObservable: Observable;
19
21
  services: UserServices;
20
22
  parentService: ResponseAdapterService;
@@ -28,8 +30,8 @@ export declare class User {
28
30
  avatars: Avatar;
29
31
  promoCode: PromoCode;
30
32
  storiesInstance: Stories;
31
- observableSettings: ObservableSettings;
32
- minDepositOdd: number;
33
+ _availableCurrencies: CurrencyInfo[];
34
+ _minDepositOdd: number;
33
35
  token: string | null;
34
36
  countryInfo: CountryInfo | null;
35
37
  clientId: number;
@@ -38,6 +40,10 @@ export declare class User {
38
40
  _ratio: number;
39
41
  userInfo: null | UserInfo;
40
42
  constructor(sendCommand: SendCommand, callbackStatus: CallbackStatus, parentService: ResponseAdapterService);
43
+ set minDepositOdd(value: number);
44
+ get minDepositOdd(): number;
45
+ set availableCurrencies(availableCurrencies: CurrencyInfo[]);
46
+ get availableCurrencies(): CurrencyInfo[];
41
47
  set isAuthorized(value: boolean);
42
48
  get isAuthorized(): boolean;
43
49
  set currencyInfo(value: CurrencyInfo | null);
@@ -47,17 +53,11 @@ export declare class User {
47
53
  reset(): void;
48
54
  setInitialState(result: HandleAuthResponseProps): void;
49
55
  setCountryInfo(response: CountryInfoResponse): void;
50
- setMinDepositOdd(odd: number): void;
51
- private sendCountryIdUpdate;
52
- private sendCurrencyInfoUpdate;
53
- private sendUserState;
54
- private sendUserInfo;
55
- private minDepOdd;
56
- sendUpdates(): void;
57
- subscribeCountryInfo(props: SubscribeCountryInfoProps): void;
58
- subscribeMinDepOdd(props: SubscribeMinDepositInfoProps): void;
59
- subscribeUserCurrencyInfo(props: SubscribeUserCurrencyInfoProps): void;
60
- subscribeUserState(props: SubscribeUserStateProps): void;
61
- subscribeUserInfo(props: SubscribeUserStateProps): void;
62
- unsubscribeUserEntity(uid: string): void;
56
+ private handleCountryInfo;
57
+ private handleCurrencyInfo;
58
+ private handleUserStateInfo;
59
+ private handleUserInfo;
60
+ private handleMinDepositInfo;
61
+ private handleAvailableCurrenciesInfo;
62
+ sendUpdateEntity(d: BaseObservableSubscriber & SubscribeUserKeys): UpdateData | null;
63
63
  }
@@ -59,46 +59,18 @@ export type CountryInfo = {
59
59
  countryId: number;
60
60
  currencyIds: number[];
61
61
  };
62
- export type ObservableSettings = {
63
- [uid: string]: ObservableCountrySetting | ObservableCurrencyInfoSetting | ObservableUserStateSetting | ObservableUserMinDepSetting | ObservableUserInfoSetting;
64
- };
65
- type ObservableCountrySetting = {
66
- isCountryId: boolean;
67
- };
68
- type ObservableCurrencyInfoSetting = {
69
- isCurrencyInfo: boolean;
70
- };
71
- type ObservableUserStateSetting = {
72
- isUserState: boolean;
73
- };
74
- type ObservableUserInfoSetting = {
75
- isUserInfo: boolean;
76
- };
77
- type ObservableUserMinDepSetting = {
78
- isMinOdd: boolean;
62
+ export type SubscribeUserKeys = {
63
+ isCountryInfo?: boolean;
64
+ isMinDeposit?: boolean;
65
+ isCurrencyInfo?: boolean;
66
+ isUserState?: boolean;
67
+ isUserInfo?: boolean;
68
+ isAvailableCurrencies?: boolean;
79
69
  };
80
70
  export type AuthInfo = {
81
71
  isAuth: true;
82
72
  token: string;
83
73
  } | null;
84
- export type SubscribeCountryInfoProps = {
85
- uid: string;
86
- callback: (info: CountryInfo | null) => void;
87
- };
88
- export type SubscribeMinDepositInfoProps = {
89
- uid: string;
90
- callback: (info: {
91
- minDep: number;
92
- }) => void;
93
- };
94
- export type SubscribeUserCurrencyInfoProps = {
95
- uid: string;
96
- callback: (info: CurrencyInfo | null) => void;
97
- };
98
- export type SubscribeUserStateProps = {
99
- uid: string;
100
- callback: (info: AuthInfo) => void;
101
- };
102
74
  export type PaymentDictionaries = PaymentDictionary[];
103
75
  export type PaymentDictionary = {
104
76
  type_in: EPaymentSpecAction;
@@ -272,4 +244,3 @@ export type MPayMethods = PaymentChannelType.MPayParazula | PaymentChannelType.M
272
244
  export type WellexPayMethods = PaymentChannelType.BKashFastWellexPay | PaymentChannelType.NagadFastWellexPay | PaymentChannelType.NagadWellexPay | PaymentChannelType.BkashWellexPay | PaymentChannelType.WellxpayUpay | PaymentChannelType.BKashFastWellexPayCopy | PaymentChannelType.NagadFastWellexPayCopy | PaymentChannelType.WellxpayRocket;
273
245
  export type CashXMethods = PaymentChannelType.NagadCashX | PaymentChannelType.BkashCashX;
274
246
  export type RublesMethods = PaymentChannelType.WithdrawRubSber | PaymentChannelType.WithdrawRubTinkof | PaymentChannelType.CreditCard | PaymentChannelType.CreditCardFast | PaymentChannelType.CreditCardAcquirning;
275
- export {};
@@ -18,47 +18,6 @@ var EPaymentLaunch;
18
18
  EPaymentLaunch[EPaymentLaunch["Redirect"] = 2] = "Redirect";
19
19
  EPaymentLaunch[EPaymentLaunch["Qr"] = 3] = "Qr";
20
20
  })(EPaymentLaunch || (exports.EPaymentLaunch = EPaymentLaunch = {}));
21
- // export type DictionaryTypes = {
22
- // currency_map_channels: { id_currency: number; id_channel: number }[];
23
- // payment_systems_channels: TChannel[];
24
- // payment_systems_limits: TLimit[];
25
- // };
26
- // export enum PaymentDirect {
27
- // Deposit = 1,
28
- // Withdraw,
29
- // }
30
- // export type TLimit = {
31
- // amount_max: number;
32
- // amount_min: number;
33
- // direction: PaymentDirect;
34
- // id_channel: number;
35
- // id_currency: number;
36
- // id_system: number;
37
- // };
38
- // export type TChannel = {
39
- // channel_name: string;
40
- // fast_pay: number;
41
- // deps_required: number;
42
- // has_deposit: number;
43
- // has_withdraw: number;
44
- // id_channel: number;
45
- // id_system: number;
46
- // is_active: number;
47
- // is_crypto: number;
48
- // };
49
- // export type Payment = {
50
- // channelName: string;
51
- // isFast: boolean;
52
- // id: number;
53
- // order: number;
54
- // limit: TLimit;
55
- // isCrypto: boolean;
56
- // };
57
- // export type Withdraw = Payment;
58
- // export type Payments = {
59
- // deposit: Payment[];
60
- // withdraw: Withdraw[];
61
- // };
62
21
  var PaymentChannelType;
63
22
  (function (PaymentChannelType) {
64
23
  // new Cripto
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-memory-optimization",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "react memory optimization library",
5
5
  "sideEffects": false,
6
6
  "files": [