Skip to content

Commit

Permalink
fix: update flow types
Browse files Browse the repository at this point in the history
  • Loading branch information
msand committed Oct 23, 2019
1 parent 8c1a173 commit a50a856
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions src/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,32 @@ export type MaskProps = {
...
} & CommonPathProps;
declare export var Mask: React.ComponentClass<MaskProps>;
export type Styles = {
[property: string]: string,
...
};
export interface AST {
tag: string;
style?: Styles;
styles?: string;
priority?: Map<string, boolean | void>;
parent: AST | null;
children: (AST | string)[] | (React$Node | string)[];
props: { ... };
props: {
[prop: string]: Styles | string | void,
...
};
Tag: React.ComponentType<>;
}
export type XmlAST = {
children: (XmlAST | string)[],
parent: XmlAST | null,
...
} & AST;
export type JsxAST = {
children: (React$Node | string)[],
...
} & AST;
export type UriProps = {
uri: string | null,
override?: SvgProps,
Expand All @@ -425,17 +445,26 @@ export type XmlProps = {
...
} & SvgProps;
export type XmlState = {
ast: AST | null,
ast: JsxAST | null,
...
};
export type AstProps = {
ast: AST | null,
ast: JsxAST | null,
override?: SvgProps,
...
} & SvgProps;
declare export function parse(xml: string): AST | null;
export type Middleware = (ast: XmlAST) => XmlAST;
declare export function parse(
source: string,
middleware?: Middleware
): JsxAST | null;
declare export var SvgAst: React.FunctionComponent<AstProps>;
declare export var SvgXml: React.FunctionComponent<XmlProps>;
declare export var SvgFromXml: React.ComponentClass<XmlProps, XmlState>;
declare export var SvgUri: React.FunctionComponent<UriProps>;
declare export var SvgFromUri: React.ComponentClass<UriProps, UriState>;
declare export var SvgCss: React.FunctionComponent<XmlProps>;
declare export var SvgWithCss: React.ComponentClass<XmlProps, XmlState>;
declare export var SvgCssUri: React.FunctionComponent<UriProps>;
declare export var SvgWithCssUri: React.ComponentClass<UriProps, UriState>;
declare export var inlineStyles: Middleware;

0 comments on commit a50a856

Please sign in to comment.