@sincpro/mobile 0.1.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 +74 -0
- package/dist/adapters/Bluetooth.adapter.d.ts +14 -0
- package/dist/adapters/Bluetooth.adapter.js +100 -0
- package/dist/adapters/Geo.adapter.d.ts +8 -0
- package/dist/adapters/Geo.adapter.js +30 -0
- package/dist/adapters/JsonSerializer.adapter.d.ts +28 -0
- package/dist/adapters/JsonSerializer.adapter.js +47 -0
- package/dist/adapters/Network.adapter.d.ts +4 -0
- package/dist/adapters/Network.adapter.js +13 -0
- package/dist/adapters/ReceiptExporter.adapter.d.ts +19 -0
- package/dist/adapters/ReceiptExporter.adapter.js +142 -0
- package/dist/adapters/repositories/database_table.repository.d.ts +13 -0
- package/dist/adapters/repositories/database_table.repository.js +29 -0
- package/dist/adapters/repositories/domain_event.repository.d.ts +32 -0
- package/dist/adapters/repositories/domain_event.repository.js +147 -0
- package/dist/adapters/repositories/domain_event_dead_letter.repository.d.ts +23 -0
- package/dist/adapters/repositories/domain_event_dead_letter.repository.js +81 -0
- package/dist/adapters/repositories/setting.repository.d.ts +10 -0
- package/dist/adapters/repositories/setting.repository.js +21 -0
- package/dist/adapters/webview.adapter.d.ts +10 -0
- package/dist/adapters/webview.adapter.js +166 -0
- package/dist/domain/connectivity/bluetooth.d.ts +19 -0
- package/dist/domain/connectivity/bluetooth.js +1 -0
- package/dist/domain/connectivity/events.d.ts +17 -0
- package/dist/domain/connectivity/events.js +17 -0
- package/dist/domain/connectivity/geo.d.ts +4 -0
- package/dist/domain/connectivity/geo.js +1 -0
- package/dist/domain/connectivity/index.d.ts +3 -0
- package/dist/domain/connectivity/index.js +3 -0
- package/dist/domain/connectivity/network.d.ts +7 -0
- package/dist/domain/connectivity/network.js +1 -0
- package/dist/domain/database/database.d.ts +16 -0
- package/dist/domain/database/database.js +1 -0
- package/dist/domain/database/index.d.ts +2 -0
- package/dist/domain/database/index.js +2 -0
- package/dist/domain/database/repository.d.ts +19 -0
- package/dist/domain/database/repository.js +1 -0
- package/dist/domain/entity/entity.d.ts +109 -0
- package/dist/domain/entity/entity.js +246 -0
- package/dist/domain/entity/entity_collection.d.ts +396 -0
- package/dist/domain/entity/entity_collection.js +824 -0
- package/dist/domain/entity/index.d.ts +3 -0
- package/dist/domain/entity/index.js +3 -0
- package/dist/domain/entity/value_object.d.ts +12 -0
- package/dist/domain/entity/value_object.js +39 -0
- package/dist/domain/event_sourcing/domain_event.d.ts +58 -0
- package/dist/domain/event_sourcing/domain_event.js +164 -0
- package/dist/domain/event_sourcing/event.d.ts +25 -0
- package/dist/domain/event_sourcing/event.js +25 -0
- package/dist/domain/event_sourcing/event_handler.d.ts +7 -0
- package/dist/domain/event_sourcing/event_handler.js +13 -0
- package/dist/domain/event_sourcing/index.d.ts +2 -0
- package/dist/domain/event_sourcing/index.js +2 -0
- package/dist/domain/events.d.ts +33 -0
- package/dist/domain/events.js +32 -0
- package/dist/domain/icon.d.ts +1 -0
- package/dist/domain/icon.js +1 -0
- package/dist/domain/index.d.ts +9 -0
- package/dist/domain/index.js +9 -0
- package/dist/domain/print/driver_registry.d.ts +4 -0
- package/dist/domain/print/driver_registry.js +29 -0
- package/dist/domain/print/events.d.ts +13 -0
- package/dist/domain/print/events.js +13 -0
- package/dist/domain/print/index.d.ts +2 -0
- package/dist/domain/print/index.js +1 -0
- package/dist/domain/print/printer.d.ts +35 -0
- package/dist/domain/print/printer.js +1 -0
- package/dist/domain/receipt.d.ts +31 -0
- package/dist/domain/receipt.js +1 -0
- package/dist/domain/repositories.d.ts +6 -0
- package/dist/domain/repositories.js +7 -0
- package/dist/domain/settings.d.ts +7 -0
- package/dist/domain/settings.js +1 -0
- package/dist/domain/webview/events.d.ts +11 -0
- package/dist/domain/webview/events.js +11 -0
- package/dist/domain/webview/index.d.ts +1 -0
- package/dist/domain/webview/index.js +1 -0
- package/dist/domain/webview/webview.d.ts +57 -0
- package/dist/domain/webview/webview.js +9 -0
- package/dist/entrypoints/cron/Cron.d.ts +13 -0
- package/dist/entrypoints/cron/Cron.js +57 -0
- package/dist/entrypoints/cron/checkNetworkStatus.cron.d.ts +3 -0
- package/dist/entrypoints/cron/checkNetworkStatus.cron.js +10 -0
- package/dist/entrypoints/db/index.d.ts +2 -0
- package/dist/entrypoints/db/index.js +2 -0
- package/dist/entrypoints/db/migrations.d.ts +10 -0
- package/dist/entrypoints/db/migrations.js +115 -0
- package/dist/entrypoints/db/repositories.d.ts +8 -0
- package/dist/entrypoints/db/repositories.js +34 -0
- package/dist/entrypoints/queue/QueueProcessor.d.ts +12 -0
- package/dist/entrypoints/queue/QueueProcessor.js +75 -0
- package/dist/entrypoints/queue/activateDomain.subscriber.d.ts +7 -0
- package/dist/entrypoints/queue/activateDomain.subscriber.js +15 -0
- package/dist/entrypoints/queue/newAppSettings.handler.d.ts +7 -0
- package/dist/entrypoints/queue/newAppSettings.handler.js +17 -0
- package/dist/entrypoints/queue/printImage.subscriber.d.ts +7 -0
- package/dist/entrypoints/queue/printImage.subscriber.js +14 -0
- package/dist/entrypoints/queue/processWebViewMessage.subscriber.d.ts +7 -0
- package/dist/entrypoints/queue/processWebViewMessage.subscriber.js +23 -0
- package/dist/entrypoints/ui/AppShell.d.ts +15 -0
- package/dist/entrypoints/ui/AppShell.js +58 -0
- package/dist/entrypoints/ui/common_provider.d.ts +35 -0
- package/dist/entrypoints/ui/common_provider.js +244 -0
- package/dist/entrypoints/ui/domain_switcher.d.ts +19 -0
- package/dist/entrypoints/ui/domain_switcher.js +22 -0
- package/dist/entrypoints/ui/theme.d.ts +15 -0
- package/dist/entrypoints/ui/theme.js +16 -0
- package/dist/exceptions.d.ts +22 -0
- package/dist/exceptions.js +60 -0
- package/dist/framework/base_module.d.ts +14 -0
- package/dist/framework/base_module.js +40 -0
- package/dist/framework/createApp.d.ts +6 -0
- package/dist/framework/createApp.js +9 -0
- package/dist/framework/domain_module.d.ts +13 -0
- package/dist/framework/domain_module.js +18 -0
- package/dist/framework/kernel.d.ts +18 -0
- package/dist/framework/kernel.js +60 -0
- package/dist/framework/orchestrator.d.ts +29 -0
- package/dist/framework/orchestrator.js +118 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +11 -0
- package/dist/infrastructure/database/connector.d.ts +13 -0
- package/dist/infrastructure/database/connector.js +165 -0
- package/dist/infrastructure/database/index.d.ts +2 -0
- package/dist/infrastructure/database/index.js +2 -0
- package/dist/infrastructure/database/mapped.d.ts +128 -0
- package/dist/infrastructure/database/mapped.js +174 -0
- package/dist/infrastructure/database/utils.d.ts +10 -0
- package/dist/infrastructure/database/utils.js +35 -0
- package/dist/infrastructure/logger.d.ts +45 -0
- package/dist/infrastructure/logger.js +125 -0
- package/dist/infrastructure/ui/ToastHost.d.ts +1 -0
- package/dist/infrastructure/ui/ToastHost.js +19 -0
- package/dist/infrastructure/ui/UIEventBus.d.ts +12 -0
- package/dist/infrastructure/ui/UIEventBus.js +65 -0
- package/dist/infrastructure/ui/errorHandler.d.ts +1 -0
- package/dist/infrastructure/ui/errorHandler.js +20 -0
- package/dist/infrastructure/ui/events.d.ts +1 -0
- package/dist/infrastructure/ui/events.js +1 -0
- package/dist/infrastructure/workers/CronWorker.d.ts +42 -0
- package/dist/infrastructure/workers/CronWorker.js +143 -0
- package/dist/infrastructure/workers/EventBus.d.ts +67 -0
- package/dist/infrastructure/workers/EventBus.js +279 -0
- package/dist/infrastructure/workers/index.d.ts +2 -0
- package/dist/infrastructure/workers/index.js +2 -0
- package/dist/services/bluetooth.service.d.ts +14 -0
- package/dist/services/bluetooth.service.js +72 -0
- package/dist/services/database_table.service.d.ts +8 -0
- package/dist/services/database_table.service.js +19 -0
- package/dist/services/dead_letter_queue.service.d.ts +38 -0
- package/dist/services/dead_letter_queue.service.js +99 -0
- package/dist/services/event.service.d.ts +7 -0
- package/dist/services/event.service.js +24 -0
- package/dist/services/network.service.d.ts +7 -0
- package/dist/services/network.service.js +43 -0
- package/dist/services/printer.service.d.ts +25 -0
- package/dist/services/printer.service.js +220 -0
- package/dist/services/webview.service.d.ts +17 -0
- package/dist/services/webview.service.js +59 -0
- package/dist/tools/utils/Initials.d.ts +1 -0
- package/dist/tools/utils/Initials.js +12 -0
- package/dist/tools/utils/collections.d.ts +120 -0
- package/dist/tools/utils/collections.js +158 -0
- package/dist/tools/utils/date.d.ts +70 -0
- package/dist/tools/utils/date.js +126 -0
- package/dist/tools/utils/maps.d.ts +4 -0
- package/dist/tools/utils/maps.js +20 -0
- package/dist/tools/utils/monetary.d.ts +3 -0
- package/dist/tools/utils/monetary.js +31 -0
- package/dist/tools/utils/quantity.d.ts +11 -0
- package/dist/tools/utils/quantity.js +44 -0
- package/dist/tools/utils/searchTools.d.ts +39 -0
- package/dist/tools/utils/searchTools.js +56 -0
- package/dist/tools/utils/serializer.d.ts +2 -0
- package/dist/tools/utils/serializer.js +44 -0
- package/dist/ui/components/atoms/DebugBanner.d.ts +2 -0
- package/dist/ui/components/atoms/DebugBanner.js +15 -0
- package/dist/ui/components/atoms/index.d.ts +1 -0
- package/dist/ui/components/atoms/index.js +1 -0
- package/dist/ui/components/molecules/BluetoothDeviceSelectorModal.d.ts +8 -0
- package/dist/ui/components/molecules/BluetoothDeviceSelectorModal.js +61 -0
- package/dist/ui/components/molecules/DeadLetterErrorBlock.d.ts +8 -0
- package/dist/ui/components/molecules/DeadLetterErrorBlock.js +14 -0
- package/dist/ui/components/molecules/EventTimelineItem.d.ts +7 -0
- package/dist/ui/components/molecules/EventTimelineItem.js +65 -0
- package/dist/ui/components/molecules/ProcessToast.d.ts +5 -0
- package/dist/ui/components/molecules/ProcessToast.js +51 -0
- package/dist/ui/components/molecules/ProcessToastProvider.d.ts +4 -0
- package/dist/ui/components/molecules/ProcessToastProvider.js +5 -0
- package/dist/ui/components/molecules/index.d.ts +5 -0
- package/dist/ui/components/molecules/index.js +5 -0
- package/dist/ui/components/organisms/BluetoothPrinterSelector.d.ts +7 -0
- package/dist/ui/components/organisms/BluetoothPrinterSelector.js +92 -0
- package/dist/ui/components/organisms/DatabaseInfoRow.d.ts +11 -0
- package/dist/ui/components/organisms/DatabaseInfoRow.js +8 -0
- package/dist/ui/components/organisms/DeadLetterQueueRow.d.ts +7 -0
- package/dist/ui/components/organisms/DeadLetterQueueRow.js +72 -0
- package/dist/ui/components/organisms/EventRow.d.ts +7 -0
- package/dist/ui/components/organisms/EventRow.js +90 -0
- package/dist/ui/components/organisms/InjectableWebView.d.ts +35 -0
- package/dist/ui/components/organisms/InjectableWebView.js +169 -0
- package/dist/ui/components/organisms/Receipt.d.ts +11 -0
- package/dist/ui/components/organisms/Receipt.js +207 -0
- package/dist/ui/components/organisms/TableInfoInfoRow.d.ts +9 -0
- package/dist/ui/components/organisms/TableInfoInfoRow.js +19 -0
- package/dist/ui/components/organisms/index.d.ts +7 -0
- package/dist/ui/components/organisms/index.js +7 -0
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.js +4 -0
- package/dist/ui/layouts/router_layouts.d.ts +17 -0
- package/dist/ui/layouts/router_layouts.js +20 -0
- package/dist/ui/screens/database/database.context.d.ts +32 -0
- package/dist/ui/screens/database/database.context.js +158 -0
- package/dist/ui/screens/database/database.json_detail.d.ts +2 -0
- package/dist/ui/screens/database/database.json_detail.js +19 -0
- package/dist/ui/screens/database/database.list.d.ts +1 -0
- package/dist/ui/screens/database/database.list.js +41 -0
- package/dist/ui/screens/database/database.table_rows.d.ts +2 -0
- package/dist/ui/screens/database/database.table_rows.js +10 -0
- package/dist/ui/screens/dead_letter_queue/dead_letter_queue.context.d.ts +34 -0
- package/dist/ui/screens/dead_letter_queue/dead_letter_queue.context.js +166 -0
- package/dist/ui/screens/dead_letter_queue/dead_letter_queue.list.d.ts +2 -0
- package/dist/ui/screens/dead_letter_queue/dead_letter_queue.list.js +24 -0
- package/dist/ui/screens/events/events.context.d.ts +25 -0
- package/dist/ui/screens/events/events.context.js +113 -0
- package/dist/ui/screens/events/events.list.d.ts +1 -0
- package/dist/ui/screens/events/events.list.js +26 -0
- package/dist/ui/screens/events/index.d.ts +1 -0
- package/dist/ui/screens/events/index.js +1 -0
- package/dist/ui/screens/index.d.ts +3 -0
- package/dist/ui/screens/index.js +3 -0
- package/package.json +125 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface TimezoneLocale {
|
|
3
|
+
timezone: string;
|
|
4
|
+
locale: string;
|
|
5
|
+
}
|
|
6
|
+
interface Activity {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
type: "queue" | "cron";
|
|
10
|
+
status: "running" | "failed";
|
|
11
|
+
error?: string;
|
|
12
|
+
startedAt: number;
|
|
13
|
+
}
|
|
14
|
+
interface ICommonContext {
|
|
15
|
+
debugMode: boolean;
|
|
16
|
+
debugModeLoaded: boolean;
|
|
17
|
+
toggleDebugMode: () => Promise<void>;
|
|
18
|
+
currentActivity?: Activity;
|
|
19
|
+
lastError?: Activity;
|
|
20
|
+
isProcessing: boolean;
|
|
21
|
+
dismiss: () => void;
|
|
22
|
+
hasGeoPermission: boolean;
|
|
23
|
+
geoIsLoading: boolean;
|
|
24
|
+
geoError: string | null;
|
|
25
|
+
checkGeoPermission: () => Promise<void>;
|
|
26
|
+
requestGeoPermission: () => Promise<boolean>;
|
|
27
|
+
timezone: string | null;
|
|
28
|
+
updateTimezone: (tz: TimezoneLocale) => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
interface CommonProviderProps {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare function CommonProvider({ children }: CommonProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare function useCommon(): ICommonContext;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
+
import { GeoAdapter } from "../../adapters/Geo.adapter";
|
|
3
|
+
import { SettingsRepository } from "../../adapters/repositories/setting.repository";
|
|
4
|
+
import { QueueEndEvent, QueueStartEvent } from "../../domain/events";
|
|
5
|
+
import logger, { loggerUseCases } from "../../infrastructure/logger";
|
|
6
|
+
import { UIEventBus } from "../../infrastructure/ui/UIEventBus";
|
|
7
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
8
|
+
const DEBUG_MODE_SETTING_KEY = "app.debug_mode";
|
|
9
|
+
const TIMEZONE_SETTING_KEY = "app.timezone";
|
|
10
|
+
const LOCALE_SETTING_KEY = "app.locale";
|
|
11
|
+
const QUEUE_MIN_VISIBLE_MS = 1200;
|
|
12
|
+
const CommonContext = createContext(null);
|
|
13
|
+
export function CommonProvider({ children }) {
|
|
14
|
+
const [debugMode, setDebugMode] = useState(false);
|
|
15
|
+
const [debugModeLoaded, setDebugModeLoaded] = useState(false);
|
|
16
|
+
const [currentActivity, setCurrentActivity] = useState(undefined);
|
|
17
|
+
const [cronTasks, setCronTasks] = useState(new Map());
|
|
18
|
+
const [lastError, setLastError] = useState(undefined);
|
|
19
|
+
const [dismissed, setDismissed] = useState(false);
|
|
20
|
+
const [hasGeoPermission, setHasGeoPermission] = useState(false);
|
|
21
|
+
const [geoIsLoading, setGeoIsLoading] = useState(false);
|
|
22
|
+
const [geoError, setGeoError] = useState(null);
|
|
23
|
+
const [timezone, setTimezone] = useState(null);
|
|
24
|
+
const errorTimeoutRef = useRef(null);
|
|
25
|
+
const queueClearTimeoutRef = useRef(null);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
async function loadDebugMode() {
|
|
28
|
+
const value = await SettingsRepository.getSettingByName(DEBUG_MODE_SETTING_KEY);
|
|
29
|
+
setDebugMode(value === true);
|
|
30
|
+
setDebugModeLoaded(true);
|
|
31
|
+
}
|
|
32
|
+
loadDebugMode();
|
|
33
|
+
}, []);
|
|
34
|
+
const toggleDebugMode = useCallback(async () => {
|
|
35
|
+
const newValue = !debugMode;
|
|
36
|
+
await SettingsRepository.saveOneSetting(DEBUG_MODE_SETTING_KEY, newValue);
|
|
37
|
+
setDebugMode(newValue);
|
|
38
|
+
}, [debugMode]);
|
|
39
|
+
const dismiss = useCallback(() => {
|
|
40
|
+
setDismissed(true);
|
|
41
|
+
setLastError(undefined);
|
|
42
|
+
if (errorTimeoutRef.current) {
|
|
43
|
+
clearTimeout(errorTimeoutRef.current);
|
|
44
|
+
errorTimeoutRef.current = null;
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
const checkGeoPermission = useCallback(async () => {
|
|
48
|
+
setGeoIsLoading(true);
|
|
49
|
+
setGeoError(null);
|
|
50
|
+
try {
|
|
51
|
+
const granted = await GeoAdapter.hasPermission();
|
|
52
|
+
setHasGeoPermission(granted);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
setGeoError(error.message);
|
|
56
|
+
setHasGeoPermission(false);
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
setGeoIsLoading(false);
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
62
|
+
const requestGeoPermission = useCallback(async () => {
|
|
63
|
+
setGeoIsLoading(true);
|
|
64
|
+
setGeoError(null);
|
|
65
|
+
try {
|
|
66
|
+
const granted = await GeoAdapter.requestPermission();
|
|
67
|
+
setHasGeoPermission(granted);
|
|
68
|
+
return granted;
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
setGeoError(error.message);
|
|
72
|
+
setHasGeoPermission(false);
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
setGeoIsLoading(false);
|
|
77
|
+
}
|
|
78
|
+
}, []);
|
|
79
|
+
const updateTimezone = useCallback(async (tz) => {
|
|
80
|
+
try {
|
|
81
|
+
await SettingsRepository.saveOneSetting(TIMEZONE_SETTING_KEY, tz.timezone);
|
|
82
|
+
await SettingsRepository.saveOneSetting(LOCALE_SETTING_KEY, tz.locale);
|
|
83
|
+
setTimezone(tz.timezone);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
logger.warn(error);
|
|
87
|
+
}
|
|
88
|
+
}, []);
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
async function loadTimezone() {
|
|
91
|
+
try {
|
|
92
|
+
const timezoneResult = await SettingsRepository.getSettingByName(TIMEZONE_SETTING_KEY);
|
|
93
|
+
setTimezone(timezoneResult);
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
logger.warn("Failed to load timezone", error);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
loadTimezone();
|
|
100
|
+
}, []);
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
loggerUseCases.debug("[CommonProvider] Setting up UIEventBus listeners");
|
|
103
|
+
function handleQueueStart(payload) {
|
|
104
|
+
if (!payload || typeof payload !== "object")
|
|
105
|
+
return;
|
|
106
|
+
const { event, label } = payload;
|
|
107
|
+
if (!label)
|
|
108
|
+
return;
|
|
109
|
+
setCurrentActivity({
|
|
110
|
+
id: event,
|
|
111
|
+
label,
|
|
112
|
+
type: "queue",
|
|
113
|
+
status: "running",
|
|
114
|
+
startedAt: Date.now(),
|
|
115
|
+
});
|
|
116
|
+
setDismissed(false);
|
|
117
|
+
}
|
|
118
|
+
function handleQueueEnd(payload) {
|
|
119
|
+
if (!payload || typeof payload !== "object")
|
|
120
|
+
return;
|
|
121
|
+
const { event, success = true, error } = payload;
|
|
122
|
+
setCurrentActivity((current) => {
|
|
123
|
+
if (current?.id !== event)
|
|
124
|
+
return current;
|
|
125
|
+
if (!success) {
|
|
126
|
+
const failedActivity = { ...current, status: "failed", error };
|
|
127
|
+
setLastError(failedActivity);
|
|
128
|
+
if (errorTimeoutRef.current)
|
|
129
|
+
clearTimeout(errorTimeoutRef.current);
|
|
130
|
+
errorTimeoutRef.current = setTimeout(() => {
|
|
131
|
+
setLastError(undefined);
|
|
132
|
+
errorTimeoutRef.current = null;
|
|
133
|
+
}, 10000);
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
// Éxito: mantener visible un mínimo para que la cola sea perceptible
|
|
137
|
+
// aunque el evento se procese al instante.
|
|
138
|
+
const remaining = QUEUE_MIN_VISIBLE_MS - (Date.now() - current.startedAt);
|
|
139
|
+
if (remaining > 0) {
|
|
140
|
+
if (queueClearTimeoutRef.current)
|
|
141
|
+
clearTimeout(queueClearTimeoutRef.current);
|
|
142
|
+
queueClearTimeoutRef.current = setTimeout(() => {
|
|
143
|
+
setCurrentActivity((c) => (c?.id === event ? undefined : c));
|
|
144
|
+
queueClearTimeoutRef.current = null;
|
|
145
|
+
}, remaining);
|
|
146
|
+
return current;
|
|
147
|
+
}
|
|
148
|
+
return undefined;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function handleCronStart(payload) {
|
|
152
|
+
if (!payload || typeof payload !== "object" || !("task" in payload))
|
|
153
|
+
return;
|
|
154
|
+
const { task } = payload;
|
|
155
|
+
setCronTasks((prev) => {
|
|
156
|
+
const next = new Map(prev);
|
|
157
|
+
next.set(task, {
|
|
158
|
+
id: task,
|
|
159
|
+
label: task,
|
|
160
|
+
type: "cron",
|
|
161
|
+
status: "running",
|
|
162
|
+
startedAt: Date.now(),
|
|
163
|
+
});
|
|
164
|
+
return next;
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function handleCronEnd(payload) {
|
|
168
|
+
if (!payload || typeof payload !== "object" || !("task" in payload))
|
|
169
|
+
return;
|
|
170
|
+
const { task } = payload;
|
|
171
|
+
setCronTasks((prev) => {
|
|
172
|
+
const next = new Map(prev);
|
|
173
|
+
next.delete(task);
|
|
174
|
+
return next;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
const unsubscribers = [
|
|
178
|
+
UIEventBus.on(QueueStartEvent.name, handleQueueStart),
|
|
179
|
+
UIEventBus.on(QueueEndEvent.name, handleQueueEnd),
|
|
180
|
+
UIEventBus.on("CRON_START", handleCronStart),
|
|
181
|
+
UIEventBus.on("CRON_END", handleCronEnd),
|
|
182
|
+
];
|
|
183
|
+
return () => {
|
|
184
|
+
loggerUseCases.debug("[CommonProvider] Cleaning up UIEventBus listeners");
|
|
185
|
+
unsubscribers.forEach((unsub) => unsub());
|
|
186
|
+
if (errorTimeoutRef.current)
|
|
187
|
+
clearTimeout(errorTimeoutRef.current);
|
|
188
|
+
if (queueClearTimeoutRef.current)
|
|
189
|
+
clearTimeout(queueClearTimeoutRef.current);
|
|
190
|
+
};
|
|
191
|
+
}, []);
|
|
192
|
+
const displayActivity = useMemo(() => {
|
|
193
|
+
if (currentActivity)
|
|
194
|
+
return currentActivity;
|
|
195
|
+
const firstCron = cronTasks.values().next().value;
|
|
196
|
+
if (firstCron)
|
|
197
|
+
return firstCron;
|
|
198
|
+
return undefined;
|
|
199
|
+
}, [currentActivity, cronTasks]);
|
|
200
|
+
const isProcessing = useMemo(() => {
|
|
201
|
+
if (dismissed)
|
|
202
|
+
return false;
|
|
203
|
+
return !!(currentActivity || cronTasks.size > 0 || lastError);
|
|
204
|
+
}, [currentActivity, cronTasks, lastError, dismissed]);
|
|
205
|
+
const value = useMemo(() => ({
|
|
206
|
+
debugMode,
|
|
207
|
+
debugModeLoaded,
|
|
208
|
+
toggleDebugMode,
|
|
209
|
+
currentActivity: displayActivity,
|
|
210
|
+
lastError,
|
|
211
|
+
isProcessing,
|
|
212
|
+
dismiss,
|
|
213
|
+
hasGeoPermission,
|
|
214
|
+
geoIsLoading,
|
|
215
|
+
geoError,
|
|
216
|
+
checkGeoPermission,
|
|
217
|
+
requestGeoPermission,
|
|
218
|
+
timezone,
|
|
219
|
+
updateTimezone,
|
|
220
|
+
}), [
|
|
221
|
+
debugMode,
|
|
222
|
+
debugModeLoaded,
|
|
223
|
+
toggleDebugMode,
|
|
224
|
+
displayActivity,
|
|
225
|
+
lastError,
|
|
226
|
+
isProcessing,
|
|
227
|
+
dismiss,
|
|
228
|
+
hasGeoPermission,
|
|
229
|
+
geoIsLoading,
|
|
230
|
+
geoError,
|
|
231
|
+
checkGeoPermission,
|
|
232
|
+
requestGeoPermission,
|
|
233
|
+
timezone,
|
|
234
|
+
updateTimezone,
|
|
235
|
+
]);
|
|
236
|
+
return _jsx(CommonContext.Provider, { value: value, children: children });
|
|
237
|
+
}
|
|
238
|
+
export function useCommon() {
|
|
239
|
+
const ctx = useContext(CommonContext);
|
|
240
|
+
if (!ctx) {
|
|
241
|
+
throw new Error("useCommon must be used within CommonProvider");
|
|
242
|
+
}
|
|
243
|
+
return ctx;
|
|
244
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
export interface DomainApp {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
component: ComponentType;
|
|
6
|
+
}
|
|
7
|
+
interface DomainSwitcherValue {
|
|
8
|
+
activeDomain: string;
|
|
9
|
+
setActiveDomain: (key: string) => void;
|
|
10
|
+
apps: DomainApp[];
|
|
11
|
+
}
|
|
12
|
+
export declare function DomainSwitcherProvider(props: {
|
|
13
|
+
apps: DomainApp[];
|
|
14
|
+
initialDomain: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function useDomainSwitcher(): DomainSwitcherValue;
|
|
18
|
+
export declare function ActiveDomainApp(): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useState, } from "react";
|
|
3
|
+
const DomainSwitcherContext = createContext(null);
|
|
4
|
+
export function DomainSwitcherProvider(props) {
|
|
5
|
+
const [activeDomain, setActiveDomain] = useState(props.initialDomain);
|
|
6
|
+
return (_jsx(DomainSwitcherContext.Provider, { value: { activeDomain, setActiveDomain, apps: props.apps }, children: props.children }));
|
|
7
|
+
}
|
|
8
|
+
export function useDomainSwitcher() {
|
|
9
|
+
const context = useContext(DomainSwitcherContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error("useDomainSwitcher must be used within AppShell");
|
|
12
|
+
}
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
export function ActiveDomainApp() {
|
|
16
|
+
const { activeDomain, apps } = useDomainSwitcher();
|
|
17
|
+
const app = apps.find((entry) => entry.key === activeDomain);
|
|
18
|
+
if (!app)
|
|
19
|
+
return null;
|
|
20
|
+
const Component = app.component;
|
|
21
|
+
return _jsx(Component, {});
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type DeepPartial, type ThemeTokens } from "@sincpro/mobile-ui/theme";
|
|
2
|
+
/**
|
|
3
|
+
* API simple y extensible para que los clientes definan su theme.
|
|
4
|
+
* Parte de los defaults del framework y aplica overrides parciales (tipados).
|
|
5
|
+
*
|
|
6
|
+
* createApp({
|
|
7
|
+
* theme: createTheme({ primary: "#FF6600", bg: { page: "#141414" } }),
|
|
8
|
+
* domains: [...],
|
|
9
|
+
* });
|
|
10
|
+
*
|
|
11
|
+
* El resultado se inyecta una vez al bootstrap (estático, sin runtime switching)
|
|
12
|
+
* y propaga tanto a `className` (CSS vars) como a `style={theme.x}`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createTheme(overrides?: DeepPartial<ThemeTokens>): ThemeTokens;
|
|
15
|
+
export type { DeepPartial, ThemeTokens };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { extendTheme } from "@sincpro/mobile-ui/theme";
|
|
2
|
+
/**
|
|
3
|
+
* API simple y extensible para que los clientes definan su theme.
|
|
4
|
+
* Parte de los defaults del framework y aplica overrides parciales (tipados).
|
|
5
|
+
*
|
|
6
|
+
* createApp({
|
|
7
|
+
* theme: createTheme({ primary: "#FF6600", bg: { page: "#141414" } }),
|
|
8
|
+
* domains: [...],
|
|
9
|
+
* });
|
|
10
|
+
*
|
|
11
|
+
* El resultado se inyecta una vez al bootstrap (estático, sin runtime switching)
|
|
12
|
+
* y propaga tanto a `className` (CSS vars) como a `style={theme.x}`.
|
|
13
|
+
*/
|
|
14
|
+
export function createTheme(overrides) {
|
|
15
|
+
return extendTheme(overrides);
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare class DomainException extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class DomainUserError extends DomainException {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare class DomainValidationError extends DomainException {
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class DomainNetworkError extends DomainException {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
export declare class DomainBackendError extends DomainException {
|
|
14
|
+
constructor(message: string);
|
|
15
|
+
}
|
|
16
|
+
export declare class DomainAppError extends DomainException {
|
|
17
|
+
constructor(message: string);
|
|
18
|
+
}
|
|
19
|
+
export declare const ValidationError: (message: string) => never;
|
|
20
|
+
export declare const UserError: (message: string) => never;
|
|
21
|
+
export declare const BackendError: (message: string) => never;
|
|
22
|
+
export declare const AppError: (message: string) => never;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export class DomainException extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = "DomainException";
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class DomainUserError extends DomainException {
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "UserError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class DomainValidationError extends DomainException {
|
|
14
|
+
constructor(message) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = "ValidationError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class DomainNetworkError extends DomainException {
|
|
20
|
+
constructor(message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.name = "NetworkError";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export class DomainBackendError extends DomainException {
|
|
26
|
+
constructor(message) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.name = "BackendError";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export class DomainAppError extends DomainException {
|
|
32
|
+
constructor(message) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.name = "AppError";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export const ValidationError = (message) => {
|
|
38
|
+
// setTimeout(() => {
|
|
39
|
+
// throw new DomainValidationError(message);
|
|
40
|
+
// }, 0);
|
|
41
|
+
throw new DomainValidationError(message);
|
|
42
|
+
};
|
|
43
|
+
export const UserError = (message) => {
|
|
44
|
+
// setTimeout(() => {
|
|
45
|
+
// throw new DomainUserError(message);
|
|
46
|
+
// }, 0);
|
|
47
|
+
throw new DomainUserError(message);
|
|
48
|
+
};
|
|
49
|
+
export const BackendError = (message) => {
|
|
50
|
+
// setTimeout(() => {
|
|
51
|
+
// throw new DomainBackendError(message);
|
|
52
|
+
// }, 0);
|
|
53
|
+
throw new DomainBackendError(message);
|
|
54
|
+
};
|
|
55
|
+
export const AppError = (message) => {
|
|
56
|
+
// setTimeout(() => {
|
|
57
|
+
// throw new DomainAppError(message);
|
|
58
|
+
// }, 0);
|
|
59
|
+
throw new DomainAppError(message);
|
|
60
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IMigration } from "../domain/database";
|
|
2
|
+
import type { Subscriber } from "../domain/event_sourcing";
|
|
3
|
+
import type { CronWorker } from "../infrastructure/workers";
|
|
4
|
+
import { DomainModule } from "./domain_module";
|
|
5
|
+
export declare class BaseModule extends DomainModule {
|
|
6
|
+
readonly key = "COMMON";
|
|
7
|
+
readonly name = "Common";
|
|
8
|
+
readonly shared = true;
|
|
9
|
+
repositories(): Record<string, object>;
|
|
10
|
+
migrations(): IMigration[];
|
|
11
|
+
subscribers(): Subscriber[];
|
|
12
|
+
crons(): CronWorker[];
|
|
13
|
+
}
|
|
14
|
+
export declare const baseModule: BaseModule;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DatabaseTableRepository } from "../adapters/repositories/database_table.repository";
|
|
2
|
+
import { DomainEventRepository } from "../adapters/repositories/domain_event.repository";
|
|
3
|
+
import { DomainEventDeadLetterRepository } from "../adapters/repositories/domain_event_dead_letter.repository";
|
|
4
|
+
import { SettingsRepository } from "../adapters/repositories/setting.repository";
|
|
5
|
+
import { ECommonRepository } from "../domain/repositories";
|
|
6
|
+
import cronCheckNetworkStatus from "../entrypoints/cron/checkNetworkStatus.cron";
|
|
7
|
+
import MIGRATIONS from "../entrypoints/db/migrations";
|
|
8
|
+
import { ActivateDomainSubscriber } from "../entrypoints/queue/activateDomain.subscriber";
|
|
9
|
+
import { NewAppSettingsSubscriber } from "../entrypoints/queue/newAppSettings.handler";
|
|
10
|
+
import { PrintImageSubscriber } from "../entrypoints/queue/printImage.subscriber";
|
|
11
|
+
import { ProcessWebViewMessageSubscriber } from "../entrypoints/queue/processWebViewMessage.subscriber";
|
|
12
|
+
import { DomainModule } from "./domain_module";
|
|
13
|
+
export class BaseModule extends DomainModule {
|
|
14
|
+
key = "COMMON";
|
|
15
|
+
name = "Common";
|
|
16
|
+
shared = true;
|
|
17
|
+
repositories() {
|
|
18
|
+
return {
|
|
19
|
+
[ECommonRepository.DATABASE_TABLE]: DatabaseTableRepository,
|
|
20
|
+
[ECommonRepository.DOMAIN_EVENT]: DomainEventRepository,
|
|
21
|
+
[ECommonRepository.DOMAIN_EVENT_DEAD_LETTER]: DomainEventDeadLetterRepository,
|
|
22
|
+
[ECommonRepository.SETTINGS]: SettingsRepository,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
migrations() {
|
|
26
|
+
return MIGRATIONS;
|
|
27
|
+
}
|
|
28
|
+
subscribers() {
|
|
29
|
+
return [
|
|
30
|
+
new ActivateDomainSubscriber(),
|
|
31
|
+
new ProcessWebViewMessageSubscriber(),
|
|
32
|
+
new PrintImageSubscriber(),
|
|
33
|
+
new NewAppSettingsSubscriber(),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
crons() {
|
|
37
|
+
return [cronCheckNetworkStatus];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export const baseModule = new BaseModule();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { baseModule } from "./base_module";
|
|
2
|
+
import { Kernel } from "./kernel";
|
|
3
|
+
import { orchestrator } from "./orchestrator";
|
|
4
|
+
export async function createApp(config = {}) {
|
|
5
|
+
const kernel = new Kernel([baseModule, ...(config.domains ?? [])]);
|
|
6
|
+
orchestrator.configure(kernel);
|
|
7
|
+
await orchestrator.bootstrap();
|
|
8
|
+
return kernel;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IMigration } from "../domain/database";
|
|
2
|
+
import type { Subscriber } from "../domain/event_sourcing";
|
|
3
|
+
import type { CronWorker } from "../infrastructure/workers";
|
|
4
|
+
export declare abstract class DomainModule {
|
|
5
|
+
abstract readonly key: string;
|
|
6
|
+
abstract readonly name: string;
|
|
7
|
+
readonly shared: boolean;
|
|
8
|
+
repositories(): Record<string, object>;
|
|
9
|
+
migrations(): IMigration[];
|
|
10
|
+
subscribers(): Subscriber[];
|
|
11
|
+
crons(): CronWorker[];
|
|
12
|
+
persistOnReset(): string[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IMigration } from "../domain/database";
|
|
2
|
+
import type { Subscriber } from "../domain/event_sourcing";
|
|
3
|
+
import type { CronWorker } from "../infrastructure/workers";
|
|
4
|
+
import type { DomainModule } from "./domain_module";
|
|
5
|
+
export declare class Kernel {
|
|
6
|
+
private readonly modules;
|
|
7
|
+
constructor(modules: DomainModule[]);
|
|
8
|
+
keys(): string[];
|
|
9
|
+
sharedKeys(): string[];
|
|
10
|
+
repositories(): Record<string, object>;
|
|
11
|
+
migrations(): IMigration[];
|
|
12
|
+
persistedTables(): string[];
|
|
13
|
+
subscribersByKey(): Record<string, Subscriber[]>;
|
|
14
|
+
cronsByKey(): Record<string, CronWorker[]>;
|
|
15
|
+
runMigrations(): Promise<void>;
|
|
16
|
+
bootstrap(): Promise<void>;
|
|
17
|
+
restartDatabase(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { repos } from "../entrypoints/db/repositories";
|
|
2
|
+
import { DBCursor } from "../infrastructure/database";
|
|
3
|
+
import { initializeRepositoryFacade } from "../infrastructure/database/mapped";
|
|
4
|
+
import logger, { loggerRepositories } from "../infrastructure/logger";
|
|
5
|
+
export class Kernel {
|
|
6
|
+
modules;
|
|
7
|
+
constructor(modules) {
|
|
8
|
+
this.modules = [...modules].sort((a, b) => Number(b.shared) - Number(a.shared));
|
|
9
|
+
}
|
|
10
|
+
keys() {
|
|
11
|
+
return this.modules.map((module) => module.key);
|
|
12
|
+
}
|
|
13
|
+
sharedKeys() {
|
|
14
|
+
return this.modules.filter((module) => module.shared).map((module) => module.key);
|
|
15
|
+
}
|
|
16
|
+
repositories() {
|
|
17
|
+
return this.modules.reduce((acc, module) => ({ ...acc, ...module.repositories() }), {});
|
|
18
|
+
}
|
|
19
|
+
migrations() {
|
|
20
|
+
return this.modules.flatMap((module) => module.migrations());
|
|
21
|
+
}
|
|
22
|
+
persistedTables() {
|
|
23
|
+
return this.modules.flatMap((module) => module.persistOnReset());
|
|
24
|
+
}
|
|
25
|
+
subscribersByKey() {
|
|
26
|
+
const map = {};
|
|
27
|
+
for (const module of this.modules) {
|
|
28
|
+
map[module.key] = module.subscribers();
|
|
29
|
+
}
|
|
30
|
+
return map;
|
|
31
|
+
}
|
|
32
|
+
cronsByKey() {
|
|
33
|
+
const map = {};
|
|
34
|
+
for (const module of this.modules) {
|
|
35
|
+
map[module.key] = module.crons();
|
|
36
|
+
}
|
|
37
|
+
return map;
|
|
38
|
+
}
|
|
39
|
+
async runMigrations() {
|
|
40
|
+
for (const { name, migrationFn } of this.migrations()) {
|
|
41
|
+
logger.info(`Running migration: ${name}`);
|
|
42
|
+
await migrationFn();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async bootstrap() {
|
|
46
|
+
repos.register(this.repositories());
|
|
47
|
+
initializeRepositoryFacade(repos);
|
|
48
|
+
await this.runMigrations();
|
|
49
|
+
}
|
|
50
|
+
async restartDatabase() {
|
|
51
|
+
loggerRepositories.warn("Restarting database");
|
|
52
|
+
const persisted = this.persistedTables();
|
|
53
|
+
const tablesToDrop = this.migrations().filter((migration) => !persisted.includes(migration.name));
|
|
54
|
+
for (const { name } of tablesToDrop) {
|
|
55
|
+
loggerRepositories.info(`Dropping table: ${name}`);
|
|
56
|
+
await DBCursor.execAsync(`DROP TABLE IF EXISTS ${name}`);
|
|
57
|
+
}
|
|
58
|
+
await this.runMigrations();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AppStateStatus } from "react-native";
|
|
2
|
+
import type { Kernel } from "./kernel";
|
|
3
|
+
type AppStateCallback = (state: AppStateStatus) => void;
|
|
4
|
+
declare class Orchestrator {
|
|
5
|
+
private kernel;
|
|
6
|
+
private authenticated;
|
|
7
|
+
private activeDomains;
|
|
8
|
+
private sharedKeys;
|
|
9
|
+
private appStateSubscription;
|
|
10
|
+
private appStateCallbacks;
|
|
11
|
+
private mutex;
|
|
12
|
+
configure(kernel: Kernel): void;
|
|
13
|
+
private requireKernel;
|
|
14
|
+
private withMutex;
|
|
15
|
+
private orchestrateQueue;
|
|
16
|
+
private orchestrateCron;
|
|
17
|
+
private restoreConsistency;
|
|
18
|
+
private initAppStateWatcher;
|
|
19
|
+
bootstrap(): Promise<void>;
|
|
20
|
+
authenticateSession(): Promise<void>;
|
|
21
|
+
restoreSession(): Promise<void>;
|
|
22
|
+
unauthenticateSession(cleanData?: boolean): Promise<void>;
|
|
23
|
+
enableDomain(key: string): Promise<void>;
|
|
24
|
+
disableDomain(key: string): Promise<void>;
|
|
25
|
+
isSessionAuthenticated(): boolean;
|
|
26
|
+
subscribeToAppState(callback: AppStateCallback): () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const orchestrator: Orchestrator;
|
|
29
|
+
export {};
|