back-testing-react 1.0.0 → 1.0.2

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/types.d.ts CHANGED
@@ -1,2 +1,71 @@
1
+ import { Point } from 'geojson';
2
+ import React$1 from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
4
 
2
- export { }
5
+ interface StormPayout {
6
+ name: string;
7
+ year: number;
8
+ windspeedMPH: number;
9
+ proxyPayout: number;
10
+ anemometerPayout: number;
11
+ category: number;
12
+ ciacPayout: number;
13
+ maxRecovery: number;
14
+ maxRecoveryAmount: number;
15
+ color?: string;
16
+ stormTrack: {
17
+ NAME: string;
18
+ SEASON: number;
19
+ ISO_TIME: string;
20
+ USA_WIND: number;
21
+ USA_SSHS: number;
22
+ LOCATION: Point;
23
+ }[];
24
+ }
25
+
26
+ interface Payout {
27
+ category: number;
28
+ payout: number;
29
+ }
30
+ interface BackTestingMapProps {
31
+ mapAccessToken: string;
32
+ apiAccessToken: string;
33
+ location: {
34
+ longitude: number;
35
+ latitude: number;
36
+ } | undefined | null;
37
+ limit: number | undefined | null;
38
+ ciacRadius: number | undefined | null;
39
+ anemometerCode: string;
40
+ proxyPayouts: Payout[];
41
+ anemometerPayouts: Payout[];
42
+ ciacPayouts: Payout[];
43
+ includeNoNameStorms?: boolean;
44
+ includeZeroPayouts?: boolean;
45
+ onViewChange?: (view: MapView) => void;
46
+ onCalculatePayouts?: (payouts: StormPayout[]) => void;
47
+ }
48
+ interface BackTestingActions {
49
+ calculatePayouts: (proxyPayouts: Payout[], anemometerCode: string, anemometerPayouts: Payout[], ciacPayouts: Payout[], includeNoNameStorms: boolean, includeZeroPayouts: boolean, limit: number) => void;
50
+ }
51
+ declare enum MapView {
52
+ CAT_INTENSITY = "__cat_view",
53
+ STORMS = "__storms_view"
54
+ }
55
+
56
+ declare const BackTestingMap: React$1.ForwardRefExoticComponent<BackTestingMapProps & React$1.RefAttributes<BackTestingActions>>;
57
+
58
+ interface BackTestingCatLegendProps {
59
+ className?: string;
60
+ }
61
+
62
+ declare const BackTestingCatLegend: React.FC<BackTestingCatLegendProps>;
63
+
64
+ interface BackTestingStormLegendProps {
65
+ className?: string;
66
+ stormTracks?: StormPayout[];
67
+ }
68
+
69
+ declare const BackTestingStormLegend: (props: BackTestingStormLegendProps) => react_jsx_runtime.JSX.Element;
70
+
71
+ export { BackTestingCatLegend, BackTestingMap, BackTestingStormLegend };
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "back-testing-react",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Parametric back testing application developed by NormanMax Insurance Solutions",
5
- "main": "dist/cjs/index.js",
6
- "module": "dist/esm/index.js",
7
- "types": "dist/index.d.ts",
5
+ "main": "dist/cjs/index",
6
+ "module": "dist/esm/index",
7
+ "types": "dist/index",
8
8
  "scripts": {
9
+ "clean": "rimraf dist",
10
+ "prerollup": "npm run clean",
9
11
  "rollup": "rollup -c --bundleConfigAsCjs",
10
12
  "storybook": "storybook dev -p 6006",
11
13
  "build-storybook": "storybook build"
@@ -27,7 +29,6 @@
27
29
  "@storybook/react-vite": "^8.4.2",
28
30
  "@storybook/test": "^8.4.2",
29
31
  "@types/react": "^18.3.12",
30
- "react": "^18.3.1",
31
32
  "rollup": "^4.25.0",
32
33
  "rollup-plugin-dts": "^6.1.1",
33
34
  "rollup-plugin-peer-deps-external": "^2.2.4",
@@ -44,6 +45,10 @@
44
45
  "@turf/turf": "^7.1.0",
45
46
  "@types/react-dom": "^18.3.1",
46
47
  "mapbox-gl": "^3.8.0",
48
+ "rimraf": "^6.0.1"
49
+ },
50
+ "peerDependencies": {
51
+ "react": "^18.3.1",
47
52
  "react-dom": "^18.3.1"
48
53
  }
49
54
  }
@@ -3,7 +3,7 @@ import { generateCATColor } from '../back-testing-map/back-testing-map.types';
3
3
  import './back-testing-cat-legend.css'
4
4
  import { BackTestingCatLegendProps } from './back-testing-cat-legend.types';
5
5
 
6
- const BackTestingCatLegend = (props: BackTestingCatLegendProps) => {
6
+ const BackTestingCatLegend: React.FC<BackTestingCatLegendProps> = (props) => {
7
7
  return(
8
8
  <div className={props.className + " legend"}>
9
9
  <div className="item-container">
@@ -1 +1,2 @@
1
- export {default} from './back-testing-cat-legend';
1
+ import BackTestingCatLegend from './back-testing-cat-legend';
2
+ export {BackTestingCatLegend}
@@ -9,8 +9,8 @@ import * as turf from "@turf/turf";
9
9
 
10
10
  import React, { forwardRef, useImperativeHandle } from "react";
11
11
  import { fetchPayouts, StormPayout } from "./back-testing-map.service";
12
- import BackTestingCatLegend from "../back-testing-cat-legend";
13
- import BackTestingStormLegend from "../back-testing-storm-legend";
12
+ import { BackTestingCatLegend } from "../back-testing-cat-legend";
13
+ import { BackTestingStormLegend } from "../back-testing-storm-legend";
14
14
  import { ToggleButton, ToggleButtonGroup } from "@mui/material";
15
15
 
16
16
 
@@ -1 +1,3 @@
1
- export {default} from './back-testing-map';
1
+ import BackTestingMap from './back-testing-map';
2
+
3
+ export {BackTestingMap}
@@ -1 +1,2 @@
1
- export {default} from './back-testing-storm-legend';
1
+ import BackTestingStormLegend from './back-testing-storm-legend';
2
+ export {BackTestingStormLegend}