starti.app 1.0.7 → 1.0.8
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.
- package/dist/app.d.ts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/pushnotification.d.ts +4 -0
- package/dist/qrscanner.d.ts +1 -0
- package/package.json +1 -1
package/dist/app.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export declare const App: IApp;
|
|
2
2
|
export interface IApp {
|
|
3
|
+
/** The event will be called whenever the app enters the foreground on the device and when the app starts og thus also enters the foreground on the device. */
|
|
3
4
|
onAppInForeground?: () => void;
|
|
5
|
+
/** Are the site running inside starti.app? Returns false if the site is loaded in a normal browser. */
|
|
4
6
|
isStartiappLoaded(): boolean;
|
|
7
|
+
/** Use this method to control which URL the app load when it is initialized. */
|
|
5
8
|
setAppUrl: (url: string) => void;
|
|
9
|
+
/** Returns the version number of the app (eg. 1.0.0). */
|
|
6
10
|
version(): Promise<string>;
|
|
7
11
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,12 @@ import { IApp } from './app';
|
|
|
2
2
|
import { IPushNotification } from './pushnotification';
|
|
3
3
|
import { IQrScanner } from './qrscanner';
|
|
4
4
|
export default class startiapp {
|
|
5
|
+
/** Basic calls to the app. */
|
|
5
6
|
static App: IApp;
|
|
7
|
+
/** The QR- and barcode scanning functionality. */
|
|
6
8
|
static QrScanner: IQrScanner;
|
|
9
|
+
/** Access to push notifications using Firebase. */
|
|
7
10
|
static PushNotification: IPushNotification;
|
|
11
|
+
/** Call this method to initialize the starti.app API integration. */
|
|
8
12
|
static initialize(): void;
|
|
9
13
|
}
|
package/dist/index.js
CHANGED
|
@@ -11,12 +11,16 @@ untypedWindow.App = app_1.App;
|
|
|
11
11
|
untypedWindow.QrScanner = qrscanner_1.QrScanner;
|
|
12
12
|
untypedWindow.PushNotification = pushnotification_1.PushNotification;
|
|
13
13
|
class startiapp {
|
|
14
|
+
/** Call this method to initialize the starti.app API integration. */
|
|
14
15
|
static initialize() {
|
|
15
16
|
// @ts-ignore
|
|
16
17
|
AppIntegration.webAppIsReady();
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
exports.default = startiapp;
|
|
21
|
+
/** Basic calls to the app. */
|
|
20
22
|
startiapp.App = app_1.App;
|
|
23
|
+
/** The QR- and barcode scanning functionality. */
|
|
21
24
|
startiapp.QrScanner = qrscanner_1.QrScanner;
|
|
25
|
+
/** Access to push notifications using Firebase. */
|
|
22
26
|
startiapp.PushNotification = pushnotification_1.PushNotification;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export declare const PushNotification: IPushNotification;
|
|
2
2
|
export interface IPushNotification {
|
|
3
|
+
/** Called with the token used to send push notifications to the current device. */
|
|
3
4
|
onTokenReceived?: (token: string) => void;
|
|
5
|
+
/** Called with the notification that has been received by the mobile. The content of notification is the content that has been sent from the backend. There will also be a special property called appWasLaunchedFromNotification which indicated wether the app entered the foreground because a notification as pressed on the device or wether the app already was in the foreground when the notification was received. */
|
|
4
6
|
onNotificationReceived?: (notification: any) => void;
|
|
7
|
+
/** This method should be called when the user want’s to receive push notifications. */
|
|
5
8
|
initialize(): Promise<boolean>;
|
|
9
|
+
/** This method returns the token which should be used to send push notifications. */
|
|
6
10
|
getLastPublishedToken(): Promise<string>;
|
|
7
11
|
}
|
package/dist/qrscanner.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const QrScanner: IQrScanner;
|
|
2
2
|
export interface IQrScanner {
|
|
3
|
+
/** Opens the camera on the phone og starts scanning after QR- and barcodes. When the camera has scanned a code the camera will be closed the user will be back on the website. */
|
|
3
4
|
scan(): Promise<string>;
|
|
4
5
|
}
|