@zenflux/react-commander 0.0.7 → 0.0.9

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 CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/package.json",
3
3
  "name": "@zenflux/react-commander",
4
4
  "author": "Leonid Vinikov <leonidvinikov@gmail.com> (https://github.com/iNewLegend)",
5
- "version": "0.0.7",
5
+ "version": "0.0.9",
6
6
  "type": "module",
7
7
  "sideEffects": false,
8
8
  "types": "src/index.ts",
@@ -7,6 +7,8 @@ import {
7
7
  UNREGISTER_INTERNAL_SYMBOL
8
8
  } from "./constants";
9
9
 
10
+ import { version } from "../../package.json";
11
+
10
12
  import type { DCoreContext, DCoreInterface, DCoreRegisterArgs } from "./definitions";
11
13
 
12
14
  import type { DCommandSingleComponentContext } from "@zenflux/react-commander/definitions";
@@ -44,6 +46,8 @@ function setSortedContextKeys( keys: string[] ) {
44
46
  * It provides methods to register, unregister, get and link components.
45
47
  */
46
48
  class Core implements DCoreInterface {
49
+ public version = version;
50
+
47
51
  /**
48
52
  * Registers the context for a React component.
49
53
  */
@@ -30,6 +30,8 @@ export type DCoreRegisterArgs = {
30
30
  };
31
31
 
32
32
  export interface DCoreInterface {
33
+ version: string;
34
+
33
35
  __devGetContextValues: () => DCommandSingleComponentContext[];
34
36
  __devGetContextKeys: () => string[];
35
37
  __devGetContextLength: () => number;
@@ -22,9 +22,12 @@ import type { CommandBase } from "@zenflux/react-commander/command-base";
22
22
  *
23
23
  * Sugar, e.g `ComponentType.getName` not `ComponentInstance`
24
24
  **/
25
- export interface DCommandFunctionComponent<TProps = any, TState = undefined> extends React.FC<TProps> {
25
+ export interface DCommandFunctionComponent<TProps = object, TState = undefined> {
26
26
  ( props: TProps, state?: TState ): React.ReactNode;
27
27
 
28
+ displayName?: string;
29
+ defaultProps?: Partial<TProps>;
30
+
28
31
  // Those methods always implemented "under the hood"
29
32
  getName?(): string;
30
33
  }