-
Notifications
You must be signed in to change notification settings - Fork 8
/
Types.kt
255 lines (227 loc) · 9.48 KB
/
Types.kt
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
package io.embrace.android.embracesdk.internal.utils
import android.content.Context
import io.embrace.android.embracesdk.Embrace
import io.embrace.android.embracesdk.config.ConfigService
import io.embrace.android.embracesdk.injection.AndroidServicesModule
import io.embrace.android.embracesdk.injection.AnrModule
import io.embrace.android.embracesdk.injection.CoreModule
import io.embrace.android.embracesdk.injection.CrashModule
import io.embrace.android.embracesdk.injection.CustomerLogModule
import io.embrace.android.embracesdk.injection.DataCaptureServiceModule
import io.embrace.android.embracesdk.injection.DataContainerModule
import io.embrace.android.embracesdk.injection.DataSourceModule
import io.embrace.android.embracesdk.injection.DeliveryModule
import io.embrace.android.embracesdk.injection.EssentialServiceModule
import io.embrace.android.embracesdk.injection.InitModule
import io.embrace.android.embracesdk.injection.OpenTelemetryModule
import io.embrace.android.embracesdk.injection.PayloadModule
import io.embrace.android.embracesdk.injection.SdkObservabilityModule
import io.embrace.android.embracesdk.injection.SessionModule
import io.embrace.android.embracesdk.injection.StorageModule
import io.embrace.android.embracesdk.injection.SystemServiceModule
import io.embrace.android.embracesdk.logging.InternalEmbraceLogger
import io.embrace.android.embracesdk.ndk.NativeModule
import io.embrace.android.embracesdk.session.properties.SessionPropertiesService
import io.embrace.android.embracesdk.worker.WorkerThreadModule
import java.io.OutputStream
/**
* Typealias for a function that writes to an [OutputStream]. This is used to make it
* easier to pass around logic for serializing data to arbitrary streams.
*/
internal typealias SerializationAction = (outputStream: OutputStream) -> Unit
/**
* When a local or remote config doesn't exist, this type can be used as a placeholder.
*/
internal typealias UnimplementedConfig = Unit?
/**
* Function that returns an instance of [CoreModule]. Matches the signature of the constructor for [CoreModuleImpl]
*/
internal typealias CoreModuleSupplier = (
context: Context,
appFramework: Embrace.AppFramework,
logger: InternalEmbraceLogger
) -> CoreModule
/**
* Function that returns an instance of [WorkerThreadModule]. Matches the signature of the constructor for [WorkerThreadModuleImpl]
*/
internal typealias WorkerThreadModuleSupplier = (initModule: InitModule) -> WorkerThreadModule
/**
* Function that returns an instance of [SystemServiceModule]. Matches the signature of the constructor for [SystemServiceModuleImpl]
*/
internal typealias SystemServiceModuleSupplier = (
coreModule: CoreModule,
versionChecker: VersionChecker
) -> SystemServiceModule
/**
* Function that returns an instance of [AndroidServicesModule]. Matches the signature of the constructor for [AndroidServicesModuleImpl]
*/
internal typealias AndroidServicesModuleSupplier = (
initModule: InitModule,
coreModule: CoreModule,
workerThreadModule: WorkerThreadModule,
) -> AndroidServicesModule
/**
* Function that returns an instance of [StorageModule]. Matches the signature of the constructor for [StorageModuleImpl]
*/
internal typealias StorageModuleSupplier = (
initModule: InitModule,
coreModule: CoreModule,
workerThreadModule: WorkerThreadModule,
) -> StorageModule
/**
* Function that returns an instance of [EssentialServiceModule]. Matches the signature of the constructor for [EssentialServiceModuleImpl]
*/
internal typealias EssentialServiceModuleSupplier = (
initModule: InitModule,
openTelemetryModule: OpenTelemetryModule,
coreModule: CoreModule,
workerThreadModule: WorkerThreadModule,
systemServiceModule: SystemServiceModule,
androidServicesModule: AndroidServicesModule,
storageModule: StorageModule,
customAppId: String?,
dataSourceModuleProvider: Provider<DataSourceModule>,
configServiceProvider: Provider<ConfigService?>
) -> EssentialServiceModule
/**
* Function that returns an instance of [DataCaptureServiceModule]. Matches the signature of the constructor for
* [DataCaptureServiceModuleImpl]
*/
internal typealias DataCaptureServiceModuleSupplier = (
initModule: InitModule,
openTelemetryModule: OpenTelemetryModule,
coreModule: CoreModule,
systemServiceModule: SystemServiceModule,
essentialServiceModule: EssentialServiceModule,
workerThreadModule: WorkerThreadModule,
versionChecker: VersionChecker,
dataSourceModule: DataSourceModule
) -> DataCaptureServiceModule
/**
* Function that returns an instance of [DeliveryModule]. Matches the signature of the constructor for [DeliveryModuleImpl]
*/
internal typealias DeliveryModuleSupplier = (
initModule: InitModule,
coreModule: CoreModule,
workerThreadModule: WorkerThreadModule,
storageModule: StorageModule,
essentialServiceModule: EssentialServiceModule,
) -> DeliveryModule
/**
* Function that returns an instance of [AnrModule]. Matches the signature of the constructor for [AnrModuleImpl]
*/
internal typealias AnrModuleSupplier = (
initModule: InitModule,
essentialServiceModule: EssentialServiceModule,
workerModule: WorkerThreadModule,
otelModule: OpenTelemetryModule
) -> AnrModule
/**
* Function that returns an instance of [SdkObservabilityModule]. Matches the signature of the constructor for [SdkObservabilityModuleImpl]
*/
internal typealias SdkObservabilityModuleSupplier = (
initModule: InitModule,
essentialServiceModule: EssentialServiceModule
) -> SdkObservabilityModule
/**
* Function that returns an instance of [CustomerLogModule]. Matches the signature of the constructor for [CustomerLogModuleImpl]
*/
internal typealias CustomerLogModuleSupplier = (
initModule: InitModule,
coreModule: CoreModule,
openTelemetryModule: OpenTelemetryModule,
androidServicesModule: AndroidServicesModule,
essentialServiceModule: EssentialServiceModule,
deliveryModule: DeliveryModule,
workerThreadModule: WorkerThreadModule,
payloadModule: PayloadModule,
) -> CustomerLogModule
/**
* Function that returns an instance of [NativeModule]. Matches the signature of the constructor for [NativeModuleImpl]
*/
internal typealias NativeModuleSupplier = (
initModule: InitModule,
coreModule: CoreModule,
storageModule: StorageModule,
essentialServiceModule: EssentialServiceModule,
deliveryModule: DeliveryModule,
androidServicesModule: AndroidServicesModule,
workerThreadModule: WorkerThreadModule
) -> NativeModule
/**
* Function that returns an instance of [DataContainerModule]. Matches the signature of the constructor for [DataContainerModuleImpl]
*/
internal typealias DataContainerModuleSupplier = (
initModule: InitModule,
workerThreadModule: WorkerThreadModule,
essentialServiceModule: EssentialServiceModule,
deliveryModule: DeliveryModule,
startTime: Long
) -> DataContainerModule
/**
* Function that returns an instance of [DataSourceModule]. Matches the signature of the constructor for [DataSourceModuleImpl]
*/
internal typealias DataSourceModuleSupplier = (
initModule: InitModule,
coreModule: CoreModule,
openTelemetryModule: OpenTelemetryModule,
essentialServiceModule: EssentialServiceModule,
systemServiceModule: SystemServiceModule,
androidServicesModule: AndroidServicesModule,
workerThreadModule: WorkerThreadModule,
anrModule: AnrModule
) -> DataSourceModule
/**
* Function that returns an instance of [SessionModule]. Matches the signature of the constructor for [SessionModuleImpl]
*/
internal typealias SessionModuleSupplier = (
initModule: InitModule,
openTelemetryModule: OpenTelemetryModule,
androidServicesModule: AndroidServicesModule,
essentialServiceModule: EssentialServiceModule,
nativeModule: NativeModule,
dataContainerModule: DataContainerModule,
deliveryModule: DeliveryModule,
dataCaptureServiceModule: DataCaptureServiceModule,
customerLogModule: CustomerLogModule,
sdkObservabilityModule: SdkObservabilityModule,
workerThreadModule: WorkerThreadModule,
dataSourceModule: DataSourceModule,
payloadModule: PayloadModule,
anrModule: AnrModule
) -> SessionModule
/**
* Function that returns an instance of [CrashModule]. Matches the signature of the constructor for [CrashModuleImpl]
*/
internal typealias CrashModuleSupplier = (
initModule: InitModule,
coreModule: CoreModule,
storageModule: StorageModule,
essentialServiceModule: EssentialServiceModule,
deliveryModule: DeliveryModule,
nativeModule: NativeModule,
sessionModule: SessionModule,
anrModule: AnrModule,
dataContainerModule: DataContainerModule,
androidServicesModule: AndroidServicesModule,
logModule: CustomerLogModule,
) -> CrashModule
/**
* Function that returns an instance of [PayloadModule]. Matches the signature of the constructor for [PayloadModuleImpl]
*/
internal typealias PayloadModuleSupplier = (
initModule: InitModule,
coreModule: CoreModule,
androidServicesModule: AndroidServicesModule,
essentialServiceModule: EssentialServiceModule,
systemServiceModule: SystemServiceModule,
workerThreadModule: WorkerThreadModule,
nativeModule: NativeModule,
otelModule: OpenTelemetryModule,
sdkObservabilityModule: SdkObservabilityModule,
sessionPropertiesServiceProvider: Provider<SessionPropertiesService>,
) -> PayloadModule
/**
* Function that returns an instance of T meant to represent a provider/supplier that does not require any input parameters
*/
internal typealias Provider<T> = () -> T