diff --git a/types/rc-slider/index.d.ts b/types/rc-slider/index.d.ts
index 34cfc22056..cc25d67b40 100644
--- a/types/rc-slider/index.d.ts
+++ b/types/rc-slider/index.d.ts
@@ -1,17 +1,20 @@
-// Type definitions for rc-slider 6.1
+// Type definitions for rc-slider 8.1
// Project: https://github.com/react-component/slider
-// Definitions by: Marcinkus Mantas
+// Definitions by: Marcinkus Mantas , Alexander Mattoni
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
-import * as React from 'react';
+declare module "rc-slider" {
+ import * as React from "react";
-declare namespace RcSliderClass {
- interface Marks {
- [number: number]: JSX.Element | string | { style: any, label: string | JSX.Element };
+ export interface Marks {
+ [number: number]:
+ | JSX.Element
+ | string
+ | { style: any; label: string | JSX.Element };
}
- interface CommonApiProps {
+ export interface CommonApiProps {
/**
* Additional CSS class for the root DOM node
* @default ''
@@ -86,9 +89,24 @@ declare namespace RcSliderClass {
* Tooltip formatter
*/
tipFormatter?: ((value: any) => any | undefined) | null;
+
+ /**
+ * The style used for handle. (both for slider(Object) and range(Array of Object), the array will be used for mutli handle follow element order)
+ */
+ handleStyle?: Array | React.CSSProperties;
+
+ /**
+ * The style used for track. (both for slider(Object) and range(Array of Object), the array will be used for mutli track follow element order)
+ */
+ trackStyle?: Array | React.CSSProperties;
+
+ /**
+ * The style used for the track base color.
+ */
+ railStyle?: React.CSSProperties;
}
- interface SliderProps extends CommonApiProps {
+ export interface SliderProps extends CommonApiProps {
/**
* Set initial value of slider.
* @default 0
@@ -100,7 +118,7 @@ declare namespace RcSliderClass {
value?: number;
}
- interface RangeProps extends CommonApiProps {
+ export interface RangeProps extends CommonApiProps {
/**
* Set initial positions of handles.
* @default [0,0]
@@ -127,7 +145,7 @@ declare namespace RcSliderClass {
pushable?: boolean;
}
- interface HandleProps extends CommonApiProps {
+ export interface HandleProps extends CommonApiProps {
/**
* Class name
*/
@@ -142,13 +160,8 @@ declare namespace RcSliderClass {
*/
offset: number;
}
+
+ export default class Slider extends React.Component {}
+ export class Range extends React.Component {}
+ export class Handle extends React.Component {}
}
-
-declare class RcSliderClass extends React.Component { }
-
-declare namespace RcSliderClass {
- class Range extends React.Component { }
- class Handle extends React.Component { }
-}
-
-export = RcSliderClass;
diff --git a/types/rc-slider/rc-slider-tests.tsx b/types/rc-slider/rc-slider-tests.tsx
index 55c0674741..7e2e14e317 100644
--- a/types/rc-slider/rc-slider-tests.tsx
+++ b/types/rc-slider/rc-slider-tests.tsx
@@ -1,7 +1,6 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
-import * as Slider from 'rc-slider';
-import { Range, Handle } from 'rc-slider';
+import Slider, { Range, Handle } from 'rc-slider';
ReactDOM.render(
,