starti.app 2.0.96 → 2.0.105

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.
@@ -220,6 +220,16 @@ export declare class App extends EventTargetWithType<{
220
220
  */
221
221
  requestAppTracking: () => Promise<void>;
222
222
  private onStartiappReady;
223
+ /**
224
+ * @event navigatingPage
225
+ * Fired when the app is navigating to a new page.
226
+ * @type {CustomEvent<NavigatingPageEvent>}
227
+ */
223
228
  private handleNavigatingPageEvent;
229
+ /**
230
+ * @event appInForeground
231
+ * Fired when the app comes to the foreground.
232
+ * @type {CustomEvent<void>}
233
+ */
224
234
  private handleAppInForegroundEvent;
225
235
  }
@@ -21,6 +21,17 @@ export declare class PushNotification extends EventTargetWithType<{
21
21
  * ```
22
22
  */
23
23
  getToken(): Promise<string>;
24
+ /**
25
+ * This method checks the current access status for push notifications.
26
+ * @returns PermissionStatus indicating the current access status
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * const { granted } = await pushNotification.checkAccess();
31
+ * console.log(granted);
32
+ * ```
33
+ */
34
+ checkAccess(): Promise<import("../App/typings").PermissionStatus>;
24
35
  /**
25
36
  * This method requests access to send push notifications to the user.
26
37
  *
@@ -73,6 +84,16 @@ export declare class PushNotification extends EventTargetWithType<{
73
84
  private updateSubscribedStatusAsync;
74
85
  private updateSubscribedTopics;
75
86
  private getSubscribedTopics;
87
+ /**
88
+ * @event tokenReceived
89
+ * Event fired when a new FCM token is received.
90
+ * @type {CustomEvent<string>}
91
+ */
76
92
  private onTokenReceived;
93
+ /**
94
+ * @event notificationReceived
95
+ * Event fired when a push notification is received.
96
+ * @type {CustomEvent<{ title: string; body: string }>}
97
+ */
77
98
  private onNotificationReceived;
78
99
  }
@@ -24,14 +24,17 @@ export declare class QrScanner extends EventTarget {
24
24
  * return scannedValue === "VALID_CODE"; // Only accept this specific code
25
25
  * }
26
26
  * });
27
+ * ```
27
28
  *
28
29
  * @example
30
+ * ```typescript
29
31
  * // Using a synchronous validation function
30
32
  * const validatedResult = await qrScanner.scan({
31
33
  * validation: (scannedValue) => {
32
34
  * return scannedValue.startsWith("VALID_"); // Accept codes starting with "VALID_"
33
35
  * }
34
36
  * });
37
+ * ```
35
38
  */
36
39
  scan(options?: QrScannerOptions): Promise<string | null>;
37
40
  /**
@@ -3,7 +3,10 @@ export type QrScannerOptionsNative = {
3
3
  continuous?: boolean;
4
4
  /** The delay in milliseconds between scan results. Default is 200ms */
5
5
  throttleMilliseconds?: number;
6
+ /** Whether to show the camera preview while scanning. Default is true. */
7
+ showCameraPreview?: boolean;
6
8
  };
7
9
  export type QrScannerOptions = {
10
+ showCameraPreview?: boolean;
8
11
  validation?: (scannedValue: string) => boolean | Promise<boolean>;
9
12
  };
@@ -9,6 +9,7 @@ export type PushNotificationIntegration = {
9
9
  setBadgeCount(count: number): void;
10
10
  initialize(): void;
11
11
  requestAccess(): boolean;
12
+ checkAccess(): PermissionStatus;
12
13
  getFCMToken(): string | undefined;
13
14
  firebasePushNotificationTopicsUnsubscribe(topics: string[]): boolean;
14
15
  firebasePushNotificationSubscribeToTopics(topics: string[]): boolean;
@@ -3,6 +3,7 @@ export declare class SemVer {
3
3
  private major;
4
4
  private minor;
5
5
  private patch;
6
+ private revision?;
6
7
  constructor(version: string);
7
8
  private isValidVersion;
8
9
  isGreaterThan(other: SemVer): boolean;
@@ -37,6 +37,7 @@ export declare class StartiappClass extends EventTarget {
37
37
  Trigger: Trigger;
38
38
  User: User;
39
39
  Media: Media;
40
+ demoToken: string | null;
40
41
  constructor();
41
42
  /**
42
43
  * Initializes the app.
@@ -59,8 +60,18 @@ export declare class StartiappClass extends EventTarget {
59
60
  */
60
61
  isRunningInApp: typeof isRunningInApp;
61
62
  addEventListener: typeof EventTarget.prototype.addEventListener;
63
+ /**
64
+ * @event error
65
+ * Event fired when an error occurs.
66
+ * @type {CustomEvent<unknown>}
67
+ */
62
68
  private handleAppError;
63
69
  private assertIsRunningInAppAndWarn;
70
+ /**
71
+ * @event ready
72
+ * Event fired when the starti.app SDK is fully loaded and initialized.
73
+ * @type {CustomEvent<void>}
74
+ */
64
75
  private readyEvent;
65
76
  }
66
77
  export interface InitializeParams {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "starti.app",
3
3
  "author": "starti.app",
4
4
  "license": "MIT",
5
- "version": "2.0.96",
5
+ "version": "2.0.105",
6
6
  "description": "Use this package for easy communication with the starti.app API.",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",