@@ -11,6 +11,10 @@ export type PluginOutput = {
1111 description : string ;
1212} ;
1313
14+ export type PlatformOutput = PluginOutput & {
15+ autolinkingConfig : object | undefined ;
16+ } ;
17+
1418export type PluginApi = {
1519 registerCommand : ( command : CommandType ) => void ;
1620 getProjectRoot : ( ) => string ;
@@ -28,6 +32,8 @@ type SupportedRemoteCacheProviders = 'github-actions';
2832
2933type PluginType = ( args : PluginApi ) => PluginOutput ;
3034
35+ type PlatformType = ( args : PluginApi ) => PlatformOutput ;
36+
3137type ArgValue = string | string [ ] | number | boolean ;
3238
3339// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -60,7 +66,7 @@ export type ConfigType = {
6066 reactNativePath ?: string ;
6167 bundler ?: PluginType ;
6268 plugins ?: PluginType [ ] ;
63- platforms ?: Record < string , PluginType > ;
69+ platforms ?: Record < string , PlatformType > ;
6470 commands ?: Array < CommandType > ;
6571 remoteCacheProvider ?: SupportedRemoteCacheProviders ;
6672 fingerprint ?: {
@@ -69,8 +75,9 @@ export type ConfigType = {
6975 } ;
7076} ;
7177
72- type ConfigOutput = {
78+ export type ConfigOutput = {
7379 commands ?: Array < CommandType > ;
80+ platforms ?: Record < string , PlatformOutput > ;
7481} & PluginApi ;
7582
7683const extensions = [ '.js' , '.ts' , '.mjs' ] ;
@@ -147,10 +154,11 @@ export async function getConfig(
147154 getReactNativePath : ( ) => config . reactNativePath as string ,
148155 getPlatforms : ( ) => config . platforms as { [ platform : string ] : object } ,
149156 getRemoteCacheProvider : ( ) => config . remoteCacheProvider ,
150- getFingerprintOptions : ( ) => config . fingerprint as {
151- extraSources : string [ ] ;
152- ignorePaths : string [ ] ;
153- } ,
157+ getFingerprintOptions : ( ) =>
158+ config . fingerprint as {
159+ extraSources : string [ ] ;
160+ ignorePaths : string [ ] ;
161+ } ,
154162 } ;
155163
156164 if ( config . plugins ) {
@@ -160,10 +168,12 @@ export async function getConfig(
160168 }
161169 }
162170
171+ const platforms : Record < string , PlatformOutput > = { } ;
163172 if ( config . platforms ) {
164173 // platforms register commands and custom platform functionality (TBD)
165174 for ( const platform in config . platforms ) {
166- config . platforms [ platform ] ( api ) ;
175+ const platformOutput = config . platforms [ platform ] ( api ) ;
176+ platforms [ platform ] = platformOutput ;
167177 }
168178 }
169179
@@ -173,6 +183,7 @@ export async function getConfig(
173183
174184 const outputConfig : ConfigOutput = {
175185 commands : config . commands ?? [ ] ,
186+ platforms : platforms ?? { } ,
176187 ...api ,
177188 } ;
178189
0 commit comments