Skip to content

Commit

Permalink
fix: angular config types
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinderoubaix committed Feb 2, 2024
1 parent fe80de2 commit d6b76ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion angular/headless/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type WidgetsConfig = {
[WidgetName in keyof CoreWidgetsConfig]: AdaptPropsSlots<CoreWidgetsConfig[WidgetName]>;
};
type AdaptParentConfig<Config> = (config: Partial2Levels<Config>) => Partial2Levels<Config>;
type InjectWidgetsConfig<Config> = (config?: Partial2Levels<Config>) => WidgetsConfigStore<Config>;

/**
* A factory to create the utilities to allow widgets to be context-aware.
Expand Down Expand Up @@ -101,7 +102,7 @@ export const widgetsConfigFactory = <Config extends {[widgetName: string]: objec
*
* @returns the widgets default configuration store.
*/
const injectWidgetsConfig = (defaultConfig?: Partial2Levels<Config>) => {
const injectWidgetsConfig: InjectWidgetsConfig<Config> = (defaultConfig?: Partial2Levels<Config>) => {
const widgetsConfig = inject(widgetsConfigInjectionToken);
if (defaultConfig) {
widgetsConfig.set(defaultConfig);
Expand Down

0 comments on commit d6b76ee

Please sign in to comment.