add types for styled-jsx

This commit is contained in:
Andrei Volchenko
2017-12-14 14:28:43 +03:00
parent 22f0a1d2eb
commit e0ecca30c1
4 changed files with 53 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for styled-jsx 2.2.1
// Project: https://github.com/zeit/styled-jsx
// Definitions by: R1ZZU <https://github.com/R1ZZU>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as React from 'react';
declare module 'react' {
interface StyleHTMLAttributes<T> extends React.HTMLAttributes<T> {
jsx?: boolean;
global?: boolean;
}
}
+15
View File
@@ -0,0 +1,15 @@
const styled = (
<div>
<style jsx>{`
color: rebeccapurple;
`}</style>
</div>
);
const styledGlobal = (
<div>
<style jsx global>{`
color: rebeccapurple;
`}</style>
</div>
);
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react"
},
"files": [
"index.d.ts",
"styled-jsx-tests.tsx"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }