@merkur/plugin-component 0.46.0-rc.0 → 0.46.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/types.d.ts +48 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkur/plugin-component",
|
|
3
|
-
"version": "0.46.0-rc.
|
|
3
|
+
"version": "0.46.0-rc.1",
|
|
4
4
|
"description": "Merkur component plugin.",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://merkur.js.org/",
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@merkur/core": "0.46.0-rc.
|
|
64
|
+
"@merkur/core": "0.46.0-rc.1"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@merkur/core": "*"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "a1bd899f564cab2204edd3e30edc40e1a81c3999"
|
|
70
70
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Widget } from '@merkur/core';
|
|
1
|
+
import { type Widget, type WidgetFunction, type WidgetPartial, type WidgetPlugin } from '@merkur/core';
|
|
2
2
|
|
|
3
3
|
export interface ViewType {
|
|
4
4
|
(widget: WidgetPartial): any;
|
|
@@ -31,47 +31,6 @@ export type SSRMountResult = {
|
|
|
31
31
|
export interface WidgetState {}
|
|
32
32
|
export interface WidgetProps {}
|
|
33
33
|
|
|
34
|
-
declare module '@merkur/core' {
|
|
35
|
-
interface DefineWidgetArgs {
|
|
36
|
-
viewFactory: ViewFactory;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface WidgetDefinition {
|
|
40
|
-
bootstrap?: (widget: WidgetPartial) => void;
|
|
41
|
-
container?: Element;
|
|
42
|
-
info?: (widget: WidgetPartial) => Promise<void>;
|
|
43
|
-
mount?: (widget: WidgetPartial) => Promise<void | SSRMountResult>;
|
|
44
|
-
shouldHydrate?: (widget: WidgetPartial, viewArgs: MapViewArgs) => boolean;
|
|
45
|
-
update?: (widget: WidgetPartial) => Promise<void>;
|
|
46
|
-
unmount?: (widget: WidgetPartial) => Promise<void>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
interface WidgetPartial {
|
|
50
|
-
slot: Record<
|
|
51
|
-
string,
|
|
52
|
-
| {
|
|
53
|
-
name: string;
|
|
54
|
-
html: string;
|
|
55
|
-
containerSelector: string;
|
|
56
|
-
container?: Element;
|
|
57
|
-
}
|
|
58
|
-
| undefined
|
|
59
|
-
>;
|
|
60
|
-
state: WidgetState;
|
|
61
|
-
props: WidgetProps;
|
|
62
|
-
setState: (newState: WidgetState) => void;
|
|
63
|
-
}
|
|
64
|
-
interface WidgetInternal {
|
|
65
|
-
component: {
|
|
66
|
-
lifeCycle: Record<string, MerkurWidgetFunction>;
|
|
67
|
-
isMounted: boolean;
|
|
68
|
-
isHydrated: boolean;
|
|
69
|
-
suspendedTasks: Array<() => Promise<void>>;
|
|
70
|
-
resolvedViews: Map<ViewFactory, MapViewArgs[]>;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
34
|
export interface SlotDefinition {
|
|
76
35
|
name: string;
|
|
77
36
|
View: ViewType;
|
|
@@ -109,3 +68,50 @@ export declare function createViewFactory(
|
|
|
109
68
|
): ViewFactory;
|
|
110
69
|
|
|
111
70
|
export declare function componentPlugin(): WidgetPlugin;
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
declare module '@merkur/core' {
|
|
74
|
+
interface DefineWidgetArgs {
|
|
75
|
+
viewFactory: ViewFactory;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface Widget {}
|
|
79
|
+
|
|
80
|
+
interface WidgetPlugin {}
|
|
81
|
+
|
|
82
|
+
interface WidgetDefinition {
|
|
83
|
+
bootstrap?: (widget: WidgetPartial) => void;
|
|
84
|
+
container?: Element;
|
|
85
|
+
info?: (widget: WidgetPartial) => Promise<void>;
|
|
86
|
+
mount?: (widget: WidgetPartial) => Promise<void | SSRMountResult>;
|
|
87
|
+
shouldHydrate?: (widget: WidgetPartial, viewArgs: MapViewArgs) => boolean;
|
|
88
|
+
update?: (widget: WidgetPartial) => Promise<void>;
|
|
89
|
+
unmount?: (widget: WidgetPartial) => Promise<void>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface WidgetPartial {
|
|
93
|
+
slot: Record<
|
|
94
|
+
string,
|
|
95
|
+
| {
|
|
96
|
+
name: string;
|
|
97
|
+
html: string;
|
|
98
|
+
containerSelector: string;
|
|
99
|
+
container?: Element;
|
|
100
|
+
}
|
|
101
|
+
| undefined
|
|
102
|
+
>;
|
|
103
|
+
state: WidgetState;
|
|
104
|
+
props: WidgetProps;
|
|
105
|
+
setState: (widget: WidgetPartial, newState: WidgetState) => void;
|
|
106
|
+
setProps: (widget: WidgetPartial, newProps: WidgetProps) => void;
|
|
107
|
+
}
|
|
108
|
+
interface WidgetInternal {
|
|
109
|
+
component: {
|
|
110
|
+
lifeCycle: Record<string, WidgetFunction>;
|
|
111
|
+
isMounted: boolean;
|
|
112
|
+
isHydrated: boolean;
|
|
113
|
+
suspendedTasks: Array<() => Promise<void>>;
|
|
114
|
+
resolvedViews: Map<ViewFactory, MapViewArgs[]>;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|