Skip to content

Commit 83a4400

Browse files
authored
Merge pull request #285 from mjancarik/bind-type
Change type for attribute `widget` of function `bindWidgetToFunctions()` to `WidgetPartial`
2 parents ebd47eb + 57379f2 commit 83a4400

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.changeset/orange-keys-listen.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@merkur/core": patch
3+
---
4+
5+
Type change
6+
7+
- **What?** Change type for attribute `widget` of function `bindWidgetToFunctions()`.
8+
- **Why?** Since this function takes current widget and binds that to functions (by default on the widget itself, optionally on any supplied object), *it has to be type `WidgetPartial`. The type `Widget` is the result of this operation. As currently typed, it doesn't work in plugin `setup()` and `create()` methods, because those get `WidgetPartial` as input attrs.
9+
- **How?** Nothing.

packages/core/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export declare function setDefaultValueForUndefined<T extends object>(
136136
): T;
137137

138138
export declare function bindWidgetToFunctions(
139-
widget: Widget,
139+
widget: WidgetPartial,
140140
target?: any,
141141
): void;
142142

0 commit comments

Comments
 (0)