starti.app 2.0.1 → 2.0.15
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/EventTarget.d.ts +17 -0
- package/dist/getIntegrations.d.ts +2 -0
- package/dist/index.d.ts +9 -38
- package/dist/integrationWrapper.d.ts +69 -0
- package/dist/integrations/App/AppIntegration.d.ts +114 -0
- package/dist/integrations/App/typings.d.ts +14 -0
- package/dist/integrations/Biometrics/BiometricsIntegration.d.ts +69 -0
- package/dist/integrations/Developer/DeveloperIntegration.d.ts +15 -0
- package/dist/integrations/Device/DeviceIntegration.d.ts +28 -0
- package/dist/integrations/InAppPurchase/InAppPurchaseIntegration.d.ts +39 -0
- package/dist/integrations/Location/LocationIntegration.d.ts +6 -0
- package/dist/integrations/{network.d.ts → Network/NetworkIntegration.d.ts} +25 -11
- package/dist/integrations/NfcScanner/NfcScannerIntegration.d.ts +39 -0
- package/dist/integrations/PushNotification/PushNotificationIntegration.d.ts +78 -0
- package/dist/integrations/PushNotification/Topic.d.ts +15 -0
- package/dist/integrations/QrScanner/QrScannerIntegration.d.ts +34 -0
- package/dist/integrations/Share/ShareIntegration.d.ts +30 -0
- package/dist/integrations/Storage/StorageIntegration.d.ts +15 -0
- package/dist/integrations/Trigger/TriggerIntegration.d.ts +7 -0
- package/dist/integrations/User/UserIntegration.d.ts +16 -0
- package/dist/integrations.d.ts +127 -0
- package/dist/lib/EnvironmentGetter.d.ts +1 -1
- package/dist/lib/Logger.d.ts +5 -0
- package/dist/services/flowLink-service.d.ts +1 -1
- package/dist/services/ui-service.d.ts +1 -1
- package/dist/startiapp.d.ts +93 -0
- package/package.json +26 -31
- package/dist/@types/EventHandlerWithTypes.d.ts +0 -5
- package/dist/@types/integrations.d.ts +0 -107
- package/dist/@types/types.d.ts +0 -31
- package/dist/app.d.ts +0 -80
- package/dist/clientUser.d.ts +0 -14
- package/dist/getIntegration.d.ts +0 -18
- package/dist/index.js +0 -1
- package/dist/integrations/biometrics.d.ts +0 -33
- package/dist/integrations/developer.d.ts +0 -10
- package/dist/integrations/device.d.ts +0 -18
- package/dist/integrations/iap.d.ts +0 -27
- package/dist/integrations/nfc.d.ts +0 -19
- package/dist/integrations/pushnotification.d.ts +0 -45
- package/dist/integrations/qrscanner.d.ts +0 -14
- package/dist/integrations/share.d.ts +0 -18
- package/dist/integrations/storage.d.ts +0 -5
- package/dist/integrations/trigger.d.ts +0 -14
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Startiapp } from "../../startiapp";
|
|
2
|
+
export declare class Share {
|
|
3
|
+
private readonly startiapp;
|
|
4
|
+
private shareIntegration;
|
|
5
|
+
constructor(startiapp: Startiapp);
|
|
6
|
+
/**
|
|
7
|
+
* Share a file
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const success = await startiapp.Share.shareFile("https://example.com/file.pdf", "file.pdf");
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
shareFile(url: string, fileName: string): Promise<boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* Share text
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const success = await startiapp.Share.shareText("Hello, world!");
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
shareText(text: string): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Download a file to the device's download folder
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const success = await startiapp.Share.downloadFile("https://example.com/file.pdf", "file.pdf");
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
downloadFile(url: string, fileName: string): Promise<boolean>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Startiapp } from "../../startiapp";
|
|
2
|
+
export declare class Storage extends EventTarget {
|
|
3
|
+
private readonly startiapp;
|
|
4
|
+
private integration;
|
|
5
|
+
constructor(startiapp: Startiapp);
|
|
6
|
+
/**
|
|
7
|
+
* Clears all web data stored by the app.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* await startiapp.Storage.clearWebData();
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
clearWebData: () => Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Startiapp } from "../../startiapp";
|
|
2
|
+
export declare class Trigger extends EventTarget {
|
|
3
|
+
private readonly startiapp;
|
|
4
|
+
constructor(startiapp: Startiapp);
|
|
5
|
+
trackEvent(eventId: string, customProperties?: Record<string, string>): Promise<void>;
|
|
6
|
+
trackUserProperty(key: string, value: string): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Startiapp } from "../../startiapp";
|
|
2
|
+
export declare class User extends EventTarget {
|
|
3
|
+
private readonly startiapp;
|
|
4
|
+
constructor(startiapp: Startiapp);
|
|
5
|
+
private _userId;
|
|
6
|
+
get userId(): string | null;
|
|
7
|
+
private set userId(value);
|
|
8
|
+
deleteUser(options?: RequestUserDeletionOptions): Promise<void>;
|
|
9
|
+
registerId(userId: string): Promise<void>;
|
|
10
|
+
unregisterId(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
interface RequestUserDeletionOptions {
|
|
13
|
+
prompt?: string;
|
|
14
|
+
confirmation?: string;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { NavigationSpinnerOptions, RegexDto } from "./integrations/App/typings";
|
|
2
|
+
import { BiometricsAuthenticationType, BiometricsResultReponse } from "./integrations/Biometrics/BiometricsIntegration";
|
|
3
|
+
import { InApPurchasePurchaseType, InAppPurchaseGetProductResponse, InAppPurchaseProductResponse, InAppPurchaseResponse } from "./integrations/InAppPurchase/InAppPurchaseIntegration";
|
|
4
|
+
import { ListenResponse, NetworkAccess } from "./integrations/Network/NetworkIntegration";
|
|
5
|
+
import { SetStatusBarOptions } from "./startiapp";
|
|
6
|
+
export type PushNotificationIntegration = {
|
|
7
|
+
setBadgeCount(count: number): void;
|
|
8
|
+
initialize(): void;
|
|
9
|
+
requestAccess(): boolean;
|
|
10
|
+
getFCMToken(): string | undefined;
|
|
11
|
+
firebasePushNotificationTopicsUnsubscribe(topics: string[]): boolean;
|
|
12
|
+
firebasePushNotificationSubscribeToTopics(topics: string[]): boolean;
|
|
13
|
+
tokenReceivedEvent(token: string): void;
|
|
14
|
+
notificationReceivedEvent(notification: unknown): void;
|
|
15
|
+
};
|
|
16
|
+
type ShareIntegration = {
|
|
17
|
+
shareFile(fileUrl: string, fileName: string): boolean;
|
|
18
|
+
shareText(text: string): boolean;
|
|
19
|
+
downloadFile(fileUrl: string, fileName: string): boolean;
|
|
20
|
+
};
|
|
21
|
+
type QrScannerIntegration = {
|
|
22
|
+
startQrCodeScanner(): void;
|
|
23
|
+
getCameraAccessState(): "Unknown" | "Denied" | "Granted";
|
|
24
|
+
isCameraAccessGranted(): boolean;
|
|
25
|
+
requestCameraAccess(): boolean;
|
|
26
|
+
};
|
|
27
|
+
type DeviceIntegration = {
|
|
28
|
+
startAccelerometer(): void;
|
|
29
|
+
stopAccelerometer(): void;
|
|
30
|
+
isAccelerometerStarted(): boolean;
|
|
31
|
+
};
|
|
32
|
+
type AppIntegration = {
|
|
33
|
+
download(url: string, filename: string): void;
|
|
34
|
+
openBrowser(url: string): void;
|
|
35
|
+
setAppUrl(url: string): void;
|
|
36
|
+
getAppUrl(): string;
|
|
37
|
+
resetAppUrl(): void;
|
|
38
|
+
webAppIsReady(): void;
|
|
39
|
+
setNavigationSpinner(options: NavigationSpinnerOptions): void;
|
|
40
|
+
showNavigationSpinner(options?: NavigationSpinnerOptions): void;
|
|
41
|
+
hideNavigationSpinner(): void;
|
|
42
|
+
addExternalDomains(domains: RegexDto[]): void;
|
|
43
|
+
removeExternalDomains(domains: RegexDto[]): void;
|
|
44
|
+
getExternalDomains(): void;
|
|
45
|
+
disableSwipeNavigation(): void;
|
|
46
|
+
enableSwipeNavigation(): void;
|
|
47
|
+
disableScreenRotation(): void;
|
|
48
|
+
enableScreenRotation(): void;
|
|
49
|
+
addInternalDomain(domain: string): void;
|
|
50
|
+
removeInternalDomain(domain: string): void;
|
|
51
|
+
setSafeAreaBackgroundColor(color: string): boolean;
|
|
52
|
+
hideStatusBar(): void;
|
|
53
|
+
showStatusBar(): void;
|
|
54
|
+
setStatusBar(options: SetStatusBarOptions): void;
|
|
55
|
+
setCommonScript(script: string): void;
|
|
56
|
+
requestReview(): void;
|
|
57
|
+
brandId(): string;
|
|
58
|
+
deviceId(): string;
|
|
59
|
+
version(): string;
|
|
60
|
+
addExcludedFromHistoryPattern(pattern: RegexDto): void;
|
|
61
|
+
removeExcludedFromHistoryPattern(pattern: RegexDto): void;
|
|
62
|
+
addExcludedFromHistoryDomain(domain: string): void;
|
|
63
|
+
removeExcludedFromHistoryDomain(domain: string): void;
|
|
64
|
+
};
|
|
65
|
+
type BiometricIntegration = {
|
|
66
|
+
startScanning(title: string, reason: string): boolean;
|
|
67
|
+
getAuthenticationType(): BiometricsAuthenticationType;
|
|
68
|
+
setSecuredContent(key: string, content: string): void;
|
|
69
|
+
getSecuredContent(key: string, title: string, reason: string): BiometricsResultReponse<string | null>;
|
|
70
|
+
hasSecuredContent(key: string): BiometricsResultReponse<boolean>;
|
|
71
|
+
removeSecuredContent(key: string): void;
|
|
72
|
+
};
|
|
73
|
+
type CalendarIntegration = {
|
|
74
|
+
isAccessGranted(): void;
|
|
75
|
+
listCalendars(): void;
|
|
76
|
+
requestAccess(): void;
|
|
77
|
+
addEvent(calendarId: string, title: string, description: string, syncId: string, startDate: Date, endDate: Date): void;
|
|
78
|
+
deleteEvent(eventId: string): void;
|
|
79
|
+
listEvents(calendarId: string, from: Date, to: Date): void;
|
|
80
|
+
};
|
|
81
|
+
type NFCIntegration = {
|
|
82
|
+
isNFCSupported(): boolean;
|
|
83
|
+
isNFCEnabled(): boolean;
|
|
84
|
+
startListening(): void;
|
|
85
|
+
stopListening(): void;
|
|
86
|
+
};
|
|
87
|
+
type NetworkIntegration = {
|
|
88
|
+
sendUdpBroadcast(port: number, message: string): boolean;
|
|
89
|
+
currentConnectionState(): NetworkAccess;
|
|
90
|
+
startListeningForUdpPackets(port: number): ListenResponse;
|
|
91
|
+
stopListeningForUdpPackets(): ListenResponse;
|
|
92
|
+
startListeningForConnectionChanges(): ListenResponse;
|
|
93
|
+
stopListeningForConnectionChanges(): ListenResponse;
|
|
94
|
+
};
|
|
95
|
+
type AlternateIconsIntegration = {
|
|
96
|
+
setAppIcon(iconName: string): void;
|
|
97
|
+
getCurrentAppIconName(): string;
|
|
98
|
+
getAvailableAppIconNames(): string[];
|
|
99
|
+
};
|
|
100
|
+
type IapIntegration = {
|
|
101
|
+
purchaseProduct(productId: string, purchaseType: InApPurchasePurchaseType): InAppPurchaseResponse<InAppPurchaseProductResponse>;
|
|
102
|
+
getProduct(productId: string, purchaseType: InApPurchasePurchaseType): InAppPurchaseResponse<InAppPurchaseGetProductResponse>;
|
|
103
|
+
};
|
|
104
|
+
type DeveloperIntegration = {
|
|
105
|
+
closeApp(): void;
|
|
106
|
+
};
|
|
107
|
+
type StorageIntegration = {
|
|
108
|
+
clearWebData(): void;
|
|
109
|
+
};
|
|
110
|
+
type LocationIntegration = object;
|
|
111
|
+
export type Integrations = {
|
|
112
|
+
"AppIntegration": AppIntegration;
|
|
113
|
+
"DeviceIntegration": DeviceIntegration;
|
|
114
|
+
"QrScannerIntegration": QrScannerIntegration;
|
|
115
|
+
"BiometricIntegration": BiometricIntegration;
|
|
116
|
+
"CalendarIntegration": CalendarIntegration;
|
|
117
|
+
"NFCIntegration": NFCIntegration;
|
|
118
|
+
"PushNotificationIntegration": PushNotificationIntegration;
|
|
119
|
+
"ShareIntegration": ShareIntegration;
|
|
120
|
+
"NetworkIntegration": NetworkIntegration;
|
|
121
|
+
"AlternateIconsIntegration": AlternateIconsIntegration;
|
|
122
|
+
"IapIntegration": IapIntegration;
|
|
123
|
+
"DeveloperIntegration": DeveloperIntegration;
|
|
124
|
+
"StorageIntegration": StorageIntegration;
|
|
125
|
+
"LocationIntegration": LocationIntegration;
|
|
126
|
+
};
|
|
127
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type HandleFlowLinkResult = "redirected" | "nothing";
|
|
2
2
|
export declare const handleFlowLink: () => Promise<HandleFlowLinkResult>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { App } from "./integrations/App/AppIntegration";
|
|
2
|
+
import { Biometrics } from "./integrations/Biometrics/BiometricsIntegration";
|
|
3
|
+
import { Developer } from "./integrations/Developer/DeveloperIntegration";
|
|
4
|
+
import { InAppPurchase } from "./integrations/InAppPurchase/InAppPurchaseIntegration";
|
|
5
|
+
import { Network } from "./integrations/Network/NetworkIntegration";
|
|
6
|
+
import { NfcScanner } from "./integrations/NfcScanner/NfcScannerIntegration";
|
|
7
|
+
import { PushNotification } from "./integrations/PushNotification/PushNotificationIntegration";
|
|
8
|
+
import { QrScanner } from "./integrations/QrScanner/QrScannerIntegration";
|
|
9
|
+
import { Share } from "./integrations/Share/ShareIntegration";
|
|
10
|
+
import { Storage } from "./integrations/Storage/StorageIntegration";
|
|
11
|
+
import { Trigger } from "./integrations/Trigger/TriggerIntegration";
|
|
12
|
+
import { User } from "./integrations/User/UserIntegration";
|
|
13
|
+
import { isRunningInApp } from "./utils";
|
|
14
|
+
declare global {
|
|
15
|
+
interface Window {
|
|
16
|
+
startiapp: StartiappClass;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export declare class StartiappClass extends EventTarget {
|
|
21
|
+
private readonly appIntegration;
|
|
22
|
+
App: App;
|
|
23
|
+
Share: Share;
|
|
24
|
+
NfcScanner: NfcScanner;
|
|
25
|
+
QrScanner: QrScanner;
|
|
26
|
+
Biometrics: Biometrics;
|
|
27
|
+
PushNotification: PushNotification;
|
|
28
|
+
Network: Network;
|
|
29
|
+
Developer: Developer | undefined;
|
|
30
|
+
Storage: Storage;
|
|
31
|
+
InAppPurchase: InAppPurchase;
|
|
32
|
+
/** @deprecated Use InAppPurchase instead. */
|
|
33
|
+
Iap: InAppPurchase;
|
|
34
|
+
Trigger: Trigger;
|
|
35
|
+
User: User;
|
|
36
|
+
constructor();
|
|
37
|
+
/**
|
|
38
|
+
* Initializes the app.
|
|
39
|
+
*
|
|
40
|
+
* @returns {Promise<void>} Returns a promise that resolves when the app has been fully initialized.
|
|
41
|
+
*
|
|
42
|
+
* startiapp.addEventListener("ready", () => {}) can be used to listen for the ready event instead of awaiting this method.
|
|
43
|
+
*/
|
|
44
|
+
initialize(options?: InitializeParams): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Checks if the app is running in a starti.app app.
|
|
47
|
+
*
|
|
48
|
+
* @returns {boolean} Returns true if the app is running in a starti.app app, otherwise false.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const isRunningInApp = startiapp.isRunningInApp();
|
|
53
|
+
* console.log(isRunningInApp);
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
isRunningInApp: typeof isRunningInApp;
|
|
57
|
+
addEventListener: typeof EventTarget.prototype.addEventListener;
|
|
58
|
+
private handleAppError;
|
|
59
|
+
private assertIsRunningInAppAndWarn;
|
|
60
|
+
private readyEvent;
|
|
61
|
+
}
|
|
62
|
+
export interface InitializeParams {
|
|
63
|
+
allowZoom?: boolean;
|
|
64
|
+
allowRotation?: boolean;
|
|
65
|
+
allowDrag?: boolean;
|
|
66
|
+
allowScrollBounce?: boolean;
|
|
67
|
+
allowHighligt?: boolean;
|
|
68
|
+
allowSwipeNavigation?: boolean;
|
|
69
|
+
spinner?: Partial<SpinnerOptions>;
|
|
70
|
+
statusBar?: SetStatusBarOptions;
|
|
71
|
+
}
|
|
72
|
+
export type SetStatusBarOptions = SafeAreaSideOptions & {
|
|
73
|
+
hideText: boolean;
|
|
74
|
+
darkContent: boolean;
|
|
75
|
+
advancedSafeAreaOptions?: AdvancedSafeAreaOptions;
|
|
76
|
+
};
|
|
77
|
+
export interface SpinnerOptions {
|
|
78
|
+
afterMilliseconds: number;
|
|
79
|
+
show: boolean;
|
|
80
|
+
color: string;
|
|
81
|
+
excludedDomains: string[];
|
|
82
|
+
}
|
|
83
|
+
export interface AdvancedSafeAreaOptions {
|
|
84
|
+
top?: SafeAreaSideOptions;
|
|
85
|
+
bottom?: SafeAreaSideOptions;
|
|
86
|
+
}
|
|
87
|
+
export type SafeAreaSideOptions = {
|
|
88
|
+
removeSafeArea: false;
|
|
89
|
+
safeAreaBackgroundColor: string;
|
|
90
|
+
} | {
|
|
91
|
+
removeSafeArea: true;
|
|
92
|
+
};
|
|
93
|
+
export type Startiapp = StartiappClass;
|
package/package.json
CHANGED
|
@@ -1,43 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starti.app",
|
|
3
|
-
"
|
|
3
|
+
"author": "starti.app",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"version": "2.0.15",
|
|
4
6
|
"description": "Use this package for easy communication with the starti.app API.",
|
|
5
7
|
"main": "dist/index.js",
|
|
6
8
|
"types": "dist/index.d.ts",
|
|
7
9
|
"files": [
|
|
8
|
-
"
|
|
9
|
-
"/umd"
|
|
10
|
+
"dist"
|
|
10
11
|
],
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"@google-cloud/storage": "^7.10.0",
|
|
13
|
-
"@types/jest": "^29.5.4",
|
|
14
|
-
"@types/mustache": "^4.2.2",
|
|
15
|
-
"@webpack-cli/generators": "^2.5.0",
|
|
16
|
-
"isomorphic-fetch": "^3.0.0",
|
|
17
|
-
"jest": "^29.6.4",
|
|
18
|
-
"jest-environment-jsdom": "^29.6.4",
|
|
19
|
-
"semver": "^7.6.0",
|
|
20
|
-
"ts-jest": "^29.1.1",
|
|
21
|
-
"ts-loader": "^9.4.1",
|
|
22
|
-
"ts-node": "^10.9.1",
|
|
23
|
-
"typescript": "^4.8.4",
|
|
24
|
-
"webpack": "^5.74.0",
|
|
25
|
-
"webpack-cli": "^4.10.0",
|
|
26
|
-
"webpack-dev-server": "^4.15.1"
|
|
27
|
-
},
|
|
28
12
|
"scripts": {
|
|
29
|
-
"build": "
|
|
30
|
-
"
|
|
31
|
-
"build:dev": "webpack --mode=development",
|
|
32
|
-
"build:prod": "webpack --mode=production --node-env=production",
|
|
33
|
-
"watch": "webpack --watch",
|
|
34
|
-
"prerelease": "npm version prerelease --preid=alpha",
|
|
13
|
+
"build:bundle": "webpack --mode=production --node-env=production",
|
|
14
|
+
"build:types": "tsc --declaration --emitDeclarationOnly",
|
|
35
15
|
"test": "jest",
|
|
36
|
-
"
|
|
16
|
+
"lint": "eslint --report-unused-disable-directives --max-warnings 0",
|
|
17
|
+
"publish:bundle": "node ./ci/publish_to_cdn.js"
|
|
37
18
|
},
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@eslint/js": "^9.9.1",
|
|
21
|
+
"@google-cloud/storage": "^7.12.1",
|
|
22
|
+
"@types/jest": "^29.5.12",
|
|
23
|
+
"@types/mustache": "^4.2.5",
|
|
24
|
+
"eslint": "^9.9.1",
|
|
25
|
+
"globals": "^15.9.0",
|
|
26
|
+
"jest": "^29.7.0",
|
|
27
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
28
|
+
"nerdbank-gitversioning": "^3.6.143",
|
|
29
|
+
"semver": "^7.6.3",
|
|
30
|
+
"ts-jest": "^29.2.5",
|
|
31
|
+
"ts-loader": "^9.5.1",
|
|
32
|
+
"ts-node": "^10.9.2",
|
|
33
|
+
"typescript": "^5.5.4",
|
|
34
|
+
"typescript-eslint": "^8.3.0",
|
|
35
|
+
"webpack": "^5.94.0",
|
|
36
|
+
"webpack-cli": "^5.1.4"
|
|
42
37
|
}
|
|
43
38
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare class EventTargetWithType<T extends Record<any, Event>> extends EventTarget {
|
|
2
|
-
addEventListener<K extends keyof T>(type: K, callback: EventListenerOrEventListenerObjectWithType<T[K]>, options?: boolean | AddEventListenerOptions): void;
|
|
3
|
-
removeEventListener<K extends keyof T>(type: K, callback: EventListenerOrEventListenerObjectWithType<T[K]>, options?: boolean | EventListenerOptions): void;
|
|
4
|
-
}
|
|
5
|
-
export declare type EventTargetMethods<T extends Record<any, Event>> = Pick<EventTargetWithType<T>, 'addEventListener' | 'removeEventListener'>;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { IapGetProductResponse, IapPurchaseProductResponse, IapPurchaseType, IapResponse } from "integrations/iap";
|
|
2
|
-
export declare type PushNotificationIntegration = {
|
|
3
|
-
setBadgeCount(count: number): void;
|
|
4
|
-
initialize(): void;
|
|
5
|
-
requestAccess(): void;
|
|
6
|
-
getFCMToken(): void;
|
|
7
|
-
getLastPublishedToken(): void;
|
|
8
|
-
tokenReceivedEvent(token: string): void;
|
|
9
|
-
notificationReceivedEvent(notification: any): void;
|
|
10
|
-
firebasePushNotificationTopicsUnsubscribe(topics: string[]): void;
|
|
11
|
-
firebasePushNotificationSubscribeToTopics(topics: string[]): void;
|
|
12
|
-
};
|
|
13
|
-
export declare type ShareIntegration = {
|
|
14
|
-
shareFile(fileUrl: string, fileName: string): void;
|
|
15
|
-
shareText(text: string): void;
|
|
16
|
-
downloadFile(fileUrl: string, fileName: string): void;
|
|
17
|
-
};
|
|
18
|
-
export declare type QrScannerIntegration = {
|
|
19
|
-
startQrCodeScanner(): void;
|
|
20
|
-
getCameraAccessState(): void;
|
|
21
|
-
isCameraAccessGranted(): void;
|
|
22
|
-
requestCameraAccess(): void;
|
|
23
|
-
};
|
|
24
|
-
export declare type DeviceIntegration = {
|
|
25
|
-
startAccelerometer(): void;
|
|
26
|
-
stopAccelerometer(): void;
|
|
27
|
-
isAccelerometerStarted(): void;
|
|
28
|
-
};
|
|
29
|
-
export declare type AppIntegration = {
|
|
30
|
-
download(url: string, filename: string): void;
|
|
31
|
-
openBrowser(url: string): void;
|
|
32
|
-
setAppUrl(url: string): void;
|
|
33
|
-
getAppUrl(): void;
|
|
34
|
-
resetAppUrl(): void;
|
|
35
|
-
webAppIsReady(): void;
|
|
36
|
-
setNavigationSpinner(options: NavigationSpinnerOptions): void;
|
|
37
|
-
showNavigationSpinner(options?: NavigationSpinnerOptions): void;
|
|
38
|
-
hideNavigationSpinner(): void;
|
|
39
|
-
addExternalDomains(domains: ExternalDomain[]): void;
|
|
40
|
-
removeExternalDomains(domains: ExternalDomain[]): void;
|
|
41
|
-
getExternalDomains(): void;
|
|
42
|
-
disableSwipeNavigation(): void;
|
|
43
|
-
enableSwipeNavigation(): void;
|
|
44
|
-
disableScreenRotation(): void;
|
|
45
|
-
enableScreenRotation(): void;
|
|
46
|
-
getInternalDomains(): void;
|
|
47
|
-
addInternalDomain(domain: string): void;
|
|
48
|
-
removeInternalDomain(domain: string): void;
|
|
49
|
-
setAppIcon(icon: string): void;
|
|
50
|
-
setSafeAreaBackgroundColor(color: string): void;
|
|
51
|
-
hideStatusBar(): void;
|
|
52
|
-
showStatusBar(): void;
|
|
53
|
-
setStatusBar(options: AppIntegrationSetStatusBarOptions): void;
|
|
54
|
-
setCommonScript(script: string): void;
|
|
55
|
-
requestReview(): void;
|
|
56
|
-
brandId(): void;
|
|
57
|
-
deviceId(): void;
|
|
58
|
-
version(): void;
|
|
59
|
-
addExcludedFromHistoryPattern(pattern: RegexDto): void;
|
|
60
|
-
removeExcludedFromHistoryPattern(pattern: RegexDto): void;
|
|
61
|
-
addExcludedFromHistoryDomain(domain: string): void;
|
|
62
|
-
removeExcludedFromHistoryDomain(domain: string): void;
|
|
63
|
-
};
|
|
64
|
-
export declare type BiometricIntegration = {
|
|
65
|
-
startScanning(title: string, reason: string): void;
|
|
66
|
-
getAuthenticationType(): void;
|
|
67
|
-
setSecuredContent(key: string, content: string): void;
|
|
68
|
-
getSecuredContent(key: string, title: string, reason: string): void;
|
|
69
|
-
hasSecuredContent(key: string): void;
|
|
70
|
-
removeSecuredContent(key: string): void;
|
|
71
|
-
};
|
|
72
|
-
export declare type CalendarIntegration = {
|
|
73
|
-
isAccessGranted(): void;
|
|
74
|
-
listCalendars(): void;
|
|
75
|
-
requestAccess(): void;
|
|
76
|
-
addEvent(calendarId: string, title: string, description: string, syncId: string, startDate: Date, endDate: Date): void;
|
|
77
|
-
deleteEvent(eventId: string): void;
|
|
78
|
-
listEvents(calendarId: string, from: Date, to: Date): void;
|
|
79
|
-
};
|
|
80
|
-
export declare type NFCIntegration = {
|
|
81
|
-
isNFCSupported(): void;
|
|
82
|
-
startListening(): void;
|
|
83
|
-
stopListening(): void;
|
|
84
|
-
};
|
|
85
|
-
export declare type NetworkIntegration = {
|
|
86
|
-
sendUdpBroadcast(port: number, message: string): void;
|
|
87
|
-
currentConnectionState(): void;
|
|
88
|
-
startListeningForUdpPackets(port: number): void;
|
|
89
|
-
stopListeningForUdpPackets(): void;
|
|
90
|
-
startListeningForConnectionChanges(): void;
|
|
91
|
-
stopListeningForConnectionChanges(): void;
|
|
92
|
-
};
|
|
93
|
-
export declare type AlternateIconsIntegration = {
|
|
94
|
-
setAppIcon(iconName: string): void;
|
|
95
|
-
getCurrentAppIconName(): void;
|
|
96
|
-
getAvailableAppIconNames(): void;
|
|
97
|
-
};
|
|
98
|
-
export declare type IapIntegration = {
|
|
99
|
-
purchaseProduct(productId: string, purchaseType: IapPurchaseType): IapResponse<IapPurchaseProductResponse>;
|
|
100
|
-
getProduct(productId: string, purchaseType: IapPurchaseType): IapResponse<IapGetProductResponse>;
|
|
101
|
-
};
|
|
102
|
-
export declare type IDeveloperIntegration = {
|
|
103
|
-
closeApp(): void;
|
|
104
|
-
};
|
|
105
|
-
export declare type StorageIntegration = {
|
|
106
|
-
clearWebData(): void;
|
|
107
|
-
};
|
package/dist/@types/types.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare type SpinnerOptions = {
|
|
2
|
-
afterMilliseconds?: number;
|
|
3
|
-
show?: boolean;
|
|
4
|
-
color?: string;
|
|
5
|
-
excludedDomains?: string[];
|
|
6
|
-
};
|
|
7
|
-
export interface InitializeParams {
|
|
8
|
-
allowZoom?: boolean;
|
|
9
|
-
allowRotation?: boolean;
|
|
10
|
-
allowDrag?: boolean;
|
|
11
|
-
allowScrollBounce?: boolean;
|
|
12
|
-
allowHighligt?: boolean;
|
|
13
|
-
allowSwipeNavigation?: boolean;
|
|
14
|
-
spinner?: SpinnerOptions;
|
|
15
|
-
statusBar?: SetStatusBarOptions;
|
|
16
|
-
}
|
|
17
|
-
export declare type SetStatusBarOptions = {
|
|
18
|
-
hideText: boolean;
|
|
19
|
-
darkContent: boolean;
|
|
20
|
-
removeSafeArea?: boolean;
|
|
21
|
-
safeAreaBackgroundColor?: string;
|
|
22
|
-
advancedSafeAreaOptions?: AdvancedSafeAreaOptions;
|
|
23
|
-
};
|
|
24
|
-
export declare type AdvancedSafeAreaOptions = {
|
|
25
|
-
top?: SafeAreaSideOptions;
|
|
26
|
-
bottom?: SafeAreaSideOptions;
|
|
27
|
-
};
|
|
28
|
-
export declare type SafeAreaSideOptions = {
|
|
29
|
-
removeSafeArea: boolean;
|
|
30
|
-
safeAreaBackgroundColor: string;
|
|
31
|
-
};
|
package/dist/app.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { EventTargetMethods } from "./@types/EventHandlerWithTypes";
|
|
2
|
-
import { SetStatusBarOptions, SpinnerOptions } from "./@types/types";
|
|
3
|
-
export declare const App: IApp;
|
|
4
|
-
declare type NavigatingPageEvent = {
|
|
5
|
-
url: string;
|
|
6
|
-
opensExternalbrowser: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare type AppEvents = {
|
|
9
|
-
appInForeground: CustomEvent<never>;
|
|
10
|
-
navigatingPage: CustomEvent<NavigatingPageEvent>;
|
|
11
|
-
};
|
|
12
|
-
export interface IApp extends EventTargetMethods<AppEvents> {
|
|
13
|
-
/** Request the user reviews the app. */
|
|
14
|
-
requestReview: () => void;
|
|
15
|
-
/** Are the site running inside starti.app? Returns false if the site is loaded in a normal browser. */
|
|
16
|
-
isStartiappLoaded(): boolean;
|
|
17
|
-
/** Use this method to control which URL the app load when it is initialized. */
|
|
18
|
-
setAppUrl: (url: string) => void;
|
|
19
|
-
/** Use this method to reset the app to the default URL. */
|
|
20
|
-
resetAppUrl(): void;
|
|
21
|
-
/** Returns the version number of the app (eg. 1.0.0). */
|
|
22
|
-
version(): Promise<string>;
|
|
23
|
-
/** Returns the apps brand ID (eg. 'abc'). */
|
|
24
|
-
brandId(): Promise<string>;
|
|
25
|
-
/** Returns the ID-string of the current device. */
|
|
26
|
-
deviceId(): Promise<string>;
|
|
27
|
-
/** Opens the given URL in the default browser. */
|
|
28
|
-
openExternalBrowser: (url: string) => void;
|
|
29
|
-
/** Show statusbar */
|
|
30
|
-
showStatusBar(): void;
|
|
31
|
-
/** Hide statusbar */
|
|
32
|
-
hideStatusBar(): void;
|
|
33
|
-
/** Set statusbar */
|
|
34
|
-
setStatusBar(options: SetStatusBarOptions): void;
|
|
35
|
-
/** Set common script */
|
|
36
|
-
setCommonScript(script: string): void;
|
|
37
|
-
/** Changes the background color of safe area */
|
|
38
|
-
setSafeAreaBackgroundColor(color: string): Promise<boolean>;
|
|
39
|
-
/** Disable screen rotation */
|
|
40
|
-
disableScreenRotation(): void;
|
|
41
|
-
/** Enable screen rotation */
|
|
42
|
-
enableScreenRotation(): void;
|
|
43
|
-
/** Disable swipe navigation */
|
|
44
|
-
disableSwipeNavigation(): void;
|
|
45
|
-
/** Enable swipe navigation */
|
|
46
|
-
enableSwipeNavigation(): void;
|
|
47
|
-
/** Get internal domains */
|
|
48
|
-
getInternalDomains(): Promise<string[]>;
|
|
49
|
-
/** Add internal domain */
|
|
50
|
-
addInternalDomain(domain: string): void;
|
|
51
|
-
/** Remove internal domain */
|
|
52
|
-
removeInternalDomain(domain: string): void;
|
|
53
|
-
/** Set app icon */
|
|
54
|
-
setAppIcon(iconName: string): void;
|
|
55
|
-
/** Get current icon */
|
|
56
|
-
getCurrentIcon(): Promise<string>;
|
|
57
|
-
/** Get available icons */
|
|
58
|
-
getAvailableIcons(): Promise<string[]>;
|
|
59
|
-
/** Add external domain(s) */
|
|
60
|
-
addExternalDomains(...domains: RegExp[]): void;
|
|
61
|
-
/** Remove external domain(s) */
|
|
62
|
-
removeExternalDomains(...domains: RegExp[]): void;
|
|
63
|
-
/** Get external domains */
|
|
64
|
-
getExternalDomains(): Promise<ExternalDomain[]>;
|
|
65
|
-
/** Sets options for the navigation spinner */
|
|
66
|
-
setSpinner(options: SpinnerOptions): void;
|
|
67
|
-
/** Show navigation spinner */
|
|
68
|
-
showSpinner(options?: SpinnerOptions): void;
|
|
69
|
-
/** Hide navigation spinner */
|
|
70
|
-
hideSpinner(): void;
|
|
71
|
-
/** Add domain to history exclusion */
|
|
72
|
-
addDomainToHistoryExclusion(domain: string): void;
|
|
73
|
-
/** Remove domain from history exclusion */
|
|
74
|
-
removeDomainFromHistoryExclusion(domain: string): void;
|
|
75
|
-
/** Add pattern to history exclusion */
|
|
76
|
-
addPatternToHistoryExclusion(pattern: RegExp): void;
|
|
77
|
-
/** Remove pattern from history exclusion */
|
|
78
|
-
removePatternFromHistoryExclusion(pattern: RegExp): void;
|
|
79
|
-
}
|
|
80
|
-
export {};
|
package/dist/clientUser.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const ClientUser: IClientUser;
|
|
2
|
-
interface RequestUserDeletionOptions {
|
|
3
|
-
prompt?: string;
|
|
4
|
-
confirmation?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface IClientUser {
|
|
7
|
-
/** Register the ID of a logged in client user (end user) */
|
|
8
|
-
registerId(clientUserId: string): Promise<void>;
|
|
9
|
-
/** Unregister the ID of a logged in client user (end user) */
|
|
10
|
-
unregisterId(): Promise<void>;
|
|
11
|
-
/** Request the deletion of the user's account */
|
|
12
|
-
deleteUser(options?: RequestUserDeletionOptions): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
package/dist/getIntegration.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AlternateIconsIntegration, AppIntegration, BiometricIntegration, CalendarIntegration, DeviceIntegration, IDeveloperIntegration, IapIntegration, NFCIntegration, NetworkIntegration, PushNotificationIntegration, QrScannerIntegration, ShareIntegration, StorageIntegration } from "./@types/integrations";
|
|
2
|
-
declare type Integrations = {
|
|
3
|
-
"AppIntegration": AppIntegration;
|
|
4
|
-
"DeviceIntegration": DeviceIntegration;
|
|
5
|
-
"QrScannerIntegration": QrScannerIntegration;
|
|
6
|
-
"BiometricIntegration": BiometricIntegration;
|
|
7
|
-
"CalendarIntegration": CalendarIntegration;
|
|
8
|
-
"NFCIntegration": NFCIntegration;
|
|
9
|
-
"PushNotificationIntegration": PushNotificationIntegration;
|
|
10
|
-
"ShareIntegration": ShareIntegration;
|
|
11
|
-
"NetworkIntegration": NetworkIntegration;
|
|
12
|
-
"AlternateIconsIntegration": AlternateIconsIntegration;
|
|
13
|
-
"IapIntegration": IapIntegration;
|
|
14
|
-
"DeveloperIntegration": IDeveloperIntegration;
|
|
15
|
-
"StorageIntegration": StorageIntegration;
|
|
16
|
-
};
|
|
17
|
-
export declare function getIntegration<T extends keyof Integrations>(integration: T): Integrations[T];
|
|
18
|
-
export {};
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
startiapp = { };
|