-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNativeMendixNative.ts
More file actions
139 lines (114 loc) · 3.34 KB
/
Copy pathNativeMendixNative.ts
File metadata and controls
139 lines (114 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import { TurboModuleRegistry, type TurboModule } from 'react-native';
import type { StackFrame } from 'stacktrace-parser';
import {
type EventEmitter,
type Int32,
type Double,
} from 'react-native/Libraries/Types/CodegenTypes';
export interface Spec extends TurboModule {
encryptedStorageSetItem(key: string, value: string): Promise<void>;
encryptedStorageGetItem(key: string): Promise<string | null>;
encryptedStorageRemoveItem(key: string): Promise<void>;
encryptedStorageClear(): Promise<void>;
encryptedStorageIsEncrypted(): boolean;
splashScreenShow(): void;
splashScreenHide(): void;
cookieClearAll(): Promise<void>;
reloadHandlerReload(): Promise<void>;
reloadHandlerExitApp(): Promise<void>;
downloadHandlerDownload(
url: string,
downloadPath: string,
config: GenericMap
): Promise<void>;
mxConfigurationGetConfig(): Configuration;
otaDownload(config: GenericMap): Promise<OtaDownloadResponse>;
otaDeploy(config: GenericMap): Promise<void>;
fsConstants(): GenericMap;
fsSave(blob: GenericMap, filePath: string): Promise<void>;
fsRead(filePath: string): Promise<BlobData>;
fsMove(filePath: string, newPath: string): Promise<void>;
fsRemove(filePath: string): Promise<void>;
fsList(dirPath: string): Promise<string[]>;
fsReadAsDataURL(filePath: string): Promise<string>;
fsReadAsText(filePath: string): Promise<string>; //Android only
fsFileExists(filePath: string): Promise<boolean>;
fsWriteJson(data: GenericMap, filepath: string): Promise<void>;
fsReadJson(filepath: string): Promise<GenericMap | GenericArray>;
fsSetEncryptionEnabled(enabled: boolean): void;
errorHandlerHandle(message: string, stackTrace: StackFrame[]): void;
navigationModeIsNavigationBarActive(): boolean;
navigationModeGetNavigationBarHeight(): Double;
readonly onReloadWithState: EventEmitter<void>;
readonly onDownloadProgress: EventEmitter<DownloadProgress>;
}
export default TurboModuleRegistry.getEnforcing<Spec>('MendixNative');
// Codegen could not recognize types placed in other files hence placed here
type BlobData = {
blobId: string;
offset: number;
size: number;
name?: string;
type?: string;
lastModified?: number;
};
type GenericType =
| string
| number
| boolean
| null
| undefined
| { [key: string]: GenericType }
| GenericType[];
type GenericMap = { [key: string]: GenericType };
type GenericArray = GenericType[];
type Configuration = {
RUNTIME_URL: string;
APP_NAME: string | null;
/**
* Do not use directly
* @deprecated
*/
FILES_DIRECTORY_NAME: string;
DATABASE_NAME: string;
WARNINGS_FILTER_LEVEL: string;
OTA_MANIFEST_PATH: string;
NATIVE_DEPENDENCIES?: { [key: string]: string };
IS_DEVELOPER_APP?: boolean;
/**
* @deprecated
*/
CODE_PUSH_KEY?: string;
NATIVE_BINARY_VERSION?: Int32;
APP_SESSION_ID?: string;
};
type DownloadConfig = {
connectionTimeout?: Int32;
mimeType?: string;
};
type OtaDownloadConfig = {
url: string;
};
type OtaDeployConfig = {
otaDeploymentID: string;
otaPackage: string;
extractionDir: string;
};
type OtaDownloadResponse = {
otaPackage: string;
};
type DownloadProgress = {
receivedBytes: Double;
totalBytes: Double;
};
export type {
BlobData,
GenericMap,
GenericArray,
Configuration,
DownloadConfig,
OtaDownloadConfig,
OtaDeployConfig,
OtaDownloadResponse,
DownloadProgress,
};