mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
[@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:
committed by
Pranav Senthilnathan
parent
dbb2bb1731
commit
3a9e538b43
+6
@@ -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" }
|
||||
Reference in New Issue
Block a user