mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Add types for react-relative-portal (#45182)
* generate typings for react-relative-portal * implement types and add tests
This commit is contained in:
parent
6d0efb9414
commit
5ca78f269e
23
types/react-relative-portal/index.d.ts
vendored
Normal file
23
types/react-relative-portal/index.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// Type definitions for react-relative-portal 1.8
|
||||
// Project: https://github.com/smartprogress/react-relative-portal#readme
|
||||
// Definitions by: Andy Katz <https://github.com/katz12>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
declare class RelativePortal extends React.Component<RelativePortal.Props> {}
|
||||
|
||||
declare namespace RelativePortal {
|
||||
interface Props {
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
component: string;
|
||||
fullWidth?: boolean;
|
||||
left?: number;
|
||||
onOutClick?: () => void;
|
||||
right?: number;
|
||||
top?: number;
|
||||
}
|
||||
}
|
||||
|
||||
export = RelativePortal;
|
||||
12
types/react-relative-portal/react-relative-portal-tests.tsx
Normal file
12
types/react-relative-portal/react-relative-portal-tests.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
import * as React from 'react';
|
||||
import RelativePortal = require('react-relative-portal');
|
||||
|
||||
<React.Fragment>
|
||||
<RelativePortal component="div">
|
||||
<div>portalled content</div>
|
||||
</RelativePortal>
|
||||
|
||||
<RelativePortal component="div" className="portal" fullWidth left={1} onOutClick={() => {}} right={2} top={3}>
|
||||
<div>portalled content</div>
|
||||
</RelativePortal>
|
||||
</React.Fragment>;
|
||||
24
types/react-relative-portal/tsconfig.json
Normal file
24
types/react-relative-portal/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"jsx": "react",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-relative-portal-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-relative-portal/tslint.json
Normal file
1
types/react-relative-portal/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user