import { createGlobalStyle as scCreateGlobalStyle } from 'styled-components' ; import { StyleGenerator } from '@xstyled/system' ; import { createCssFunction } from './createCssFunction' ; export type XCreateGlobalStyle = typeof scCreateGlobalStyle ; export const createCreateGlobalStyle = < TGen extends StyleGenerator > ( generator ) : XCreateGlobalStyle => { const css = createCssFunction ( generator ) ; return ( ( ... args ) : ReturnType < XCreateGlobalStyle > => scCreateGlobalStyle ( [ css ( ... args ) , ] ) ) as XCreateGlobalStyle ; } ;