mirror of
https://github.com/kevinsqi/react-circular-progressbar.git
synced 2026-01-18 15:55:06 +00:00
extract types into types.ts file
This commit is contained in:
parent
cdb2f8a3a0
commit
af3955cb12
@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
VIEWBOX_WIDTH,
|
||||
VIEWBOX_HEIGHT,
|
||||
@ -7,39 +8,11 @@ import {
|
||||
VIEWBOX_CENTER_Y,
|
||||
} from './constants';
|
||||
import Path from './Path';
|
||||
|
||||
type CircularProgressbarDefaultProps = {
|
||||
strokeWidth: number;
|
||||
className: string;
|
||||
text: string;
|
||||
background: boolean;
|
||||
backgroundPadding: number;
|
||||
initialAnimation: boolean;
|
||||
counterClockwise: boolean;
|
||||
circleRatio: number;
|
||||
classes: {
|
||||
root: string;
|
||||
trail: string;
|
||||
path: string;
|
||||
text: string;
|
||||
background: string;
|
||||
};
|
||||
styles: {
|
||||
root?: object;
|
||||
trail?: object;
|
||||
path?: object;
|
||||
text?: object;
|
||||
background?: object;
|
||||
};
|
||||
};
|
||||
|
||||
type CircularProgressbarProps = CircularProgressbarDefaultProps & {
|
||||
percentage: number;
|
||||
};
|
||||
|
||||
type CircularProgressbarState = {
|
||||
percentage: number;
|
||||
};
|
||||
import {
|
||||
CircularProgressbarDefaultProps,
|
||||
CircularProgressbarProps,
|
||||
CircularProgressbarState,
|
||||
} from './types';
|
||||
|
||||
class CircularProgressbar extends React.Component<
|
||||
CircularProgressbarProps,
|
||||
|
||||
32
src/types.ts
Normal file
32
src/types.ts
Normal file
@ -0,0 +1,32 @@
|
||||
export type CircularProgressbarDefaultProps = {
|
||||
strokeWidth: number;
|
||||
className: string;
|
||||
text: string;
|
||||
background: boolean;
|
||||
backgroundPadding: number;
|
||||
initialAnimation: boolean;
|
||||
counterClockwise: boolean;
|
||||
circleRatio: number;
|
||||
classes: {
|
||||
root: string;
|
||||
trail: string;
|
||||
path: string;
|
||||
text: string;
|
||||
background: string;
|
||||
};
|
||||
styles: {
|
||||
root?: object;
|
||||
trail?: object;
|
||||
path?: object;
|
||||
text?: object;
|
||||
background?: object;
|
||||
};
|
||||
};
|
||||
|
||||
export type CircularProgressbarProps = CircularProgressbarDefaultProps & {
|
||||
percentage: number;
|
||||
};
|
||||
|
||||
export type CircularProgressbarState = {
|
||||
percentage: number;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user