mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Add types for @styled-system/should-forward-prop (#39129)
This commit is contained in:
committed by
Andrew Branch
parent
2704228c72
commit
5c96fac575
@@ -0,0 +1,10 @@
|
||||
// Type definitions for @styled-system/should-forward-prop 5.1
|
||||
// Project: https://github.com/styled-system/styled-system/tree/master/packages/should-forward-prop
|
||||
// Definitions by: Tom Picton <https://github.com/tpict>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type genericShouldForwardProp = (prop: string) => boolean;
|
||||
|
||||
export function createShouldForwardProp(props: string[]): genericShouldForwardProp;
|
||||
declare const shouldForwardProp: genericShouldForwardProp;
|
||||
export default shouldForwardProp;
|
||||
@@ -0,0 +1,10 @@
|
||||
import shouldForwardProp, {
|
||||
createShouldForwardProp
|
||||
} from "@styled-system/should-forward-prop";
|
||||
|
||||
shouldForwardProp("onClick"); // True
|
||||
shouldForwardProp("variant"); // False
|
||||
|
||||
const customShouldForwardProp = createShouldForwardProp(["magic"]);
|
||||
customShouldForwardProp("magic"); // True
|
||||
customShouldForwardProp("you know"); // False
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"@styled-system/should-forward-prop": [
|
||||
"styled-system__should-forward-prop"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"styled-system__should-forward-prop-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user