@@ -7,16 +7,16 @@ import { dedent } from "ts-dedent";
7
7
import { Manifest } from "." ;
8
8
import { cleanIOSAssets , getExpoConfig , hfs } from "./generate" ;
9
9
10
- type ExpoPlugin = Expo . ConfigPlugin < {
10
+ type Props = {
11
11
assetsDir ?: string ;
12
12
android ?: {
13
13
parentTheme ?: "TransparentStatus" | "EdgeToEdge" ;
14
14
darkContentBarsStyle ?: boolean ;
15
15
} ;
16
- } > ;
16
+ } ;
17
17
18
18
const withExpoVersionCheck =
19
- ( platform : "android" | "ios" ) : ExpoPlugin =>
19
+ ( platform : "android" | "ios" ) : Expo . ConfigPlugin < Props > =>
20
20
( config ) =>
21
21
Expo . withDangerousMod ( config , [
22
22
platform ,
@@ -26,7 +26,7 @@ const withExpoVersionCheck =
26
26
} ,
27
27
] ) ;
28
28
29
- const withAndroidAssets : ExpoPlugin = ( config , props ) =>
29
+ const withAndroidAssets : Expo . ConfigPlugin < Props > = ( config , props ) =>
30
30
Expo . withDangerousMod ( config , [
31
31
"android" ,
32
32
( config ) => {
@@ -61,7 +61,7 @@ const withAndroidAssets: ExpoPlugin = (config, props) =>
61
61
} ,
62
62
] ) ;
63
63
64
- const withAndroidManifest : ExpoPlugin = ( config ) =>
64
+ const withAndroidManifest : Expo . ConfigPlugin < Props > = ( config ) =>
65
65
Expo . withAndroidManifest ( config , ( config ) => {
66
66
config . modResults . manifest . application ?. forEach ( ( application ) => {
67
67
if ( application . $ [ "android:name" ] === ".MainApplication" ) {
@@ -78,7 +78,7 @@ const withAndroidManifest: ExpoPlugin = (config) =>
78
78
return config ;
79
79
} ) ;
80
80
81
- const withMainActivity : ExpoPlugin = ( config ) =>
81
+ const withMainActivity : Expo . ConfigPlugin < Props > = ( config ) =>
82
82
Expo . withMainActivity ( config , ( config ) => {
83
83
const { modResults } = config ;
84
84
const { language } = modResults ;
@@ -113,7 +113,7 @@ const withMainActivity: ExpoPlugin = (config) =>
113
113
} ;
114
114
} ) ;
115
115
116
- const withAndroidStyles : ExpoPlugin = ( config , props ) =>
116
+ const withAndroidStyles : Expo . ConfigPlugin < Props > = ( config , props ) =>
117
117
Expo . withAndroidStyles ( config , async ( config ) => {
118
118
const { assetsDir = "assets/bootsplash" , android = { } } = props ;
119
119
const { parentTheme, darkContentBarsStyle } = android ;
@@ -182,7 +182,7 @@ const withAndroidStyles: ExpoPlugin = (config, props) =>
182
182
} ;
183
183
} ) ;
184
184
185
- const withAndroidColors : ExpoPlugin = ( config , props ) =>
185
+ const withAndroidColors : Expo . ConfigPlugin < Props > = ( config , props ) =>
186
186
Expo . withAndroidColors ( config , async ( config ) => {
187
187
const { assetsDir = "assets/bootsplash" } = props ;
188
188
const { projectRoot } = config . modRequest ;
@@ -199,7 +199,7 @@ const withAndroidColors: ExpoPlugin = (config, props) =>
199
199
return config ;
200
200
} ) ;
201
201
202
- const withAndroidColorsNight : ExpoPlugin = ( config , props ) =>
202
+ const withAndroidColorsNight : Expo . ConfigPlugin < Props > = ( config , props ) =>
203
203
Expo . withAndroidColorsNight ( config , async ( config ) => {
204
204
const { assetsDir = "assets/bootsplash" } = props ;
205
205
const { projectRoot } = config . modRequest ;
@@ -218,7 +218,7 @@ const withAndroidColorsNight: ExpoPlugin = (config, props) =>
218
218
return config ;
219
219
} ) ;
220
220
221
- const withIOSAssets : ExpoPlugin = ( config , props ) =>
221
+ const withIOSAssets : Expo . ConfigPlugin < Props > = ( config , props ) =>
222
222
Expo . withDangerousMod ( config , [
223
223
"ios" ,
224
224
( config ) => {
@@ -258,7 +258,7 @@ const withIOSAssets: ExpoPlugin = (config, props) =>
258
258
} ,
259
259
] ) ;
260
260
261
- const withAppDelegate : ExpoPlugin = ( config ) =>
261
+ const withAppDelegate : Expo . ConfigPlugin < Props > = ( config ) =>
262
262
Expo . withAppDelegate ( config , ( config ) => {
263
263
const { modResults } = config ;
264
264
const { language } = modResults ;
@@ -301,13 +301,13 @@ const withAppDelegate: ExpoPlugin = (config) =>
301
301
} ;
302
302
} ) ;
303
303
304
- const withInfoPlist : ExpoPlugin = ( config ) =>
304
+ const withInfoPlist : Expo . ConfigPlugin < Props > = ( config ) =>
305
305
Expo . withInfoPlist ( config , ( config ) => {
306
306
config . modResults [ "UILaunchStoryboardName" ] = "BootSplash" ;
307
307
return config ;
308
308
} ) ;
309
309
310
- const withXcodeProject : ExpoPlugin = ( config ) =>
310
+ const withXcodeProject : Expo . ConfigPlugin < Props > = ( config ) =>
311
311
Expo . withXcodeProject ( config , ( config ) => {
312
312
const { projectName = "" } = config . modRequest ;
313
313
@@ -328,14 +328,14 @@ const withXcodeProject: ExpoPlugin = (config) =>
328
328
return config ;
329
329
} ) ;
330
330
331
- const withoutExpoSplashScreen : ExpoPlugin = Expo . createRunOncePlugin (
332
- ( config ) => config ,
333
- "expo-splash-screen" ,
334
- "skip" ,
335
- ) ;
331
+ const withoutExpoSplashScreen : Expo . ConfigPlugin < Props > =
332
+ Expo . createRunOncePlugin ( ( config ) => config , "expo-splash-screen" , "skip" ) ;
336
333
337
- export const withBootSplash : ExpoPlugin = ( config , props = { } ) => {
338
- const plugins : ExpoPlugin [ ] = [ ] ;
334
+ export const withBootSplash : Expo . ConfigPlugin < Props | undefined > = (
335
+ config ,
336
+ props = { } ,
337
+ ) => {
338
+ const plugins : Expo . ConfigPlugin < Props > [ ] = [ ] ;
339
339
const { platforms = [ ] } = config ;
340
340
341
341
plugins . push ( withoutExpoSplashScreen ) ;
0 commit comments