Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TS typings to create-emotion #663

Merged
merged 5 commits into from
May 22, 2018

Conversation

Ailrun
Copy link
Member

@Ailrun Ailrun commented May 19, 2018

What: Add typings for create-emotion package

Why: To make TS user be able to use create-emotion package.

How: Using csstype package, who crawls css data from MDN.

Checklist:

  • [N/A] Documentation
  • Tests
  • Code complete

I'm willing to add more strict typing (and the typing providing helpful autocompletions) for emotion package, but I think I should add typings for create-emotion, to avoid repeated code and revesed dependencies between typings.

@Ailrun Ailrun force-pushed the typings/create-emotion branch from 78ac40c to 8abeff7 Compare May 19, 2018 21:30
@Ailrun Ailrun force-pushed the typings/create-emotion branch from 8abeff7 to cdcb3fe Compare May 19, 2018 21:31
Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

Thanks!!!

css([]);
css([1]);
css([['abc', 'asdf'], 'efw']);

Copy link
Member

Choose a reason for hiding this comment

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

Could you add a test with the string syntax, for example:

css`
 color: ${'hotpink'};
`

Copy link
Member Author

Choose a reason for hiding this comment

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

I added them! Thank you for your feedback!

| FunctionInterpolation<C>
;

export type FunctionClassNameArg = () => ClassNameArg | void;
Copy link
Member

@emmatown emmatown May 20, 2018

Choose a reason for hiding this comment

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

Could you remove this? We recently deprecated it in #643 so it would be nice to not have it in the typings.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK. I removed them.

}
export interface CSSObject<C> extends CSSBaseObject, CSSPseudoObject<C>, CSSOthersObject<C> {}

export type FunctionInterpolation<C> = (mergedProps: any, context: C) => Interpolation<C> | void;
Copy link
Member

@emmatown emmatown May 20, 2018

Choose a reason for hiding this comment

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

Same as above. We recently deprecated it in #643 so it would be nice to not have it in the typings.

@emmatown emmatown merged commit 132dee4 into emotion-js:master May 22, 2018
@Ailrun
Copy link
Member Author

Ailrun commented May 22, 2018

@mitchellhamilton Could I ask about release schedule? When will this be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants