From 7818cb4a2dfa8a3fc355e02d78daeb0e143d0700 Mon Sep 17 00:00:00 2001 From: Sascha Zarhuber Date: Thu, 4 Apr 2019 20:02:24 +0200 Subject: [PATCH] feat(react-sketchapp): added types for Svg --- types/react-sketchapp/index.d.ts | 48 +- .../lib/components/Svg/Circle.d.ts | 11 + .../lib/components/Svg/ClipPath.d.ts | 8 + .../lib/components/Svg/Defs.d.ts | 7 + .../lib/components/Svg/Ellipse.d.ts | 12 + .../react-sketchapp/lib/components/Svg/G.d.ts | 7 + .../lib/components/Svg/Image.d.ts | 15 + .../lib/components/Svg/Line.d.ts | 0 .../lib/components/Svg/LinearGradient.d.ts | 0 .../lib/components/Svg/Mask.d.ts | 0 .../lib/components/Svg/Path.d.ts | 0 .../lib/components/Svg/Pattern.d.ts | 0 .../lib/components/Svg/Polygon.d.ts | 0 .../lib/components/Svg/Polyline.d.ts | 0 .../lib/components/Svg/RadialGradient.d.ts | 0 .../lib/components/Svg/Rect.d.ts | 0 .../lib/components/Svg/Svg.d.ts | 0 .../lib/components/Svg/Symbol.d.ts | 0 .../lib/components/Svg/TSpan.d.ts | 0 .../lib/components/Svg/Text.d.ts | 0 .../lib/components/Svg/TextPath.d.ts | 0 .../lib/components/Svg/Use.d.ts | 0 .../lib/components/Svg/props.d.ts | 494 ++++++++++++++++++ 23 files changed, 596 insertions(+), 6 deletions(-) create mode 100644 types/react-sketchapp/lib/components/Svg/Circle.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/ClipPath.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Defs.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Ellipse.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/G.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Image.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Line.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/LinearGradient.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Mask.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Path.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Pattern.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Polygon.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Polyline.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/RadialGradient.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Rect.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Svg.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Symbol.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/TSpan.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Text.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/TextPath.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/Use.d.ts create mode 100644 types/react-sketchapp/lib/components/Svg/props.d.ts diff --git a/types/react-sketchapp/index.d.ts b/types/react-sketchapp/index.d.ts index 096a6c6da3..ae5fa357c2 100644 --- a/types/react-sketchapp/index.d.ts +++ b/types/react-sketchapp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-sketchapp 0.13 +// Type definitions for react-sketchapp 0.14 // Project: https://github.com/airbnb/react-sketchapp // Definitions by: Rico Kahler // DomiR @@ -8,6 +8,8 @@ import * as React from 'react'; +import { CircleProps } from './lib/components/Svg/Circle'; + declare global { const context: SketchContext; } @@ -243,7 +245,7 @@ export class Text extends React.Component {} // View export interface ViewProps { name?: string; - children?: any; + children?: React.ReactChild[]; style?: Style | StyleReference; } /** View primitives */ @@ -256,7 +258,7 @@ export const StyleSheet: { * Create an optimized `StyleSheet` reference from a style object. */ create: ( - t: T + t: T, ) => { [P in keyof T]: StyleReference }; /** * Flatten an array of style objects into one aggregated object, or look up the definition for a @@ -267,7 +269,7 @@ export const StyleSheet: { | Array