@arkadiuminc/sdk 2.79.0 → 2.79.1

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,5 +1,5 @@
1
1
  import { Backend } from '../backend/backend.api';
2
- import { createStore } from '../../utils/observable';
2
+ import { createStore, UnsubscribeFn } from '../../utils/observable';
3
3
  import { RpcProvider } from '../../core/rpc';
4
4
  import { IHost } from '../host';
5
5
  import { PersistenceArena } from '../persistence';
@@ -29,7 +29,7 @@ export declare abstract class Auth {
29
29
  isUserAuthorized(): Promise<boolean>;
30
30
  getToken(): Promise<string | undefined>;
31
31
  abstract getUserProfile(): Promise<UserProfile | null>;
32
- onAuthStatusChange(observer: AuthStatusObserver): () => void;
32
+ onAuthStatusChange(observer: AuthStatusObserver): UnsubscribeFn;
33
33
  openAuthForm(): Promise<void>;
34
34
  closeAuthForm(): Promise<void>;
35
35
  onOpenAuthForm(observer: AuthFormObserver): void | undefined;
@@ -1,6 +1,6 @@
1
1
  import { DebugProvider } from '../../core/debug-provider';
2
2
  import { RpcProvider } from '../../core/rpc';
3
- import { ObserverFn } from '../../utils/observable';
3
+ import { ObserverFn, UnsubscribeFn } from '../../utils/observable';
4
4
  import { ArenaType } from './arena-type';
5
5
 
6
6
  export { ArenaType } from './arena-type';
@@ -62,7 +62,7 @@ export declare class HostArena implements IHost {
62
62
  getDetails(): Promise<WebEnvironmentDetails>;
63
63
  setDetails(p: Partial<WebEnvironmentDetails>): void;
64
64
  openPurchaseForm(pr: PurchaseRequest): Promise<void>;
65
- onOpenPurchaseForm(observer: any): () => void;
65
+ onOpenPurchaseForm(observer: ObserverFn<PurchaseRequest | undefined>): UnsubscribeFn;
66
66
  purchaseFormClosed(madePurchase: boolean): Promise<void>;
67
67
  getArenaName(): Promise<string>;
68
68
  getArenaNameSync(): string;
@@ -81,6 +81,10 @@ export declare class HostArena implements IHost {
81
81
  isEagleSupported(): Promise<boolean>;
82
82
  isAuthSupported(): Promise<boolean>;
83
83
  }
84
+ export declare type ShopWindowNotification = {
85
+ opened: boolean;
86
+ madePurchase: boolean;
87
+ };
84
88
  export declare class HostGame implements IHost {
85
89
  private rpcProvider;
86
90
  private purchaseFormState;
@@ -98,7 +102,7 @@ export declare class HostGame implements IHost {
98
102
  setGameId(id: string): void;
99
103
  getDetails(): Promise<WebEnvironmentDetails>;
100
104
  openPurchaseForm(r?: PurchaseRequest): Promise<void>;
101
- onPurchaseFormStateChange(observer: any): () => void;
105
+ onPurchaseFormStateChange(observer: ObserverFn<ShopWindowNotification | undefined>): UnsubscribeFn;
102
106
  private purchaseFormClosed;
103
107
  getArenaName(): Promise<string>;
104
108
  getArenaType(): Promise<ArenaType>;
@@ -2,14 +2,15 @@
2
2
  export declare type ObserverFn<T> = (data: T) => void;
3
3
  /** @hidden */
4
4
  export interface ReadonlyObservable<T> {
5
- subscribe: (observer: ObserverFn<T>) => any;
5
+ subscribe: (observer: ObserverFn<T>) => UnsubscribeFn;
6
6
  }
7
+ export declare type UnsubscribeFn = () => void;
7
8
  /** @hidden */
8
9
  export declare class Observable<T> {
9
10
  private lastValue;
10
11
  private observers;
11
12
  constructor(initialValue: T);
12
- subscribe(observer: ObserverFn<T>): () => void;
13
+ subscribe(observer: ObserverFn<T>): UnsubscribeFn;
13
14
  update(data: T): void;
14
15
  }
15
16
  export declare function createStore<T>(initialValue: T): Observable<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.79.0",
3
+ "version": "2.79.1",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",