Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Fixed import statement, for d.ts files #56

Closed
wants to merge 1 commit into from

Conversation

smykhailov
Copy link
Collaborator

I've realized that TypeScript compiler generates wrong import paths for some of the types: rules and variables. This happens because we use implicit import for static properties and compiler inlines import statements.
To avoid this, we have to explicitly specify the type of the rules and/or variables or remove typing for such properties, if it is more appropriate.

@@ -19,7 +19,7 @@ class Button extends UIComponent<any, any> {

public static rules = buttonRules

public static variables = buttonVariables
public static variables: (x) => IButtonVariables = buttonVariables
Copy link
Member

Choose a reason for hiding this comment

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

I have removed all static rules and variables in #16. We're breaking that PR down into several smaller PRs, however, there will be no more static rules/variables in any components moving forward.


export default {
root: ({
props: { atMention, disabled, error, size, important, success, timestamp, truncated },
variables: v,
}: TextRulesParams) => ({
}: any) => ({
Copy link
Member

Choose a reason for hiding this comment

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

This is also changed in #16, there will be a break out PR that introduces proper baseline typings for styles.

export const felaRenderer = createRenderer(createRendererConfig())
export const felaRtlRenderer = createRenderer(createRendererConfig({ isRtl: true }))
export const felaRenderer: IRenderer = createRenderer(createRendererConfig())
export const felaRtlRenderer: IRenderer = createRenderer(createRendererConfig({ isRtl: true }))
Copy link
Member

Choose a reason for hiding this comment

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

This is also a change that has been implemented in #16 while updating typings.

Copy link
Member

@levithomason levithomason left a comment

Choose a reason for hiding this comment

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

Given most of the changes here are not applicable after #16 lands, and the remaining changes are also implemented there, I propose we close this PR for now and wait until we're done integrating #16's changes.

@smykhailov
Copy link
Collaborator Author

Agree, let me close this PR and wait for #16 to be merged.

@smykhailov smykhailov closed this Aug 8, 2018
@levithomason levithomason deleted the fix/fix-dts-imports branch August 8, 2018 19:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants