-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Migrate @emotion/css to TypeScript #2558
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b98c0d6
Migrate @emotion/css
emmatown 9f25b29
Newlines
emmatown d210619
Merge branch 'main' into ts-migration
emmatown 22d7b9b
Merge branch 'ts-migration' into migrate-emotion-css
emmatown 4df6c6c
Fix error on older TS versions in type tests
emmatown f1c1b16
Merge branch 'ts-migration' into migrate-emotion-css
emmatown a04d0c4
Update packages/css/src/create-instance.ts
emmatown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@emotion/css': minor | ||
| --- | ||
|
|
||
| Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@emotion/css': patch | ||
| --- | ||
|
|
||
| Fixed `options` parameter to `createEmotion` from `@emotion/css/create-instance` incorrectly being marked as optional when it's required. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,55 +1,4 @@ | ||
| // Definitions by: Junyoung Clare Jang <https://github.com/Ailrun> | ||
| // TypeScript Version: 2.8 | ||
|
|
||
| import { EmotionCache, Options } from '@emotion/cache' | ||
| import { CSSInterpolation } from '@emotion/serialize' | ||
| import { StyleSheet } from '@emotion/sheet' | ||
|
|
||
| export { | ||
| CSSInterpolation, | ||
| ArrayCSSInterpolation, | ||
| ComponentSelector, | ||
| CSSObject | ||
| } from '@emotion/serialize' | ||
|
|
||
| export { EmotionCache, Options } | ||
|
|
||
| export interface ArrayClassNamesArg extends Array<ClassNamesArg> {} | ||
| export type ClassNamesArg = | ||
| | undefined | ||
| | null | ||
| | string | ||
| | boolean | ||
| | { [className: string]: boolean | null | undefined } | ||
| | ArrayClassNamesArg | ||
|
|
||
| export interface CSSStyleSheet extends StyleSheet { | ||
| speedy(value: boolean): void | ||
| } | ||
|
|
||
| export interface Emotion { | ||
| css(template: TemplateStringsArray, ...args: Array<CSSInterpolation>): string | ||
| css(...args: Array<CSSInterpolation>): string | ||
| cx(...classNames: Array<ClassNamesArg>): string | ||
| flush(): void | ||
| hydrate(ids: Array<string>): void | ||
| injectGlobal( | ||
| template: TemplateStringsArray, | ||
| ...args: Array<CSSInterpolation> | ||
| ): void | ||
| injectGlobal(...args: Array<CSSInterpolation>): void | ||
| keyframes( | ||
| template: TemplateStringsArray, | ||
| ...args: Array<CSSInterpolation> | ||
| ): string | ||
| keyframes(...args: Array<CSSInterpolation>): string | ||
| sheet: CSSStyleSheet | ||
| cache: EmotionCache | ||
| merge(className: string): string | ||
| getRegisteredStyles( | ||
| registeredStyles: Array<string>, | ||
| className: string | ||
| ): string | ||
| } | ||
|
|
||
| export default function createEmotion(options?: Options): Emotion | ||
| export * from '../create-instance' | ||
| export { default } from '../create-instance' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1 @@ | ||
| // Definitions by: Junyoung Clare Jang <https://github.com/Ailrun> | ||
| // TypeScript Version: 2.8 | ||
|
|
||
| import { Emotion } from './create-instance' | ||
|
|
||
| export { | ||
| ArrayClassNamesArg, | ||
| ArrayCSSInterpolation, | ||
| ClassNamesArg, | ||
| ComponentSelector, | ||
| EmotionCache, | ||
| CSSInterpolation, | ||
| CSSObject, | ||
| CSSStyleSheet | ||
| } from './create-instance' | ||
|
|
||
| export const flush: Emotion['flush'] | ||
| export const hydrate: Emotion['hydrate'] | ||
| export const cx: Emotion['cx'] | ||
| export const merge: Emotion['merge'] | ||
| export const getRegisteredStyles: Emotion['getRegisteredStyles'] | ||
| export const css: Emotion['css'] | ||
| export const injectGlobal: Emotion['injectGlobal'] | ||
| export const keyframes: Emotion['keyframes'] | ||
| export const sheet: Emotion['sheet'] | ||
| export const cache: Emotion['cache'] | ||
| export * from '..' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.