mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[react-native-actionsheet]: add type definitions (#35459)
This commit is contained in:
parent
14a6f1dddd
commit
2e1661853a
22
types/react-native-actionsheet/index.d.ts
vendored
Normal file
22
types/react-native-actionsheet/index.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Type definitions for react-native-actionsheet 2.4
|
||||
// Project: https://github.com/beefe/react-native-actionsheet
|
||||
// Definitions by: Ian <https://github.com/ian-rudge>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export interface ActionSheetProps {
|
||||
options: React.ReactNode[];
|
||||
onPress: (index: number) => void;
|
||||
title?: string;
|
||||
message?: string;
|
||||
tintColor?: string;
|
||||
cancelButtonIndex?: number;
|
||||
destructiveButtonIndex?: number;
|
||||
styles?: object;
|
||||
}
|
||||
|
||||
export default class ActionSheet extends React.Component<ActionSheetProps> {
|
||||
show: () => void;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as React from 'react';
|
||||
import ActionSheet from 'react-native-actionsheet';
|
||||
|
||||
class Example extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<ActionSheet
|
||||
options={['1', '2', '3']}
|
||||
onPress={index => {}}
|
||||
title="Test"
|
||||
message="Test"
|
||||
tintColor="white"
|
||||
cancelButtonIndex={0}
|
||||
destructiveButtonIndex={1}
|
||||
styles={{}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
25
types/react-native-actionsheet/tsconfig.json
Normal file
25
types/react-native-actionsheet/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-native-actionsheet-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-native-actionsheet/tslint.json
Normal file
1
types/react-native-actionsheet/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user