Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

fix: export superset theme props #391

Merged
merged 2 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/superset-ui-style/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ const defaultTheme = {
export default styled as CreateStyled<typeof defaultTheme>;

export const supersetTheme = defaultTheme;

export interface SupersetThemeProps {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this problem still persists with exporting types. We can try this first if you'd like, but if you run into issue later in the consuming app about "reexporting type", please come back here and move the definition of the interface to a new file such as types.ts

types.ts

export interface SupersetThemeProps {
 theme: typeof defaultTheme;
}

then export all from the type file like this in the index.ts

export default styled as CreateStyled<typeof defaultTheme>;
export const supersetTheme = defaultTheme;
export * from './types'

theme: typeof defaultTheme;
}
9 changes: 8 additions & 1 deletion packages/superset-ui-style/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { supersetTheme } from '../src';
import styled, { supersetTheme, SupersetThemeProps } from '../src';

describe('@superset-ui/style package', () => {
it('exports a theme', () => {
Expand All @@ -8,4 +8,11 @@ describe('@superset-ui/style package', () => {
it('exports styled component templater', () => {
expect(typeof styled.div).toBe('function');
});

it('exports SupersetThemeProps', () => {
const props: SupersetThemeProps = {
theme: supersetTheme,
};
expect(typeof props).toBe('object');
});
});