import { shell } from './shell' import { AdminVersion, setupConfiguration } from './core' interface ConfigOptions { /** * Admin's version. * @default "v4" * */ version: AdminVersion } /** * Method to configure some shell settings such as * the installed admin version. This method should * be used exclusively by the `vtex.admin`. Make sure * this method is one of the first methods called. * Apps within the admin-shell should refer to the * `settings` variable. * * # @example * ```jsx * // other necessary imports up here... * import { configure } from `admin-shell-utils` * * configure({ version: 'v3' }) * * const App = () => { * return ( * // some ui here * ) * } * ``` * */ export function configure({ version }: ConfigOptions) { setupConfiguration() if (version) { shell.configuration.adminVersion = version } }