Skip to content

Instantly share code, notes, and snippets.

@michaelgmcd
Created March 14, 2017 02:25
Show Gist options
  • Save michaelgmcd/3d858a04a7efc39dbbbf00596bdba8cd to your computer and use it in GitHub Desktop.
Save michaelgmcd/3d858a04a7efc39dbbbf00596bdba8cd to your computer and use it in GitHub Desktop.
Flow declaration file for styled-components
// @flow
type Interpolation = ((executionContext: Object) => string) | string | number;
type StyledComponent = (
strings: Array<string>,
...interpolations: Array<Interpolation>
) => ReactClass<any>;
declare module 'styled-components' {
declare var exports: {
(baseComponent: ReactClass<any>): StyledComponent,
a: StyledComponent,
abbr: StyledComponent,
address: StyledComponent,
area: StyledComponent,
article: StyledComponent,
aside: StyledComponent,
audio: StyledComponent,
b: StyledComponent,
base: StyledComponent,
bdi: StyledComponent,
bdo: StyledComponent,
big: StyledComponent,
blockquote: StyledComponent,
body: StyledComponent,
br: StyledComponent,
button: StyledComponent,
canvas: StyledComponent,
caption: StyledComponent,
cite: StyledComponent,
code: StyledComponent,
col: StyledComponent,
colgroup: StyledComponent,
data: StyledComponent,
datalist: StyledComponent,
dd: StyledComponent,
del: StyledComponent,
details: StyledComponent,
dfn: StyledComponent,
dialog: StyledComponent,
div: StyledComponent,
dl: StyledComponent,
dt: StyledComponent,
em: StyledComponent,
embed: StyledComponent,
fieldset: StyledComponent,
figcaption: StyledComponent,
figure: StyledComponent,
footer: StyledComponent,
form: StyledComponent,
h1: StyledComponent,
h2: StyledComponent,
h3: StyledComponent,
h4: StyledComponent,
h5: StyledComponent,
h6: StyledComponent,
head: StyledComponent,
header: StyledComponent,
hgroup: StyledComponent,
hr: StyledComponent,
html: StyledComponent,
i: StyledComponent,
iframe: StyledComponent,
img: StyledComponent,
input: StyledComponent,
ins: StyledComponent,
kbd: StyledComponent,
keygen: StyledComponent,
label: StyledComponent,
legend: StyledComponent,
li: StyledComponent,
link: StyledComponent,
main: StyledComponent,
map: StyledComponent,
mark: StyledComponent,
menu: StyledComponent,
menuitem: StyledComponent,
meta: StyledComponent,
meter: StyledComponent,
nav: StyledComponent,
noscript: StyledComponent,
object: StyledComponent,
ol: StyledComponent,
optgroup: StyledComponent,
option: StyledComponent,
output: StyledComponent,
p: StyledComponent,
param: StyledComponent,
picture: StyledComponent,
pre: StyledComponent,
progress: StyledComponent,
q: StyledComponent,
rp: StyledComponent,
rt: StyledComponent,
ruby: StyledComponent,
s: StyledComponent,
samp: StyledComponent,
script: StyledComponent,
section: StyledComponent,
select: StyledComponent,
small: StyledComponent,
source: StyledComponent,
span: StyledComponent,
strong: StyledComponent,
style: StyledComponent,
sub: StyledComponent,
summary: StyledComponent,
sup: StyledComponent,
table: StyledComponent,
tbody: StyledComponent,
td: StyledComponent,
textarea: StyledComponent,
tfoot: StyledComponent,
th: StyledComponent,
thead: StyledComponent,
time: StyledComponent,
title: StyledComponent,
tr: StyledComponent,
track: StyledComponent,
u: StyledComponent,
ul: StyledComponent,
var: StyledComponent,
video: StyledComponent,
wbr: StyledComponent,
// SVG
circle: StyledComponent,
clipPath: StyledComponent,
defs: StyledComponent,
ellipse: StyledComponent,
g: StyledComponent,
image: StyledComponent,
line: StyledComponent,
linearGradient: StyledComponent,
mask: StyledComponent,
path: StyledComponent,
pattern: StyledComponent,
polygon: StyledComponent,
polyline: StyledComponent,
radialGradient: StyledComponent,
rect: StyledComponent,
stop: StyledComponent,
svg: StyledComponent,
text: StyledComponent,
tspan: StyledComponent,
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment