-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate @emotion/css to TypeScript (#2558)
- Loading branch information
Showing
9 changed files
with
99 additions
and
139 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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