@flighthq/host-capacitor 0.5.1-next.920.da8f530 → 0.6.0
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/README.md +3 -3
- package/dist/capacitorApp.d.ts +11 -7
- package/dist/capacitorApp.d.ts.map +1 -1
- package/dist/capacitorApp.js +35 -25
- package/dist/capacitorApp.js.map +1 -1
- package/dist/capacitorClipboard.d.ts +5 -5
- package/dist/capacitorClipboard.d.ts.map +1 -1
- package/dist/capacitorClipboard.js +15 -6
- package/dist/capacitorClipboard.js.map +1 -1
- package/dist/capacitorConnectivity.d.ts +6 -5
- package/dist/capacitorConnectivity.d.ts.map +1 -1
- package/dist/capacitorConnectivity.js +15 -6
- package/dist/capacitorConnectivity.js.map +1 -1
- package/dist/capacitorDefaultHostGroups.d.ts +66 -0
- package/dist/capacitorDefaultHostGroups.d.ts.map +1 -0
- package/dist/capacitorDefaultHostGroups.js +119 -0
- package/dist/capacitorDefaultHostGroups.js.map +1 -0
- package/dist/capacitorDevice.d.ts +3 -3
- package/dist/capacitorDevice.d.ts.map +1 -1
- package/dist/capacitorDevice.js +8 -9
- package/dist/capacitorDevice.js.map +1 -1
- package/dist/capacitorDialog.d.ts +6 -5
- package/dist/capacitorDialog.d.ts.map +1 -1
- package/dist/capacitorDialog.js +16 -11
- package/dist/capacitorDialog.js.map +1 -1
- package/dist/capacitorFileSystem.d.ts +3 -3
- package/dist/capacitorFileSystem.d.ts.map +1 -1
- package/dist/capacitorFileSystem.js +6 -7
- package/dist/capacitorFileSystem.js.map +1 -1
- package/dist/capacitorGeolocation.d.ts +3 -3
- package/dist/capacitorGeolocation.d.ts.map +1 -1
- package/dist/capacitorGeolocation.js +13 -13
- package/dist/capacitorGeolocation.js.map +1 -1
- package/dist/capacitorHaptics.d.ts +3 -3
- package/dist/capacitorHaptics.d.ts.map +1 -1
- package/dist/capacitorHaptics.js +7 -8
- package/dist/capacitorHaptics.js.map +1 -1
- package/dist/capacitorHost.d.ts +4 -0
- package/dist/capacitorHost.d.ts.map +1 -0
- package/dist/capacitorHost.js +71 -0
- package/dist/capacitorHost.js.map +1 -0
- package/dist/capacitorInputHost.d.ts +6 -0
- package/dist/capacitorInputHost.d.ts.map +1 -0
- package/dist/capacitorInputHost.js +20 -0
- package/dist/capacitorInputHost.js.map +1 -0
- package/dist/capacitorKeyboard.d.ts +9 -15
- package/dist/capacitorKeyboard.d.ts.map +1 -1
- package/dist/capacitorKeyboard.js +36 -37
- package/dist/capacitorKeyboard.js.map +1 -1
- package/dist/capacitorNotification.d.ts +9 -3
- package/dist/capacitorNotification.d.ts.map +1 -1
- package/dist/capacitorNotification.js +171 -154
- package/dist/capacitorNotification.js.map +1 -1
- package/dist/capacitorProtocol.d.ts +4 -3
- package/dist/capacitorProtocol.d.ts.map +1 -1
- package/dist/capacitorProtocol.js +6 -9
- package/dist/capacitorProtocol.js.map +1 -1
- package/dist/capacitorShare.d.ts +7 -3
- package/dist/capacitorShare.d.ts.map +1 -1
- package/dist/capacitorShare.js +8 -6
- package/dist/capacitorShare.js.map +1 -1
- package/dist/capacitorStatusBar.d.ts +8 -5
- package/dist/capacitorStatusBar.d.ts.map +1 -1
- package/dist/capacitorStatusBar.js +51 -38
- package/dist/capacitorStatusBar.js.map +1 -1
- package/dist/capacitorStorageHost.d.ts +4 -0
- package/dist/capacitorStorageHost.d.ts.map +1 -0
- package/dist/capacitorStorageHost.js +5 -0
- package/dist/capacitorStorageHost.js.map +1 -0
- package/dist/capacitorSystemHost.d.ts +6 -0
- package/dist/capacitorSystemHost.d.ts.map +1 -0
- package/dist/capacitorSystemHost.js +9 -0
- package/dist/capacitorSystemHost.js.map +1 -0
- package/dist/contract.d.ts +19 -23
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +18 -23
- package/dist/contract.js.map +1 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/types/CapacitorApi.d.ts +308 -0
- package/dist/types/CapacitorApi.d.ts.map +1 -0
- package/dist/types/CapacitorApi.js +35 -0
- package/dist/types/CapacitorApi.js.map +1 -0
- package/dist/types/CapacitorAppCapabilitiesFor.d.ts +6 -0
- package/dist/types/CapacitorAppCapabilitiesFor.d.ts.map +1 -0
- package/dist/types/CapacitorAppCapabilitiesFor.js +2 -0
- package/dist/types/CapacitorAppCapabilitiesFor.js.map +1 -0
- package/dist/types/CapacitorHost.d.ts +94 -0
- package/dist/types/CapacitorHost.d.ts.map +1 -0
- package/dist/types/CapacitorHost.js +2 -0
- package/dist/types/CapacitorHost.js.map +1 -0
- package/dist/types/CapacitorProtocolCapabilities.d.ts +3 -0
- package/dist/types/CapacitorProtocolCapabilities.d.ts.map +1 -0
- package/dist/types/CapacitorProtocolCapabilities.js +2 -0
- package/dist/types/CapacitorProtocolCapabilities.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +46 -15
- package/src/capacitorApp.test.ts +38 -19
- package/src/capacitorClipboard.test.ts +30 -28
- package/src/capacitorConnectivity.test.ts +34 -23
- package/src/capacitorDefaultHostGroups.test.ts +214 -0
- package/src/capacitorDevice.test.ts +18 -30
- package/src/capacitorDialog.test.ts +13 -33
- package/src/capacitorFileSystem.test.ts +30 -37
- package/src/capacitorGeolocation.test.ts +8 -17
- package/src/capacitorHaptics.test.ts +9 -13
- package/src/{capacitorRegister.test.ts → capacitorHost.test.ts} +91 -48
- package/src/capacitorInputHost.test.ts +33 -0
- package/src/capacitorKeyboard.test.ts +38 -89
- package/src/capacitorNotification.test.ts +54 -18
- package/src/capacitorProtocol.test.ts +10 -11
- package/src/capacitorShare.test.ts +15 -17
- package/src/capacitorStatusBar.test.ts +53 -16
- package/src/capacitorStorageHost.test.ts +10 -0
- package/src/capacitorSystemHost.test.ts +28 -0
- package/dist/capacitorRegister.d.ts +0 -5
- package/dist/capacitorRegister.d.ts.map +0 -1
- package/dist/capacitorRegister.js +0 -81
- package/dist/capacitorRegister.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
1
|
+
import type { HostShareContentCapability } from '@flighthq/share/contract';
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { capacitorHostShare, capacitorHostShareContent } from './capacitorShare.ts';
|
|
4
|
+
import type { CapacitorApi } from './types/index.ts';
|
|
5
5
|
|
|
6
6
|
function fakeCapacitor(shareImpl?: () => Promise<{ activityType?: string }>) {
|
|
7
7
|
const shared: Array<{ dialogTitle?: string; title?: string; text?: string; url?: string }> = [];
|
|
@@ -16,36 +16,39 @@ function fakeCapacitor(shareImpl?: () => Promise<{ activityType?: string }>) {
|
|
|
16
16
|
return { capacitor, shared };
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
describe('
|
|
20
|
-
it('
|
|
21
|
-
|
|
19
|
+
describe('capacitorHostShare', () => {
|
|
20
|
+
it('publishes only the content slot', () => {
|
|
21
|
+
const share = capacitorHostShare(fakeCapacitor().capacitor);
|
|
22
|
+
expect(Object.keys(share)).toEqual(['content']);
|
|
22
23
|
});
|
|
24
|
+
});
|
|
23
25
|
|
|
26
|
+
describe('capacitorHostShareContent', () => {
|
|
24
27
|
it('validates meaningful payloads synchronously without an availability cache', () => {
|
|
25
|
-
const backend =
|
|
28
|
+
const backend = capacitorHostShareContent(fakeCapacitor().capacitor);
|
|
26
29
|
expect(backend.canShareContent({ text: 'ready now' })).toBe(true);
|
|
27
30
|
expect(backend.canShareContent({ text: '' })).toBe(false);
|
|
28
31
|
});
|
|
29
32
|
|
|
30
33
|
it('shares title, text, and URL content', async () => {
|
|
31
34
|
const { capacitor, shared } = fakeCapacitor();
|
|
32
|
-
const backend =
|
|
35
|
+
const backend = capacitorHostShareContent(capacitor);
|
|
33
36
|
expect(await backend.shareContent({ title: 'T', url: 'https://flight.dev' })).toBe(true);
|
|
34
37
|
expect(shared[0]).toMatchObject({ title: 'T', url: 'https://flight.dev' });
|
|
35
38
|
});
|
|
36
39
|
|
|
37
40
|
it('keeps chooserTitle on only the concrete Capacitor provider type', async () => {
|
|
38
41
|
const { capacitor, shared } = fakeCapacitor();
|
|
39
|
-
const backend =
|
|
42
|
+
const backend = capacitorHostShareContent(capacitor);
|
|
40
43
|
expect(await backend.shareContent({ text: 'x' }, { chooserTitle: 'Choose an app' })).toBe(true);
|
|
41
44
|
expect(shared[0]?.dialogTitle).toBe('Choose an app');
|
|
42
|
-
const portable:
|
|
45
|
+
const portable: HostShareContentCapability = backend;
|
|
43
46
|
// @ts-expect-error the portable content slot has no Capacitor chooser parameter
|
|
44
47
|
expect(await portable.shareContent({ text: 'x' }, { chooserTitle: 'Choose an app' })).toBe(true);
|
|
45
48
|
});
|
|
46
49
|
|
|
47
50
|
it('maps a completed share to a detailed result with the activity type', async () => {
|
|
48
|
-
const backend =
|
|
51
|
+
const backend = capacitorHostShareContent(fakeCapacitor().capacitor);
|
|
49
52
|
expect(await backend.shareContentWithResult({ text: 'x' })).toEqual({
|
|
50
53
|
activityType: 'com.apple.UIKit.activity.Mail',
|
|
51
54
|
completed: true,
|
|
@@ -54,7 +57,7 @@ describe('createCapacitorShareContentBackend', () => {
|
|
|
54
57
|
});
|
|
55
58
|
|
|
56
59
|
it('reports rejected commands as platform outcomes', async () => {
|
|
57
|
-
const backend =
|
|
60
|
+
const backend = capacitorHostShareContent(
|
|
58
61
|
fakeCapacitor(async () => {
|
|
59
62
|
throw new Error('cancelled');
|
|
60
63
|
}).capacitor,
|
|
@@ -67,8 +70,3 @@ describe('createCapacitorShareContentBackend', () => {
|
|
|
67
70
|
});
|
|
68
71
|
});
|
|
69
72
|
});
|
|
70
|
-
describe('initializeCapacitorShareContentBackend', () => {
|
|
71
|
-
it('is the construction initializer of createCapacitorShareContentBackend', () => {
|
|
72
|
-
expect(typeof initializeCapacitorShareContentBackend).toBe('function');
|
|
73
|
-
});
|
|
74
|
-
});
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { EntityRuntimeKey } from '@flighthq/entity/contract';
|
|
2
|
+
import type { StatusBarInfo } from '@flighthq/statusbar/contract';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
capacitorHostStatusBarColor,
|
|
6
|
+
capacitorHostStatusBarInfo,
|
|
7
|
+
capacitorHostStatusBarOverlays,
|
|
8
|
+
capacitorHostStatusBarStyle,
|
|
9
|
+
capacitorHostStatusBarVisibility,
|
|
10
|
+
capacitorHostStatusBarGroup,
|
|
11
|
+
} from './capacitorStatusBar.ts';
|
|
12
|
+
import type { CapacitorApi } from './types/index.ts';
|
|
5
13
|
|
|
6
14
|
const flush = async () => {
|
|
7
15
|
await Promise.resolve();
|
|
@@ -46,18 +54,27 @@ function blankInfo(): StatusBarInfo {
|
|
|
46
54
|
};
|
|
47
55
|
}
|
|
48
56
|
|
|
49
|
-
describe('
|
|
50
|
-
it('
|
|
51
|
-
expect(EntityRuntimeKey in
|
|
57
|
+
describe('capacitorHostStatusBarColor', () => {
|
|
58
|
+
it('constructs the color provider as a plain frozen object', () => {
|
|
59
|
+
expect(EntityRuntimeKey in capacitorHostStatusBarColor(fakeCapacitor().capacitor)).toBe(false);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe('capacitorHostStatusBarGroup', () => {
|
|
64
|
+
it('publishes the exact status-bar slots over one shared provider', () => {
|
|
65
|
+
const statusBar = capacitorHostStatusBarGroup(fakeCapacitor().capacitor);
|
|
66
|
+
expect(Object.keys(statusBar).sort()).toEqual(['color', 'info', 'overlays', 'style', 'visibility']);
|
|
67
|
+
expect(new Set(Object.values(statusBar))).toHaveLength(1);
|
|
68
|
+
expect(EntityRuntimeKey in statusBar.info).toBe(false);
|
|
52
69
|
});
|
|
53
70
|
|
|
54
71
|
it('maps setters onto the Capacitor plugin', () => {
|
|
55
72
|
const { capacitor, calls } = fakeCapacitor();
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
const statusBar = capacitorHostStatusBarGroup(capacitor);
|
|
74
|
+
statusBar.style.setStyle('light');
|
|
75
|
+
statusBar.color.setBackgroundColor(0x112233ff);
|
|
76
|
+
statusBar.overlays.setOverlaysContent(true);
|
|
77
|
+
statusBar.visibility.setVisible(false);
|
|
61
78
|
expect(calls[0].arg).toEqual({ style: 'Light' });
|
|
62
79
|
expect(calls[1].arg).toEqual({ color: '#112233' });
|
|
63
80
|
expect(calls[2].arg).toEqual({ overlay: true });
|
|
@@ -65,9 +82,10 @@ describe('createCapacitorStatusBarBackend', () => {
|
|
|
65
82
|
});
|
|
66
83
|
|
|
67
84
|
it('fills the info snapshot from the prefetch once it resolves', async () => {
|
|
68
|
-
const backend =
|
|
85
|
+
const backend = capacitorHostStatusBarGroup(fakeCapacitor().capacitor).info;
|
|
69
86
|
await flush();
|
|
70
|
-
const info =
|
|
87
|
+
const info = blankInfo();
|
|
88
|
+
backend.getInfo(info);
|
|
71
89
|
expect(info.visible).toBe(true);
|
|
72
90
|
expect(info.style).toBe('dark');
|
|
73
91
|
expect(info.color).toBe(0x112233ff);
|
|
@@ -75,8 +93,27 @@ describe('createCapacitorStatusBarBackend', () => {
|
|
|
75
93
|
expect(info.height).toBe(-1);
|
|
76
94
|
});
|
|
77
95
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
96
|
+
|
|
97
|
+
describe('capacitorHostStatusBarInfo', () => {
|
|
98
|
+
it('constructs the info provider as a plain frozen object', () => {
|
|
99
|
+
expect(EntityRuntimeKey in capacitorHostStatusBarInfo(fakeCapacitor().capacitor)).toBe(false);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe('capacitorHostStatusBarOverlays', () => {
|
|
104
|
+
it('constructs the overlays provider as a plain frozen object', () => {
|
|
105
|
+
expect(EntityRuntimeKey in capacitorHostStatusBarOverlays(fakeCapacitor().capacitor)).toBe(false);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
describe('capacitorHostStatusBarStyle', () => {
|
|
110
|
+
it('constructs the style provider as a plain frozen object', () => {
|
|
111
|
+
expect(EntityRuntimeKey in capacitorHostStatusBarStyle(fakeCapacitor().capacitor)).toBe(false);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe('capacitorHostStatusBarVisibility', () => {
|
|
116
|
+
it('constructs the visibility provider as a plain frozen object', () => {
|
|
117
|
+
expect(EntityRuntimeKey in capacitorHostStatusBarVisibility(fakeCapacitor().capacitor)).toBe(false);
|
|
81
118
|
});
|
|
82
119
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { capacitorHostFileSystemGroup } from './capacitorStorageHost.ts';
|
|
2
|
+
import type { CapacitorApi } from './types/index.ts';
|
|
3
|
+
|
|
4
|
+
describe('capacitorHostFileSystemGroup', () => {
|
|
5
|
+
it('publishes only the file-system access slot', () => {
|
|
6
|
+
const fileSystem = capacitorHostFileSystemGroup({ filesystem: {} } as unknown as CapacitorApi);
|
|
7
|
+
expect(Object.keys(fileSystem)).toEqual(['access']);
|
|
8
|
+
expect(fileSystem.access.readTextFile).toBeTypeOf('function');
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { capacitorHostDeviceGroup, capacitorHostGeolocationGroup } from './capacitorSystemHost.ts';
|
|
2
|
+
import type { CapacitorApi } from './types/index.ts';
|
|
3
|
+
|
|
4
|
+
function fakeCapacitor(): CapacitorApi {
|
|
5
|
+
return {
|
|
6
|
+
device: {
|
|
7
|
+
getId: async () => ({ identifier: 'device-id' }),
|
|
8
|
+
getInfo: async () => ({}),
|
|
9
|
+
},
|
|
10
|
+
geolocation: {},
|
|
11
|
+
} as unknown as CapacitorApi;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
describe('capacitorHostDeviceGroup', () => {
|
|
15
|
+
it('publishes only the device info slot', () => {
|
|
16
|
+
const device = capacitorHostDeviceGroup(fakeCapacitor());
|
|
17
|
+
expect(Object.keys(device)).toEqual(['info']);
|
|
18
|
+
expect(device.info.getId).toBeTypeOf('function');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('capacitorHostGeolocationGroup', () => {
|
|
23
|
+
it('publishes only the geolocation position slot', () => {
|
|
24
|
+
const geolocation = capacitorHostGeolocationGroup(fakeCapacitor());
|
|
25
|
+
expect(Object.keys(geolocation)).toEqual(['position']);
|
|
26
|
+
expect(geolocation.position.getCurrentPosition).toBeTypeOf('function');
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { CapacitorApi, CapacitorHost, EntityConstruction, MobileOsProfile } from '@flighthq/types/contract';
|
|
2
|
-
export declare function capacitorHost<Profile extends MobileOsProfile>(capacitor: CapacitorApi, profile: Profile): CapacitorHost<Profile>;
|
|
3
|
-
export declare function initializeCapacitorHost<Profile extends MobileOsProfile>(out: EntityConstruction<CapacitorHost<Profile>>, capacitor: CapacitorApi, profile: Profile): void;
|
|
4
|
-
export declare function registerCapacitorBackends<Profile extends MobileOsProfile>(capacitor: CapacitorApi, profile: Profile): CapacitorHost<Profile>;
|
|
5
|
-
//# sourceMappingURL=capacitorRegister.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capacitorRegister.d.ts","sourceRoot":"","sources":["../src/capacitorRegister.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,EAEhB,MAAM,0BAA0B,CAAC;AA0BlC,wBAAgB,aAAa,CAAC,OAAO,SAAS,eAAe,EAC3D,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,OAAO,GACf,aAAa,CAAC,OAAO,CAAC,CAIxB;AAED,wBAAgB,uBAAuB,CAAC,OAAO,SAAS,eAAe,EACrE,GAAG,EAAE,kBAAkB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAC/C,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,OAAO,GACf,IAAI,CAoDN;AAKD,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,eAAe,EACvE,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,OAAO,GACf,aAAa,CAAC,OAAO,CAAC,CAExB"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
2
|
-
import { createCapacitorAppCapabilities } from './capacitorApp';
|
|
3
|
-
import { createCapacitorClipboardBackend } from './capacitorClipboard';
|
|
4
|
-
import { createCapacitorConnectivityBackend } from './capacitorConnectivity';
|
|
5
|
-
import { createCapacitorDeviceBackend } from './capacitorDevice';
|
|
6
|
-
import { createCapacitorMessageDialogBackend, createCapacitorPromptDialogBackend } from './capacitorDialog';
|
|
7
|
-
import { createCapacitorFileSystemBackend } from './capacitorFileSystem';
|
|
8
|
-
import { createCapacitorGeolocationBackend } from './capacitorGeolocation';
|
|
9
|
-
import { createCapacitorHapticsBackend } from './capacitorHaptics';
|
|
10
|
-
import { createCapacitorSoftKeyboardAccessoryBarBackend, createCapacitorSoftKeyboardChangeBackend, createCapacitorSoftKeyboardInfoBackend, createCapacitorSoftKeyboardResizeModeWriteBackend, createCapacitorSoftKeyboardScrollAssistBackend, createCapacitorSoftKeyboardStyleBackend, createCapacitorSoftKeyboardVisibilityBackend, } from './capacitorKeyboard';
|
|
11
|
-
import { createCapacitorNotificationCapabilities } from './capacitorNotification';
|
|
12
|
-
import { createCapacitorProtocolCapabilities } from './capacitorProtocol';
|
|
13
|
-
import { createCapacitorShareContentBackend } from './capacitorShare';
|
|
14
|
-
import { createCapacitorStatusBarBackend } from './capacitorStatusBar';
|
|
15
|
-
// The explicit Capacitor host. Every populated slot below is backed by a real plugin operation; empty
|
|
16
|
-
// groups make unsupported or not-yet-migrated coverage explicit.
|
|
17
|
-
export function capacitorHost(capacitor, profile) {
|
|
18
|
-
const out = allocateEntity();
|
|
19
|
-
initializeCapacitorHost(out, capacitor, profile);
|
|
20
|
-
return finishEntity(out);
|
|
21
|
-
}
|
|
22
|
-
export function initializeCapacitorHost(out, capacitor, profile) {
|
|
23
|
-
const app = createCapacitorAppCapabilities(capacitor, profile);
|
|
24
|
-
const clipboard = createCapacitorClipboardBackend(capacitor);
|
|
25
|
-
const connectivity = createCapacitorConnectivityBackend(capacitor);
|
|
26
|
-
const statusBar = createCapacitorStatusBarBackend(capacitor);
|
|
27
|
-
out.accessibility = {};
|
|
28
|
-
out.app = app;
|
|
29
|
-
out.clipboard = { image: clipboard, text: clipboard };
|
|
30
|
-
out.connectivity = { change: connectivity, status: connectivity };
|
|
31
|
-
out.dialog = {
|
|
32
|
-
message: createCapacitorMessageDialogBackend(capacitor),
|
|
33
|
-
prompt: createCapacitorPromptDialogBackend(capacitor),
|
|
34
|
-
};
|
|
35
|
-
out.graphics = {};
|
|
36
|
-
out.input = {
|
|
37
|
-
haptics: createCapacitorHapticsBackend(capacitor),
|
|
38
|
-
softKeyboardAccessoryBar: createCapacitorSoftKeyboardAccessoryBarBackend(capacitor),
|
|
39
|
-
softKeyboardChange: createCapacitorSoftKeyboardChangeBackend(capacitor),
|
|
40
|
-
softKeyboardInfo: createCapacitorSoftKeyboardInfoBackend(capacitor),
|
|
41
|
-
softKeyboardResizeModeWrite: createCapacitorSoftKeyboardResizeModeWriteBackend(capacitor),
|
|
42
|
-
softKeyboardScrollAssist: createCapacitorSoftKeyboardScrollAssistBackend(capacitor),
|
|
43
|
-
softKeyboardStyle: createCapacitorSoftKeyboardStyleBackend(capacitor),
|
|
44
|
-
softKeyboardVisibility: createCapacitorSoftKeyboardVisibilityBackend(capacitor),
|
|
45
|
-
};
|
|
46
|
-
out.ipc = {};
|
|
47
|
-
out.media = {};
|
|
48
|
-
out.menu = {};
|
|
49
|
-
out.midi = {};
|
|
50
|
-
out.net = {};
|
|
51
|
-
out.notification = createCapacitorNotificationCapabilities(capacitor);
|
|
52
|
-
out.power = {};
|
|
53
|
-
out.protocol = createCapacitorProtocolCapabilities(capacitor);
|
|
54
|
-
out.screen = {};
|
|
55
|
-
out.share = { content: createCapacitorShareContentBackend(capacitor) };
|
|
56
|
-
out.shell = {};
|
|
57
|
-
out.shortcut = {};
|
|
58
|
-
out.storage = { fileSystem: createCapacitorFileSystemBackend(capacitor) };
|
|
59
|
-
out.system = {
|
|
60
|
-
device: createCapacitorDeviceBackend(capacitor),
|
|
61
|
-
geolocation: createCapacitorGeolocationBackend(capacitor),
|
|
62
|
-
};
|
|
63
|
-
out.text = {};
|
|
64
|
-
out.tray = {};
|
|
65
|
-
out.ui = {
|
|
66
|
-
statusBarColor: statusBar,
|
|
67
|
-
statusBarInfo: statusBar,
|
|
68
|
-
statusBarOverlays: statusBar,
|
|
69
|
-
statusBarStyle: statusBar,
|
|
70
|
-
statusBarVisibility: statusBar,
|
|
71
|
-
};
|
|
72
|
-
out.updater = {};
|
|
73
|
-
out.window = finishEntity(allocateEntity());
|
|
74
|
-
}
|
|
75
|
-
// Returns the explicit Capacitor host. Run this once at app startup, passing an object that aggregates
|
|
76
|
-
// the official Capacitor plugin objects the seams use. Pass the returned host to explicit capability
|
|
77
|
-
// operations.
|
|
78
|
-
export function registerCapacitorBackends(capacitor, profile) {
|
|
79
|
-
return capacitorHost(capacitor, profile);
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=capacitorRegister.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capacitorRegister.js","sourceRoot":"","sources":["../src/capacitorRegister.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AASzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAChE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