mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add type definitions for rn-swipeable-panel (#45519)
This commit is contained in:
parent
33dc44bb1d
commit
9d19cf11e9
87
types/rn-swipeable-panel/index.d.ts
vendored
Normal file
87
types/rn-swipeable-panel/index.d.ts
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
// Type definitions for rn-swipeable-panel 1.1
|
||||
// Project: https://github.com/enesozturk/rn-swipeable-panel
|
||||
// Definitions by: Enes Öztürk <https://github.com/enesozturk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/types/rn-swipeable-panel
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export interface SwipeablePanelProps extends React.Props<SwipeablePanel> {
|
||||
/**
|
||||
* Required prop for panels actual state. Set true if you want to open panel
|
||||
*/
|
||||
isActive: boolean;
|
||||
|
||||
/**
|
||||
* Set true if you want to show close button
|
||||
*/
|
||||
showCloseButton?: boolean;
|
||||
|
||||
/**
|
||||
* Set true if you want to make full with panel
|
||||
*/
|
||||
fullWidth?: boolean;
|
||||
|
||||
/**
|
||||
* Set true if you want to disable black background opacity
|
||||
*/
|
||||
noBackgroundOpacity?: boolean;
|
||||
|
||||
/**
|
||||
* Use this prop to override panel style
|
||||
*/
|
||||
style?: object;
|
||||
|
||||
/**
|
||||
* Use this prop to override close button background style
|
||||
*/
|
||||
closeRootStyle?: object;
|
||||
|
||||
/**
|
||||
* Use this prop to override close button icon style
|
||||
*/
|
||||
closeIconStyle?: object;
|
||||
|
||||
/**
|
||||
* Set true if you want to close panel by touching outside
|
||||
*/
|
||||
closeOnTouchOutside?: boolean;
|
||||
|
||||
/**
|
||||
* Set true if you want to let panel open just large mode
|
||||
*/
|
||||
onlyLarge?: boolean;
|
||||
|
||||
/**
|
||||
* Set true if you want to let panel open just small mode
|
||||
*/
|
||||
onlySmall?: boolean;
|
||||
|
||||
/**
|
||||
* Set true if you want to open panel large by default
|
||||
*/
|
||||
openLarge?: boolean;
|
||||
|
||||
/**
|
||||
* Set true if you want to remove gray bar
|
||||
*/
|
||||
noBar?: boolean;
|
||||
|
||||
/**
|
||||
* Use this prop to override bar style
|
||||
*/
|
||||
barStyle?: object;
|
||||
|
||||
/**
|
||||
* Set true if you want to make toucable outside of panel
|
||||
*/
|
||||
allowTouchOutside?: boolean;
|
||||
|
||||
// Event Handlers
|
||||
|
||||
/**
|
||||
* Required prop to keep panel's state sync with your parent components'state. Will be fired when panel is closed. See the example project.
|
||||
*/
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export default class SwipeablePanel extends React.Component<SwipeablePanelProps, any> {}
|
||||
10
types/rn-swipeable-panel/rn-swipeable-panel-tests.tsx
Normal file
10
types/rn-swipeable-panel/rn-swipeable-panel-tests.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import SwipeablePanel from 'rn-swipeable-panel';
|
||||
|
||||
export const App: React.FC = () => {
|
||||
const [isActive, setIsActive] = React.useState<boolean>(false);
|
||||
|
||||
const onClosePanel = () => setIsActive(false);
|
||||
|
||||
return <SwipeablePanel isActive={isActive} onClose={onClosePanel}></SwipeablePanel>;
|
||||
};
|
||||
22
types/rn-swipeable-panel/tsconfig.json
Normal file
22
types/rn-swipeable-panel/tsconfig.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react",
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": ["index.d.ts", "rn-swipeable-panel-tests.tsx"]
|
||||
}
|
||||
|
||||
3
types/rn-swipeable-panel/tslint.json
Normal file
3
types/rn-swipeable-panel/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user