refator: group core component ref in a object

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2023-11-20 09:37:24 +01:00
parent 413f05a6c9
commit a9da252cb4
7 changed files with 35 additions and 46 deletions
+6 -10
View File
@@ -331,7 +331,12 @@ export type CoreBootErrorPageComponent = ComponentType<
>;
// @public (undocumented)
export const coreBootErrorPageComponentRef: ComponentRef<CoreBootErrorPageComponent>;
export const coreComponentsRefs: {
progress: ComponentRef<CoreProgressComponent>;
bootErrorPage: ComponentRef<CoreBootErrorPageComponent>;
notFoundErrorPage: ComponentRef<CoreNotFoundErrorPageComponent>;
errorBoundaryFallback: ComponentRef<CoreErrorBoundaryFallbackComponent>;
};
// @public (undocumented)
export type CoreErrorBoundaryFallbackComponent = ComponentType<
@@ -342,9 +347,6 @@ export type CoreErrorBoundaryFallbackComponent = ComponentType<
}>
>;
// @public (undocumented)
export const coreErrorBoundaryFallbackComponentRef: ComponentRef<CoreErrorBoundaryFallbackComponent>;
// @public (undocumented)
export const coreExtensionData: {
reactElement: ConfigurableExtensionDataRef<JSX_2.Element, {}>;
@@ -368,15 +370,9 @@ export type CoreNotFoundErrorPageComponent = ComponentType<
PropsWithChildren<{}>
>;
// @public (undocumented)
export const coreNotFoundErrorPageComponentRef: ComponentRef<CoreNotFoundErrorPageComponent>;
// @public (undocumented)
export type CoreProgressComponent = ComponentType<PropsWithChildren<{}>>;
// @public (undocumented)
export const coreProgressComponentRef: ComponentRef<CoreProgressComponent>;
// @public (undocumented)
export function createApiExtension<
TConfig extends {},
@@ -40,24 +40,29 @@ export function createComponentRef<T>(options: {
};
}
/** @public */
export const coreProgressComponentRef =
createComponentRef<CoreProgressComponent>({ id: 'core.components.progress' });
const coreProgressComponentRef = createComponentRef<CoreProgressComponent>({
id: 'core.components.progress',
});
/** @public */
export const coreBootErrorPageComponentRef =
const coreBootErrorPageComponentRef =
createComponentRef<CoreBootErrorPageComponent>({
id: 'core.components.bootErrorPage',
});
/** @public */
export const coreNotFoundErrorPageComponentRef =
const coreNotFoundErrorPageComponentRef =
createComponentRef<CoreNotFoundErrorPageComponent>({
id: 'core.components.notFoundErrorPage',
});
/** @public */
export const coreErrorBoundaryFallbackComponentRef =
const coreErrorBoundaryFallbackComponentRef =
createComponentRef<CoreErrorBoundaryFallbackComponent>({
id: 'core.components.errorBoundaryFallback',
});
/** @public */
export const coreComponentsRefs = {
progress: coreProgressComponentRef,
bootErrorPage: coreBootErrorPageComponentRef,
notFoundErrorPage: coreNotFoundErrorPageComponentRef,
errorBoundaryFallback: coreErrorBoundaryFallbackComponentRef,
};
@@ -14,13 +14,7 @@
* limitations under the License.
*/
export {
coreProgressComponentRef,
coreBootErrorPageComponentRef,
coreErrorBoundaryFallbackComponentRef,
coreNotFoundErrorPageComponentRef,
type ComponentRef,
} from './ComponentRef';
export { coreComponentsRefs, type ComponentRef } from './ComponentRef';
export { ExtensionError } from './ExtensionError';