Commit 8feaa32b authored by 陈帅's avatar 陈帅 Committed by niko

Support typescript (#341)

* fix some errors found during use

* fix some errors found during use

* Replace  "string | React.ReactNode" with  React.ReactNode

* replace with * as React

* remove excess property
parent ee0f8db0
import React from "react"; import * as React from "react";
export interface AvatarItemProps { export interface AvatarItemProps {
tips: React.ReactNode; tips: React.ReactNode;
src: string; src: string;
......
import React from "react"; import * as React from "react";
export interface BarProps { export interface BarProps {
title: string | React.ReactNode; title: React.ReactNode;
color?: string; color?: string;
margin?: [number, number, number, number]; margin?: [number, number, number, number];
height: number; height: number;
......
import React from "react"; import * as React from "react";
export interface ChartCardProps { export interface ChartCardProps {
title: string | React.ReactNode; title: React.ReactNode;
action?: React.ReactNode; action?: React.ReactNode;
total?: React.ReactNode | number; total?: React.ReactNode | number;
footer?: React.ReactNode; footer?: React.ReactNode;
contentHeight: number; contentHeight?: number;
avatar?: React.ReactNode; avatar?: React.ReactNode;
} }
......
import React from "react"; import * as React from "react";
export interface FieldProps { export interface FieldProps {
label: string | React.ReactNode; label: React.ReactNode;
value: string | React.ReactNode; value: React.ReactNode;
} }
export default class Field extends React.Component<FieldProps, any> {} export default class Field extends React.Component<FieldProps, any> {}
import React from "react"; import * as React from "react";
export interface GaugeProps { export interface GaugeProps {
title: string | React.ReactNode; title: React.ReactNode;
color?: string; color?: string;
height: number; height: number;
bgColor?: number; bgColor?: number;
......
import React from "react"; import * as React from "react";
// g2已经更新到3.0 // g2已经更新到3.0
// 不带的写了 // 不带的写了
......
import React from "react"; import * as React from "react";
export interface MiniBarProps { export interface MiniBarProps {
color?: string; color?: string;
height: number; height: number;
......
import React from "react"; import * as React from "react";
export interface MiniProgressProps { export interface MiniProgressProps {
target: number; target: number;
color?: string; color?: string;
strokeWidth: number; strokeWidth?: number;
percent: number; percent?: number;
} }
export default class MiniProgress extends React.Component< export default class MiniProgress extends React.Component<
......
import React from "react"; import * as React from "react";
export interface PieProps { export interface PieProps {
animate?: boolean; animate?: boolean;
color?: string; color?: string;
...@@ -11,10 +11,10 @@ export interface PieProps { ...@@ -11,10 +11,10 @@ export interface PieProps {
y: number; y: number;
}>; }>;
total?: string; total?: string;
title?: string | React.ReactNode; title?: React.ReactNode;
tooltip?: boolean; tooltip?: boolean;
valueFormat?: (value: string) => string; valueFormat?: (value: string) => string;
subTitle?: string | React.ReactNode; subTitle?: React.ReactNode;
} }
export default class Pie extends React.Component<PieProps, any> {} export default class Pie extends React.Component<PieProps, any> {}
import React from "react"; import * as React from "react";
export interface RadarProps { export interface RadarProps {
title?: string | React.ReactNode; title?: React.ReactNode;
height: number; height: number;
margin?: [number, number, number, number]; margin?: [number, number, number, number];
hasLegend?: boolean; hasLegend?: boolean;
......
import React from "react"; import * as React from "react";
export interface TagCloudProps { export interface TagCloudProps {
data: Array<{ data: Array<{
name: string; name: string;
......
import React from "react"; import * as React from "react";
export interface TimelineChartProps { export interface TimelineChartProps {
data: Array<{ data: Array<{
x: string; x: string;
......
import React from "react"; import * as React from "react";
export interface WaterWaveProps { export interface WaterWaveProps {
title: string | React.ReactNode; title: React.ReactNode;
color?: string; color?: string;
height: number; height: number;
percent: number; percent: number;
......
import React from "react"; import * as React from "react";
export interface CountDownProps { export interface CountDownProps {
format?: (time: number) => void; format?: (time: number) => void;
target: Date | number; target: Date | number;
......
import React from "react"; import * as React from "react";
export interface DescriptionListProps { export interface DescriptionListProps {
layout?: "horizontal" | "vertical"; layout?: "horizontal" | "vertical";
col?: number; col?: number;
......
import React from "react"; import * as React from "react";
export interface EllipsisProps { export interface EllipsisProps {
tooltip?: boolean; tooltip?: boolean;
length?: number; length?: number;
......
import React from "react"; import * as React from "react";
export interface ExceptionProps { export interface ExceptionProps {
type?: "403" | "404" | "500"; type?: "403" | "404" | "500";
title?: React.ReactNode; title?: React.ReactNode;
desc?: React.ReactNode; desc?: React.ReactNode;
img?: string; img?: string;
actions?: React.ReactNode; actions?: React.ReactNode;
linkElement?: string | React.ReactNode; linkElement?: React.ReactNode;
} }
export default class Exception extends React.Component<ExceptionProps, any> {} export default class Exception extends React.Component<ExceptionProps, any> {}
import React from "react"; import * as React from "react";
export interface FooterToolbarProps { export interface FooterToolbarProps {
extra: React.ReactNode; extra: React.ReactNode;
} }
......
import React from "react"; import * as React from "react";
export interface GlobalFooterProps { export interface GlobalFooterProps {
links: Array<{ links: Array<{
title: string | React.ReactNode; title: React.ReactNode;
href: string; href: string;
blankTarget?: boolean; blankTarget?: boolean;
}>; }>;
......
import React from "react"; import * as React from "react";
export interface HeaderSearchProps { export interface HeaderSearchProps {
placeholder?: string; placeholder?: string;
dataSource?: Array<string>; dataSource?: Array<string>;
......
import React from "react"; import * as React from "react";
export interface NoticeIconData { export interface NoticeIconData {
avatar: string; avatar: string;
title: React.ReactNode; title: React.ReactNode;
......
import React from "react"; import * as React from "react";
export interface NumberInfoProps { export interface NumberInfoProps {
title: React.ReactNode | string; title?: React.ReactNode | string;
subTitle: React.ReactNode | string; subTitle?: React.ReactNode | string;
total: React.ReactNode | string; total?: React.ReactNode | string;
status: "up" | "down"; status?: "up" | "down";
theme: string; theme?: string;
gap: number; gap?: number;
subTotal?: number;
} }
export default class NumberInfo extends React.Component<NumberInfoProps, any> {} export default class NumberInfo extends React.Component<NumberInfoProps, any> {}
...@@ -16,6 +16,7 @@ order: 10 ...@@ -16,6 +16,7 @@ order: 10
title | 标题 | ReactNode\|string | - title | 标题 | ReactNode\|string | -
subTitle | 子标题 | ReactNode\|string | - subTitle | 子标题 | ReactNode\|string | -
total | 总量 | ReactNode\|string | - total | 总量 | ReactNode\|string | -
subTotal | 子总量 | ReactNode\|string | -
status | 增加状态 | 'up \| down' | - status | 增加状态 | 'up \| down' | -
theme | 状态样式 | string | 'light' theme | 状态样式 | string | 'light'
gap | 设置数字和描述直接的间距(像素) | number | 8 gap | 设置数字和描述直接的间距(像素) | number | 8
import React from "react"; import * as React from "react";
export interface PageHeaderProps { export interface PageHeaderProps {
title?: React.ReactNode | string; title?: React.ReactNode | string;
logo?: React.ReactNode | string; logo?: React.ReactNode | string;
...@@ -6,11 +6,11 @@ export interface PageHeaderProps { ...@@ -6,11 +6,11 @@ export interface PageHeaderProps {
content?: React.ReactNode; content?: React.ReactNode;
extraContent?: React.ReactNode; extraContent?: React.ReactNode;
routes?: Array<any>; routes?: Array<any>;
params: any; params?: any;
breadcrumbList?: Array<{ title: React.ReactNode; href?: string }>; breadcrumbList?: Array<{ title: React.ReactNode; href?: string }>;
tabList?: Array<{ key: string; tab: React.ReactNode }>; tabList?: Array<{ key: string; tab: React.ReactNode }>;
onTabChange?: (key: string) => void; onTabChange?: (key: string) => void;
linkElement?: string | React.ReactNode; linkElement?: React.ReactNode;
} }
export default class PageHeader extends React.Component<PageHeaderProps, any> {} export default class PageHeader extends React.Component<PageHeaderProps, any> {}
import React from "react"; import * as React from "react";
export interface ResultProps { export interface ResultProps {
type: "success" | "error"; type: "success" | "error";
title: React.ReactNode; title: React.ReactNode;
......
import React from "react"; import * as React from "react";
export interface TagSelectProps { export interface TagSelectProps {
onChange?: (value: Array<string>) => void; onChange?: (value: Array<string>) => void;
expandable?: boolean; expandable?: boolean;
......
import React from "react"; import * as React from "react";
export interface TrendProps { export interface TrendProps {
colorful?: boolean; colorful?: boolean;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment