createSliderWithTooltip.d.ts
5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import React from 'react';
import { GenericSliderProps } from './interface';
export interface ComponentWrapperProps {
tipFormatter?: (value: number) => React.ReactNode;
tipProps?: {
prefixCls?: string;
overlay?: string;
placement?: string;
visible?: boolean;
};
getTooltipContainer?: () => HTMLElement;
}
interface ComponentWrapperState {
visibles: Record<number, boolean>;
}
export default function createSliderWithTooltip<Props extends GenericSliderProps>(Component: React.ComponentClass<Props>): {
new (props: (ComponentWrapperProps & Props) | Readonly<ComponentWrapperProps & Props>): {
state: {
visibles: {};
};
handleTooltipVisibleChange: (index: any, visible: any) => void;
handleWithTooltip: ({ value, dragging, index, disabled, ...restProps }: {
[x: string]: any;
value: any;
dragging: any;
index: any;
disabled: any;
}) => JSX.Element;
render(): JSX.Element;
context: any;
setState<K extends "visibles">(state: ComponentWrapperState | ((prevState: Readonly<ComponentWrapperState>, props: Readonly<ComponentWrapperProps & Props>) => ComponentWrapperState | Pick<ComponentWrapperState, K>) | Pick<ComponentWrapperState, K>, callback?: () => void): void;
forceUpdate(callback?: () => void): void;
readonly props: Readonly<ComponentWrapperProps & Props> & Readonly<{
children?: React.ReactNode;
}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<ComponentWrapperProps & Props>, nextState: Readonly<ComponentWrapperState>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<ComponentWrapperProps & Props>, prevState: Readonly<ComponentWrapperState>): any;
componentDidUpdate?(prevProps: Readonly<ComponentWrapperProps & Props>, prevState: Readonly<ComponentWrapperState>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<ComponentWrapperProps & Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ComponentWrapperProps & Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<ComponentWrapperProps & Props>, nextState: Readonly<ComponentWrapperState>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentWrapperProps & Props>, nextState: Readonly<ComponentWrapperState>, nextContext: any): void;
};
new (props: ComponentWrapperProps & Props, context: any): {
state: {
visibles: {};
};
handleTooltipVisibleChange: (index: any, visible: any) => void;
handleWithTooltip: ({ value, dragging, index, disabled, ...restProps }: {
[x: string]: any;
value: any;
dragging: any;
index: any;
disabled: any;
}) => JSX.Element;
render(): JSX.Element;
context: any;
setState<K extends "visibles">(state: ComponentWrapperState | ((prevState: Readonly<ComponentWrapperState>, props: Readonly<ComponentWrapperProps & Props>) => ComponentWrapperState | Pick<ComponentWrapperState, K>) | Pick<ComponentWrapperState, K>, callback?: () => void): void;
forceUpdate(callback?: () => void): void;
readonly props: Readonly<ComponentWrapperProps & Props> & Readonly<{
children?: React.ReactNode;
}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<ComponentWrapperProps & Props>, nextState: Readonly<ComponentWrapperState>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<ComponentWrapperProps & Props>, prevState: Readonly<ComponentWrapperState>): any;
componentDidUpdate?(prevProps: Readonly<ComponentWrapperProps & Props>, prevState: Readonly<ComponentWrapperState>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<ComponentWrapperProps & Props>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ComponentWrapperProps & Props>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<ComponentWrapperProps & Props>, nextState: Readonly<ComponentWrapperState>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentWrapperProps & Props>, nextState: Readonly<ComponentWrapperState>, nextContext: any): void;
};
defaultProps: {
tipFormatter(value: number): number;
handleStyle: {}[];
tipProps: {};
getTooltipContainer: (node: any) => any;
};
contextType?: React.Context<any>;
};
export {};