Merge pull request #22181 from R1ZZU/master

Add types for styled-jsx
This commit is contained in:
Arthur Ozga
2017-12-22 18:01:38 -08:00
committed by GitHub
4 changed files with 54 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for styled-jsx 2.2
// Project: https://github.com/zeit/styled-jsx
// Definitions by: R1ZZU <https://github.com/R1ZZU>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import "react";
declare module "react" {
interface StyleHTMLAttributes<T> extends 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" }