diff --git a/packages/react-base16-styling/src/index.ts b/packages/react-base16-styling/src/index.ts index 25b148b2..708ac783 100644 --- a/packages/react-base16-styling/src/index.ts +++ b/packages/react-base16-styling/src/index.ts @@ -1,5 +1,6 @@ import curry from 'lodash.curry'; import * as base16 from 'base16'; +import { Base16Theme } from 'base16'; import rgb2hex from 'pure-color/convert/rgb2hex'; import parse from 'pure-color/parse'; import flow from 'lodash.flow'; @@ -148,7 +149,7 @@ const getStylingByKeys = (mergedStyling, keys, ...args) => { return props; }; -export const invertBase16Theme = (base16Theme) => +export const invertBase16Theme = (base16Theme: Base16Theme) => Object.keys(base16Theme).reduce( (t, key) => ( (t[key] = /^base/.test(key) diff --git a/packages/react-base16-styling/src/types.ts b/packages/react-base16-styling/src/types.ts index e69de29b..20cfc650 100644 --- a/packages/react-base16-styling/src/types.ts +++ b/packages/react-base16-styling/src/types.ts @@ -0,0 +1,3 @@ +import { Base16Theme } from 'base16'; + +export type Theme = string | Base16Theme | StylingConfig; diff --git a/packages/react-base16-styling/test/index.test.ts b/packages/react-base16-styling/test/index.test.ts index d1de7720..b1b71766 100644 --- a/packages/react-base16-styling/test/index.test.ts +++ b/packages/react-base16-styling/test/index.test.ts @@ -1,5 +1,5 @@ import { createStyling, invertBase16Theme, getBase16Theme } from '../src'; -import apathy from 'base16/lib/apathy'; +import { apathy } from 'base16'; const base16Theme = { scheme: 'myscheme',