mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #30166 from imjakechapman/react-native-flip-card
Added type definitions for 'react-native-flip-card'
This commit is contained in:
+46
@@ -0,0 +1,46 @@
|
||||
// Type definitions for react-native-flip-card 3.5
|
||||
// Project: https://github.com/moschan/react-native-flip-card
|
||||
// Definitions by: Jake Chapman <https://github.com/imjakechapman>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Component, ReactNode, ComponentClass } from "react";
|
||||
import {
|
||||
ViewProps,
|
||||
TextProps,
|
||||
StyleProp,
|
||||
TextInputProps,
|
||||
ViewStyle
|
||||
} from "react-native";
|
||||
|
||||
// FlipCard
|
||||
export interface FlipCardProps {
|
||||
style?: StyleProp<ViewStyle>;
|
||||
flip?: boolean;
|
||||
friction?: number;
|
||||
perspective?: number;
|
||||
flipHorizontal?: boolean;
|
||||
flipVertical?: boolean;
|
||||
clickable?: boolean;
|
||||
onFlipEnd?: () => void;
|
||||
onFlipStart?: () => void;
|
||||
alignHeight?: boolean;
|
||||
alignWidth?: boolean;
|
||||
useNativeDriver?: boolean;
|
||||
}
|
||||
// Face
|
||||
export interface FaceProps {
|
||||
chilren: JSX.Element[];
|
||||
}
|
||||
|
||||
// Back
|
||||
export interface BackProps {
|
||||
flipHorizontal: boolean;
|
||||
flipVertical: boolean;
|
||||
perspective: number;
|
||||
chilren: JSX.Element[];
|
||||
}
|
||||
|
||||
export const Face: ComponentClass<FaceProps>;
|
||||
export const Back: ComponentClass<BackProps>;
|
||||
export default class FlipCard extends Component<FlipCardProps> {}
|
||||
@@ -0,0 +1,33 @@
|
||||
import * as React from "react";
|
||||
import { View, Text, StyleSheet } from "react-native";
|
||||
|
||||
// Component
|
||||
import FlipCard from "react-native-flip-card";
|
||||
|
||||
export default class FlipCardTest extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<FlipCard
|
||||
style={{ backgroundColor: "#fff" }}
|
||||
flip={false}
|
||||
friction={10}
|
||||
perspective={10}
|
||||
flipHorizontal={true}
|
||||
flipVertical={false}
|
||||
clickable={true}
|
||||
onFlipStart={() => {}}
|
||||
onFlipEnd={() => {}}
|
||||
alignHeight={false}
|
||||
alignWidth={false}
|
||||
useNativeDriver={true}
|
||||
>
|
||||
<View>
|
||||
<Text>Front</Text>
|
||||
</View>
|
||||
<View>
|
||||
<Text>Back</Text>
|
||||
</View>
|
||||
</FlipCard>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"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-flip-card-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user