@tradingaction/utils 2.0.15 → 2.1.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.
@@ -6,16 +6,14 @@ export interface WithRatioState {
6
6
  ratio: number;
7
7
  }
8
8
  export declare const withDeviceRatio: () => <TProps extends WithRatioProps>(OriginalComponent: React.ComponentClass<TProps, any>) => {
9
- new (props: Omit<TProps, "ratio"> | Readonly<Omit<TProps, "ratio">>): {
9
+ new (props: Omit<TProps, "ratio">): {
10
10
  readonly ref: React.RefObject<HTMLCanvasElement>;
11
11
  componentDidMount(): void;
12
- render(): JSX.Element;
13
- context: any;
12
+ render(): React.JSX.Element;
13
+ context: unknown;
14
14
  setState<K extends "ratio">(state: WithRatioState | ((prevState: Readonly<WithRatioState>, props: Readonly<Omit<TProps, "ratio">>) => WithRatioState | Pick<WithRatioState, K> | null) | Pick<WithRatioState, K> | null, callback?: (() => void) | undefined): void;
15
15
  forceUpdate(callback?: (() => void) | undefined): void;
16
- readonly props: Readonly<Omit<TProps, "ratio">> & Readonly<{
17
- children?: React.ReactNode;
18
- }>;
16
+ readonly props: Readonly<Omit<TProps, "ratio">>;
19
17
  state: Readonly<WithRatioState>;
20
18
  refs: {
21
19
  [key: string]: React.ReactInstance;
@@ -35,13 +33,11 @@ export declare const withDeviceRatio: () => <TProps extends WithRatioProps>(Orig
35
33
  new (props: Omit<TProps, "ratio">, context: any): {
36
34
  readonly ref: React.RefObject<HTMLCanvasElement>;
37
35
  componentDidMount(): void;
38
- render(): JSX.Element;
39
- context: any;
36
+ render(): React.JSX.Element;
37
+ context: unknown;
40
38
  setState<K extends "ratio">(state: WithRatioState | ((prevState: Readonly<WithRatioState>, props: Readonly<Omit<TProps, "ratio">>) => WithRatioState | Pick<WithRatioState, K> | null) | Pick<WithRatioState, K> | null, callback?: (() => void) | undefined): void;
41
39
  forceUpdate(callback?: (() => void) | undefined): void;
42
- readonly props: Readonly<Omit<TProps, "ratio">> & Readonly<{
43
- children?: React.ReactNode;
44
- }>;
40
+ readonly props: Readonly<Omit<TProps, "ratio">>;
45
41
  state: Readonly<WithRatioState>;
46
42
  refs: {
47
43
  [key: string]: React.ReactInstance;
package/lib/withSize.d.ts CHANGED
@@ -5,14 +5,12 @@ export interface WithSizeProps {
5
5
  readonly height: number;
6
6
  }
7
7
  export declare const withSize: (props?: Omit<AutoSizerProps, "children">) => <TProps extends WithSizeProps>(OriginalComponent: React.ComponentClass<TProps, any>) => {
8
- new (props: Omit<TProps, "height" | "width"> | Readonly<Omit<TProps, "height" | "width">>): {
9
- render(): JSX.Element;
10
- context: any;
8
+ new (props: Omit<TProps, "height" | "width">): {
9
+ render(): React.JSX.Element;
10
+ context: unknown;
11
11
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<TProps, "height" | "width">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
12
12
  forceUpdate(callback?: (() => void) | undefined): void;
13
- readonly props: Readonly<Omit<TProps, "height" | "width">> & Readonly<{
14
- children?: React.ReactNode;
15
- }>;
13
+ readonly props: Readonly<Omit<TProps, "height" | "width">>;
16
14
  state: Readonly<{}>;
17
15
  refs: {
18
16
  [key: string]: React.ReactInstance;
@@ -31,13 +29,11 @@ export declare const withSize: (props?: Omit<AutoSizerProps, "children">) => <TP
31
29
  UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<TProps, "height" | "width">>, nextState: Readonly<{}>, nextContext: any): void;
32
30
  };
33
31
  new (props: Omit<TProps, "height" | "width">, context: any): {
34
- render(): JSX.Element;
35
- context: any;
32
+ render(): React.JSX.Element;
33
+ context: unknown;
36
34
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<TProps, "height" | "width">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
37
35
  forceUpdate(callback?: (() => void) | undefined): void;
38
- readonly props: Readonly<Omit<TProps, "height" | "width">> & Readonly<{
39
- children?: React.ReactNode;
40
- }>;
36
+ readonly props: Readonly<Omit<TProps, "height" | "width">>;
41
37
  state: Readonly<{}>;
42
38
  refs: {
43
39
  [key: string]: React.ReactInstance;
@@ -1 +1 @@
1
- {"version":3,"file":"withSize.js","sourceRoot":"","sources":["../src/withSize.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAsC,MAAM,8BAA8B,CAAC;AAOlF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAwC,EAAE,EAAE;IACjE,OAAO,CAA+B,iBAA+C,EAAE,EAAE;QACrF,OAAO,MAAM,QAAS,SAAQ,KAAK,CAAC,SAA2C;YACpE,MAAM;gBACT,OAAO,CACH,oBAAC,SAAS,oBAAK,KAAK,GACf,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;oBACnB,OAAO,oBAAC,iBAAiB,oBAAM,IAAI,CAAC,KAAgB,IAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;gBAC3F,CAAC,CACO,CACf,CAAC;YACN,CAAC;SACJ,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"withSize.js","sourceRoot":"","sources":["../src/withSize.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,SAAsC,MAAM,8BAA8B,CAAC;AAOlF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAwC,EAAE,EAAE;IACjE,OAAO,CAA+B,iBAA+C,EAAE,EAAE;QACrF,OAAO,MAAM,QAAS,SAAQ,KAAK,CAAC,SAA2C;YACpE,MAAM;gBACT,OAAO,CACH,oBAAC,SAAS,oBAAK,KAAY,GACtB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAO,EAAE,EAAE;oBACxB,OAAO,oBAAC,iBAAiB,oBAAM,IAAI,CAAC,KAAgB,IAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;gBAC3F,CAAC,CACO,CACf,CAAC;YACN,CAAC;SACJ,CAAC;IACN,CAAC,CAAC;AACN,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradingaction/utils",
3
- "version": "2.0.15",
3
+ "version": "2.1.1",
4
4
  "description": "Utils for react-financial-charts",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -44,5 +44,5 @@
44
44
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0",
45
45
  "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
46
46
  },
47
- "gitHead": "e12c129340de3cfc35167df7f195a8b316c879a6"
47
+ "gitHead": "7491d9931380aafbdf99dfbdb06e1e2705c99fb9"
48
48
  }
package/src/withSize.tsx CHANGED
@@ -11,8 +11,8 @@ export const withSize = (props?: Omit<AutoSizerProps, "children">) => {
11
11
  return class WithSize extends React.Component<Omit<TProps, "width" | "height">> {
12
12
  public render() {
13
13
  return (
14
- <AutoSizer {...props}>
15
- {({ height, width }) => {
14
+ <AutoSizer {...props as any}>
15
+ {({ height, width }: any) => {
16
16
  return <OriginalComponent {...(this.props as TProps)} height={height} width={width} />;
17
17
  }}
18
18
  </AutoSizer>