diff --git a/tslib/react/.gitignore b/tslib/react/.gitignore index 97623394..3595b17b 100644 --- a/tslib/react/.gitignore +++ b/tslib/react/.gitignore @@ -10,6 +10,7 @@ lerna-debug.log* node_modules pkg types +!src/types # Editor directories and files .vscode/* diff --git a/tslib/react/src/components/GraphContainer.tsx b/tslib/react/src/components/GraphContainer.tsx index ed151e99..c8bca39d 100644 --- a/tslib/react/src/components/GraphContainer.tsx +++ b/tslib/react/src/components/GraphContainer.tsx @@ -1,10 +1,10 @@ import { Box, Typography, useTheme } from "@mui/material" -import * as Optuna from "@optuna/types" import { FC } from "react" +import { GraphComponentState } from "../types" export const GraphContainer: FC<{ plotDomId: string - graphComponentState: Optuna.GraphComponentState + graphComponentState: GraphComponentState }> = ({ plotDomId, graphComponentState }) => { const theme = useTheme() return ( diff --git a/tslib/react/src/hooks/useGraphComponentState.ts b/tslib/react/src/hooks/useGraphComponentState.ts index a9de01dd..a073a51a 100644 --- a/tslib/react/src/hooks/useGraphComponentState.ts +++ b/tslib/react/src/hooks/useGraphComponentState.ts @@ -1,9 +1,9 @@ -import * as Optuna from "@optuna/types" import { useEffect, useState } from "react" +import { GraphComponentState } from "../types" export const useGraphComponentState = () => { const [graphComponentState, setGraphComponentState] = - useState("componentWillMount") + useState("componentWillMount") useEffect(() => { setGraphComponentState("componentDidMount") }, []) diff --git a/tslib/react/src/index.ts b/tslib/react/src/index.ts index 7a21895d..6f236a2e 100644 --- a/tslib/react/src/index.ts +++ b/tslib/react/src/index.ts @@ -17,3 +17,4 @@ export { useObjectiveAndUserAttrTargets, useObjectiveAndUserAttrTargetsFromStudies, } from "./utils/trialFilter" +export type { GraphComponentState } from "./types" diff --git a/tslib/react/src/types/index.ts b/tslib/react/src/types/index.ts new file mode 100644 index 00000000..7794dc64 --- /dev/null +++ b/tslib/react/src/types/index.ts @@ -0,0 +1,4 @@ +export type GraphComponentState = + | "componentWillMount" + | "componentDidMount" + | "graphDidRender" diff --git a/tslib/types/src/index.ts b/tslib/types/src/index.ts index 96ecfa66..40073924 100644 --- a/tslib/types/src/index.ts +++ b/tslib/types/src/index.ts @@ -93,8 +93,3 @@ export type ParamImportance = { name: string importance: number } - -export type GraphComponentState = - | "componentWillMount" - | "componentDidMount" - | "graphDidRender"