1082815dcSEvan Baconimport { BaseModOptions } from './withMod'; 2*8a424bebSJames Ideimport { ConfigPlugin, ExportedConfig, ExportedConfigWithProps, ModPlatform } from '../Plugin.types'; 39b26454eSBartosz Kaszubowskiexport type ForwardedBaseModOptions = Partial<Pick<BaseModOptions, 'saveToInternal' | 'skipEmptyMod'>>; 49b26454eSBartosz Kaszubowskiexport type BaseModProviderMethods<ModType, Props extends ForwardedBaseModOptions = ForwardedBaseModOptions> = { 5082815dcSEvan Bacon getFilePath: (config: ExportedConfigWithProps<ModType>, props: Props) => Promise<string> | string; 6082815dcSEvan Bacon read: (filePath: string, config: ExportedConfigWithProps<ModType>, props: Props) => Promise<ModType> | ModType; 7082815dcSEvan Bacon write: (filePath: string, config: ExportedConfigWithProps<ModType>, props: Props) => Promise<void> | void; 8082815dcSEvan Bacon /** 9082815dcSEvan Bacon * If the mod supports introspection, and avoids making any filesystem modifications during compilation. 10082815dcSEvan Bacon * By enabling, this mod, and all of its descendants will be run in introspection mode. 11082815dcSEvan Bacon * This should only be used for static files like JSON or XML, and not for application files that require regexes, 12082815dcSEvan Bacon * or complex static files that require other files to be generated like Xcode `.pbxproj`. 13082815dcSEvan Bacon */ 14082815dcSEvan Bacon isIntrospective?: boolean; 15082815dcSEvan Bacon}; 169b26454eSBartosz Kaszubowskiexport type CreateBaseModProps<ModType, Props extends ForwardedBaseModOptions = ForwardedBaseModOptions> = { 17082815dcSEvan Bacon methodName: string; 18082815dcSEvan Bacon platform: ModPlatform; 19082815dcSEvan Bacon modName: string; 20082815dcSEvan Bacon} & BaseModProviderMethods<ModType, Props>; 21082815dcSEvan Baconexport declare function createBaseMod<ModType, Props extends ForwardedBaseModOptions = ForwardedBaseModOptions>({ methodName, platform, modName, getFilePath, read, write, isIntrospective, }: CreateBaseModProps<ModType, Props>): ConfigPlugin<Props | void>; 22082815dcSEvan Baconexport declare function assertModResults(results: any, platformName: string, modName: string): any; 23082815dcSEvan Baconexport declare function createPlatformBaseMod<ModType, Props extends ForwardedBaseModOptions = ForwardedBaseModOptions>({ modName, ...props }: Omit<CreateBaseModProps<ModType, Props>, 'methodName'>): ConfigPlugin<void | Props>; 24082815dcSEvan Bacon/** A TS wrapper for creating provides */ 25082815dcSEvan Baconexport declare function provider<ModType, Props extends ForwardedBaseModOptions = ForwardedBaseModOptions>(props: BaseModProviderMethods<ModType, Props>): BaseModProviderMethods<ModType, Props>; 26082815dcSEvan Bacon/** Plugin to create and append base mods from file providers */ 27082815dcSEvan Baconexport declare function withGeneratedBaseMods<ModName extends string>(config: ExportedConfig, { platform, providers, ...props }: ForwardedBaseModOptions & { 28edc75823SEvan Bacon /** Officially supports `'ios' | 'android'` (`ModPlatform`). Arbitrary strings are supported for adding out-of-tree platforms. */ 29edc75823SEvan Bacon platform: ModPlatform & string; 30082815dcSEvan Bacon providers: Partial<Record<ModName, BaseModProviderMethods<any, any>>>; 31082815dcSEvan Bacon}): ExportedConfig; 32