Added react-native-canvas

This commit is contained in:
Haseeb Majid
2019-03-15 22:20:39 +00:00
parent e51e5044b8
commit 2255d9c32d
4 changed files with 56 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for react-native-canvas 0.1
// Project: https://github.com/iddan/react-native-canvas#readme
// Definitions by: hmajid2301 <https://github.com/hmajid2301>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from "react";
import { StyleProp, ViewStyle } from "react-native";
export interface CanvasProps {
style: StyleProp<ViewStyle>;
baseUrl: string;
originWhitelist: string[];
}
export default class Canvas extends React.Component<CanvasProps> {}
export class Image extends React.Component {}
export class ImageData extends React.Component {}
export class Path2D extends React.Component {}
@@ -0,0 +1,19 @@
import * as React from "react";
import { View } from "react-native";
import Canvas, {
Image as CanvasImage,
Path2D,
ImageData
} from "react-native-canvas";
class CanvasTest extends React.Component {
render() {
return (
<View>
<Canvas ref={this.handleCanvas} />
</View>
);
}
handleCanvas = (canvas: Canvas) => {};
}
+17
View File
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react-native"
},
"files": ["index.d.ts", "react-native-canvas-tests.tsx"]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }