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