mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add typing for react-compass (#45599)
* Added Types for react-compass * Added directionNames prop Co-authored-by: Rick Wilson <me@richardawilson.com>
This commit is contained in:
parent
159c123fef
commit
bb09479b88
17
types/react-compass/index.d.ts
vendored
Normal file
17
types/react-compass/index.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Type definitions for react-compass 0.1
|
||||
// Project: https://github.com/virtyaluk/react-compass
|
||||
// Definitions by: Rick Wilson <https://github.com/rwilson504>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
export interface ReactCompassProps {
|
||||
direction: number;
|
||||
directionNames?: string[];
|
||||
}
|
||||
|
||||
export function directionName(dir: number): string;
|
||||
export function normalizeAngle(direction: number): number;
|
||||
|
||||
export class ReactCompass extends React.Component<ReactCompassProps, any> {}
|
||||
export default ReactCompass;
|
||||
10
types/react-compass/react-compass-tests.tsx
Normal file
10
types/react-compass/react-compass-tests.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import * as React from "react";
|
||||
import ReactCompass from 'react-compass';
|
||||
|
||||
interface CompassProps {
|
||||
direction: number;
|
||||
}
|
||||
|
||||
const CompassComp: React.FC<CompassProps> = (props) => {
|
||||
return (<ReactCompass direction={0} />);
|
||||
};
|
||||
25
types/react-compass/tsconfig.json
Normal file
25
types/react-compass/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"jsx": "react",
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-compass-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-compass/tslint.json
Normal file
1
types/react-compass/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user