diff --git a/packages/core/src/feature-app-manager.ts b/packages/core/src/feature-app-manager.ts index bb215e095..f847d1773 100644 --- a/packages/core/src/feature-app-manager.ts +++ b/packages/core/src/feature-app-manager.ts @@ -45,8 +45,12 @@ export interface FeatureAppEnvironment< * If this callback is defined, a short-lived Feature App can call this * function when it has completed its task. The Integrator (or parent Feature * App) can then decide to e.g. unmount the Feature App. + * + * Optionally, the Feature App can pass a result into the done callback. The + * type/structure of the result must be agreed between the Integrator (or + * parent Feature App) and the Feature App. */ - readonly done?: () => void; + readonly done?: (result?: unknown) => void; } export interface FeatureAppDefinition< @@ -118,8 +122,12 @@ export interface FeatureAppScopeOptions< * short-lived Feature App can call this function when it has completed its * task. The Integrator (or parent Feature App) can then decide to e.g. * unmount the Feature App. + * + * Optionally, the Feature App can pass a result into the done callback. The + * type/structure of the result must be agreed between the Integrator (or + * parent Feature App) and the Feature App. */ - readonly done?: () => void; + readonly done?: (result?: unknown) => void; } export interface FeatureAppManagerOptions { diff --git a/packages/react/src/feature-app-loader.tsx b/packages/react/src/feature-app-loader.tsx index f88096f2e..eec692426 100644 --- a/packages/react/src/feature-app-loader.tsx +++ b/packages/react/src/feature-app-loader.tsx @@ -88,8 +88,12 @@ export interface FeatureAppLoaderProps { * short-lived Feature App can call this function when it has completed its * task. The Integrator (or parent Feature App) can then decide to e.g. * unmount the Feature App. + * + * Optionally, the Feature App can pass a result into the done callback. The + * type/structure of the result must be agreed between the Integrator (or + * parent Feature App) and the Feature App. */ - readonly done?: () => void; + readonly done?: (result?: unknown) => void; readonly onError?: (error: Error) => void; diff --git a/packages/react/src/internal/internal-feature-app-container.tsx b/packages/react/src/internal/internal-feature-app-container.tsx index 68e5446df..2b5fbb846 100644 --- a/packages/react/src/internal/internal-feature-app-container.tsx +++ b/packages/react/src/internal/internal-feature-app-container.tsx @@ -76,8 +76,12 @@ export interface BaseFeatureAppContainerProps< * short-lived Feature App can call this function when it has completed its * task. The Integrator (or parent Feature App) can then decide to e.g. * unmount the Feature App. + * + * Optionally, the Feature App can pass a result into the done callback. The + * type/structure of the result must be agreed between the Integrator (or + * parent Feature App) and the Feature App. */ - readonly done?: () => void; + readonly done?: (result?: unknown) => void; readonly onError?: (error: Error) => void;