Add ts types for xml.js

This commit is contained in:
Николай Вовк
2019-09-07 14:27:09 +03:00
committed by Mikael Sand
parent 4100730d2b
commit 766018a9e8
2 changed files with 27 additions and 2 deletions
+3
View File
@@ -45,3 +45,6 @@ cn-doc.md
# experimental code
#
experimental/
# VS Code
.vscode/
Vendored
+24 -2
View File
@@ -101,7 +101,7 @@ export interface ClipProps {
clipRule?: FillRule,
clipPath?: string
}
interface VectorEffectProps {
vectorEffect?: "none" | "non-scaling-stroke" | "nonScalingStroke" | "default" | "inherit" | "uri";
}
@@ -184,7 +184,7 @@ export interface CommonMaskProps {
mask?: string;
}
export interface CommonPathProps extends FillProps, StrokeProps, ClipProps, TransformProps, VectorEffectProps, ResponderProps, TouchableProps, DefinitionProps, CommonMaskProps {}
export interface CommonPathProps extends FillProps, StrokeProps, ClipProps, TransformProps, VectorEffectProps, ResponderProps, TouchableProps, DefinitionProps, CommonMaskProps { }
// Element props
export interface CircleProps extends CommonPathProps {
@@ -397,3 +397,25 @@ export interface MaskProps extends CommonPathProps {
maskContentUnits?: TMaskUnits,
}
export const Mask: React.ComponentClass<MaskProps>;
interface XMLElement {
tag: string,
children: XMLElement[] | void
props: any,
Tag: any // TODO: add tags?
}
export function parse(xml: string): XMLElement | null
interface AstProps {
ast: XMLElement, override: any, children?: any
}
export const SvgAst: React.FunctionComponent<AstProps>
interface SvgXmlProps { override?: any, xml: string }
export const SvgXml: React.FunctionComponent<SvgXmlProps>
export const SvgFromXml: React.ComponentClass<SvgXmlProps>
interface SvgUriProps { uri: string }
export const SvgUri: React.FunctionComponent<SvgUriProps>
export const SvgFromUri: React.ComponentClass<SvgUriProps>