[@types/styled-system__theme-get] Add @styled-system/theme-get type (#40275)

* Add @styled-system/theme-get type

* Remove devDependency

* Add semicolon

* Remove package.json
This commit is contained in:
JerryHong
2019-11-15 16:29:41 -08:00
committed by Pranav Senthilnathan
parent dbb2bb1731
commit 3a9e538b43
4 changed files with 43 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
// Type definitions for @styled-system/theme-get 5.0
// Project: https://github.com/styled-system/styled-system
// Definitions by: JerryHong <https://github.com/Jerry-Hong>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function themeGet(path: string | Array<string | number>, fallback?: any): (props: any) => any;
@@ -0,0 +1,17 @@
import { themeGet } from '@styled-system/theme-get';
const theme = {
colors: {
primary: 'tomato',
secondary: 'cyan',
},
};
// return a funtion
themeGet('');
// return a any
themeGet('')({});
// return a any
themeGet('colors.primary')({ theme });
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": ["../"],
"paths": {
"@styled-system/theme-get": ["styled-system__theme-get"]
},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "styled-system__theme-get-tests.ts"]
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }