UNPKG

2.17 kBTypeScriptView Raw
1import * as React from 'react';
2import { ConfigConsumerProps } from '../config-provider';
3declare const ProgressTypes: ["line", "circle", "dashboard"];
4export declare type ProgressType = typeof ProgressTypes[number];
5declare const ProgressStatuses: ["normal", "exception", "active", "success"];
6export declare type ProgressSize = 'default' | 'small';
7export declare type StringGradients = {
8 [percentage: string]: string;
9};
10declare type FromToGradients = {
11 from: string;
12 to: string;
13};
14export declare type ProgressGradient = {
15 direction?: string;
16} & (StringGradients | FromToGradients);
17export interface SuccessProps {
18 percent?: number;
19 /** @deprecated Use `percent` instead */
20 progress?: number;
21 strokeColor?: string;
22}
23export interface ProgressProps {
24 prefixCls?: string;
25 className?: string;
26 type?: ProgressType;
27 percent?: number;
28 format?: (percent?: number, successPercent?: number) => React.ReactNode;
29 status?: typeof ProgressStatuses[number];
30 showInfo?: boolean;
31 strokeWidth?: number;
32 strokeLinecap?: 'butt' | 'square' | 'round';
33 strokeColor?: string | ProgressGradient;
34 trailColor?: string;
35 width?: number;
36 success?: SuccessProps;
37 style?: React.CSSProperties;
38 gapDegree?: number;
39 gapPosition?: 'top' | 'bottom' | 'left' | 'right';
40 size?: ProgressSize;
41 steps?: number;
42 /** @deprecated Use `success` instead */
43 successPercent?: number;
44}
45export default class Progress extends React.Component<ProgressProps> {
46 static defaultProps: {
47 type: "circle" | "line" | "dashboard" | undefined;
48 percent: number;
49 showInfo: boolean;
50 trailColor: null;
51 size: ProgressSize | undefined;
52 gapDegree: undefined;
53 strokeLinecap: "round" | "butt" | "square" | undefined;
54 };
55 getPercentNumber(): number;
56 getProgressStatus(): "success" | "normal" | "active" | "exception";
57 renderProcessInfo(prefixCls: string, progressStatus: typeof ProgressStatuses[number]): JSX.Element | null;
58 renderProgress: ({ getPrefixCls, direction }: ConfigConsumerProps) => JSX.Element;
59 render(): JSX.Element;
60}
61export {};