refactor and fix linting

This commit is contained in:
Arjan Jassal
2018-10-31 20:39:08 -07:00
parent 3e4f4a77e5
commit 787ac3cc66
3 changed files with 16 additions and 24 deletions
+11 -13
View File
@@ -2,9 +2,11 @@
// Project: https://github.com/styled-components/styled-theming#readme
// Definitions by: Arjan Jassal <https://github.com/ArjanJ>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1.1
// TypeScript Version: 2.2
declare module "styled-theming" {
declare function theme(name: string, values: theme.ThemeMap): theme.ThemeSet;
declare namespace theme {
type ThemeValueFn = (props: object) => string;
type ThemeValue = string | ThemeValueFn;
@@ -19,15 +21,11 @@ declare module "styled-theming" {
type ThemeSet = (props: object) => string;
type VariantSet = (props: object) => string;
namespace theme {
export function variants(
name: string,
prop: string,
values: VariantMap
): VariantSet;
}
function theme(name: string, values: ThemeMap): ThemeSet;
export = theme;
function variants(
name: string,
prop: string,
values: VariantMap
): VariantSet;
}
export default theme;
+1 -1
View File
@@ -1,4 +1,4 @@
import * as theme from "styled-theming";
import theme from "styled-theming";
const textColor = theme("mode", {
dark: "white",
+4 -10
View File
@@ -1,22 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"styled-theming-tests.ts"
]
"files": ["index.d.ts", "styled-theming-tests.ts"]
}