diff --git a/packages/react-json-tree/package.json b/packages/react-json-tree/package.json index 638099d4..25dfb43b 100644 --- a/packages/react-json-tree/package.json +++ b/packages/react-json-tree/package.json @@ -46,6 +46,7 @@ }, "dependencies": { "@babel/runtime": "^7.17.9", + "@types/lodash": "^4.14.182", "@types/prop-types": "^15.7.5", "prop-types": "^15.8.1", "react-base16-styling": "^0.9.1" diff --git a/packages/react-json-tree/src/createStylingFromTheme.ts b/packages/react-json-tree/src/createStylingFromTheme.ts index 492d7fd3..2306b91c 100644 --- a/packages/react-json-tree/src/createStylingFromTheme.ts +++ b/packages/react-json-tree/src/createStylingFromTheme.ts @@ -1,9 +1,11 @@ +import type { CurriedFunction1 } from 'lodash'; import { Base16Theme, createStyling, StylingConfig, } from 'react-base16-styling'; import solarized from './themes/solarized'; +import { StylingFunction, Theme } from 'react-base16-styling/src'; const colorMap = (theme: Base16Theme) => ({ BACKGROUND_COLOR: theme.base00, @@ -196,6 +198,11 @@ const getDefaultThemeStyling = (theme: Base16Theme): StylingConfig => { }; }; -export default createStyling(getDefaultThemeStyling, { +const createStylingFromTheme: CurriedFunction1< + Theme | undefined, + StylingFunction +> = createStyling(getDefaultThemeStyling, { defaultBase16: solarized, }); + +export default createStylingFromTheme; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5bf96497..1d5ff22b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -578,6 +578,7 @@ importers: '@rollup/plugin-commonjs': ^22.0.0 '@rollup/plugin-node-resolve': ^13.3.0 '@types/jest': ^27.5.0 + '@types/lodash': ^4.14.182 '@types/prop-types': ^15.7.5 '@types/react': ^17.0.44 '@types/react-test-renderer': ^17.0.2 @@ -602,6 +603,7 @@ importers: typescript: ~4.5.5 dependencies: '@babel/runtime': 7.17.9 + '@types/lodash': 4.14.182 '@types/prop-types': 15.7.5 prop-types: 15.8.1 react-base16-styling: link:../react-base16-styling