chakra-ui-flashless
chakra-ui-flashless copied to clipboard
Export type definitions
This PR implement changes to explicitly export type definitions.
The following error occurs when declaring an object with color variables in a separate module, instead of defining inline.
In order to type the object, the package should export the respective type, like so:
import { Types } from 'chakra-ui-flashless'
export const colorModeVariables: Types.Variables = { ... }
Thanks for the PR @LauraBeatris! Sorry it took so long for me to have a look at this. How do you feel about just exporting the types as named exports from the package, rather than exporting them as a Types
export? I don't have a lot of TS experience, but I thought I remembered seeing this convention in some other packages.
// in the module
export * from './types';
// and then later...
import { Variables } from 'chakra-ui-flashless';
export const colorModeVariables: Variables = { ... }
We could even simplify this further by just saying export type ...
in the FlashlessScript.tsx
file, since we're exporting everything exported by that file in index.ts
. Do you see any problems with doing it this way?