@azure/static-web-apps-cli
Version:
Azure Static Web Apps CLI
53 lines • 2.73 kB
TypeScript
export declare const swaCliConfigSchemaUrl = "https://aka.ms/azure/static-web-apps-cli/schema";
export declare const swaCliConfigFilename = "swa-cli.config.json";
/**
* Get the current configuration of the CLI stored in `{@link currentSwaCliConfigFromFile}`.
*
* @returns The current configuration of the CLI loaded from the `swa-cli.config.json` file.
*/
export declare const getCurrentSwaCliConfigFromFile: () => SWACLIConfigInfo | undefined;
export declare const setCurrentSwaCliConfigFromFile: (config: SWACLIConfigInfo | undefined) => SWACLIConfigInfo | undefined;
/**
* Checks if the given configuration file exists.
*
* @param configFilePath The path to the config file.
* @returns True if the config file exists. False otherwise.
*/
export declare const swaCliConfigFileExists: (configFilePath: string) => boolean;
/**
* Checks if the specified value match the loaded configuration name.
*
* @param name The name to check.
* @returns True if the config loaded matches the name, false otherwise.
*/
export declare function matchLoadedConfigName(name: string): boolean | "" | undefined;
/**
* Loads the configuration from the `swa-cli.config.json` file (if available).
*
* @param configName The name of the configuration to load.
* @param configFilePath The path to the `swa-cli.config.json` file.
* @returns An object with the `{@link SWACLIOptions}` config or an empty object if the config file, or the config entry were not found.
*/
export declare function getConfigFileOptions(configName: string | undefined, configFilePath: string): Promise<SWACLIConfig>;
/**
* Checks if the config file contains a configuration entry with the given name.
* @param configFilePath The path to the `swa-cli.config.json` file.
* @param name The name of the configuration entry.
* @returns True if the config file contains a configuration entry with the given name. False otherwise.
*/
export declare function hasConfigurationNameInConfigFile(configFilePath: string, name: string): Promise<boolean>;
/**
* Writes the current configuration ({@link currentSwaCliConfigFromFile}) to the `swa-cli.config.json` file.
*
* @param config The configuration object to save.
*/
export declare function updateSwaCliConfigFile(config: SWACLIConfig): Promise<void>;
/**
* Appends or update the given configuration entry to the `swa-cli.config.json` file.
*
* @param configFilePath The path to the `swa-cli.config.json` file.
* @param configName The name of the configuration entry to be added or updated.
* @param config The configuration object to save.
*/
export declare function writeConfigFile(configFilePath: string, configName: string, config: SWACLIConfig): Promise<void>;
//# sourceMappingURL=cli-config.d.ts.map