ddd-react 1.6.3 → 1.6.4
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/dist/component.d.ts +7 -9
- package/dist/types/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare abstract class Component<P = {}, S = ComponentState,
|
|
1
|
+
import { ComponentState, Consumer, Provider, VDOMNode, WithChildrenProps } from './types';
|
|
2
|
+
export declare abstract class Component<P = {}, S = ComponentState, C = null> {
|
|
3
3
|
isMounted: boolean;
|
|
4
4
|
vdom: VDOMNode | null;
|
|
5
5
|
private hostEl;
|
|
6
6
|
parent: Component | null;
|
|
7
7
|
props: P & WithChildrenProps;
|
|
8
8
|
state: S;
|
|
9
|
-
context:
|
|
9
|
+
context: C;
|
|
10
10
|
dependencies: {
|
|
11
|
-
consumer:
|
|
11
|
+
consumer: Consumer<C>;
|
|
12
12
|
}[];
|
|
13
|
-
subscribedProvider:
|
|
14
|
-
value: ContextValueType;
|
|
15
|
-
}> | null;
|
|
13
|
+
subscribedProvider: Provider<C> | null;
|
|
16
14
|
isProvider: boolean;
|
|
17
15
|
isConsumer: boolean;
|
|
18
16
|
constructor(props: P, parentComponent: Component | null);
|
|
19
17
|
addDependency({ consumer }: {
|
|
20
|
-
consumer:
|
|
18
|
+
consumer: Consumer<C>;
|
|
21
19
|
}): void;
|
|
22
20
|
removeDependency({ consumer }: {
|
|
23
|
-
consumer:
|
|
21
|
+
consumer: Consumer<C>;
|
|
24
22
|
}): void;
|
|
25
23
|
notify(): void;
|
|
26
24
|
onMount(): void | Promise<void>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -46,3 +46,7 @@ export interface WithChildrenProps {
|
|
|
46
46
|
children?: VDOMNode[] | VDOMNode | string | Function;
|
|
47
47
|
}
|
|
48
48
|
export type ComponentType<Props = any, ComponentState = any, Context = any> = new (props: Props, parentComponent: Component<{}, any, null> | null) => Component<Props, ComponentState, Context>;
|
|
49
|
+
export type Consumer<T> = Component<{}, {}, T>;
|
|
50
|
+
export type Provider<T> = Component<{
|
|
51
|
+
value: T;
|
|
52
|
+
}>;
|