@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
65 lines (64 loc) • 2.15 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import BaseComponent from '../_base/baseComponent';
import '@douyinfe/semi-foundation/lib/cjs/spin/spin.css';
export type SpinSize = 'small' | 'large' | 'middle';
export interface SpinProps {
size?: SpinSize;
spinning?: boolean;
indicator?: React.ReactNode;
delay?: number;
tip?: React.ReactNode;
wrapperClassName?: string;
style?: React.CSSProperties;
childStyle?: React.CSSProperties;
children?: React.ReactNode;
}
interface SpinState {
delay: number;
loading: boolean;
}
declare class Spin extends BaseComponent<SpinProps, SpinState> {
static propTypes: {
size: PropTypes.Requireable<string>;
spinning: PropTypes.Requireable<boolean>;
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
indicator: PropTypes.Requireable<PropTypes.ReactNodeLike>;
delay: PropTypes.Requireable<number>;
tip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
wrapperClassName: PropTypes.Requireable<string>;
childStyle: PropTypes.Requireable<object>;
style: PropTypes.Requireable<object>;
};
static defaultProps: SpinProps;
constructor(props: SpinProps);
static getDerivedStateFromProps(props: SpinProps): {
loading: boolean;
delay?: undefined;
} | {
delay: number;
loading: boolean;
} | {
delay: number;
loading?: undefined;
};
get adapter(): {
setLoading: (value: boolean) => void;
getContext(key: string): any;
getContexts(): any;
getProp(key: string): any;
getProps(): SpinProps;
getState(key: string): any;
getStates(): SpinState;
setState<K extends keyof SpinState>(s: Pick<SpinState, K>, callback?: any): void;
getCache(c: string): any;
getCaches(): any;
setCache(key: any, value: any): void;
stopPropagation(e: any): void;
persistEvent: (event: any) => void;
};
componentWillUnmount(): void;
renderSpin(): React.JSX.Element;
render(): React.JSX.Element;
}
export default Spin;