File tree Expand file tree Collapse file tree 3 files changed +44
-2
lines changed Expand file tree Collapse file tree 3 files changed +44
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-animated-slider" ,
3
- "version" : " 2.0 .0" ,
3
+ "version" : " 2.1 .0" ,
4
4
"description" : " Animated slider component for react" ,
5
5
"main" : " build/index.js" ,
6
+ "typings" : " build/index.d.ts" ,
6
7
"files" : [
7
8
" build"
8
9
],
58
59
"babel-jest" : " ^24.9.0" ,
59
60
"babel-loader" : " ^8.0.6" ,
60
61
"clean-webpack-plugin" : " ^3.0.0" ,
62
+ "copy-webpack-plugin" : " ^5.1.0" ,
61
63
"css-hot-loader" : " ^1.4.4" ,
62
64
"css-loader" : " ^3.2.0" ,
63
65
"eslint" : " ^6.7.1" ,
77
79
"react" : " ^16.4.0" ,
78
80
"react-dom" : " ^16.4.0" ,
79
81
"react-test-renderer" : " ^16.4.0" ,
82
+ "typescript" : " 3.7.3" ,
80
83
"webpack" : " ^4.41.2" ,
81
84
"webpack-cli" : " ^3.3.10" ,
82
85
"webpack-dev-server" : " ^3.9.0"
Original file line number Diff line number Diff line change
1
+ interface ISliderProps {
2
+ children : React . ReactElement [ ] ;
3
+ slideIndex ?: number ;
4
+ duration ?: number ;
5
+ disabled ?: boolean ;
6
+ infinite ?: boolean ;
7
+ autoplay ?: number ;
8
+ touchDisabled ?: boolean ;
9
+ minSwipeOffset ?: number ;
10
+ previousButton ?: React . ReactElement ;
11
+ nextButton ?: React . ReactElement ;
12
+ classNames ?: IClassNames ;
13
+ }
14
+
15
+ interface IClassNames {
16
+ slider ?: string ;
17
+ previousButton ?: string ;
18
+ nextButton ?: string ;
19
+ buttonDisabled ?: string ;
20
+ track ?: string ;
21
+ slide ?: string ;
22
+ hidden ?: string ;
23
+ previous ?: string ;
24
+ next ?: string ;
25
+ animateIn ?: string ;
26
+ animateOut ?: string ;
27
+ }
28
+
29
+ declare module "react-animated-slider" {
30
+ import React from "react" ;
31
+
32
+ class Slider extends React . Component <
33
+ ISliderProps & JSX . IntrinsicElements [ "div" ]
34
+ > { }
35
+
36
+ export = Slider ;
37
+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const path = require('path');
2
2
const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
3
3
const { CleanWebpackPlugin } = require ( 'clean-webpack-plugin' ) ;
4
4
const IgnoreEmitPlugin = require ( 'ignore-emit-webpack-plugin' ) ;
5
+ const CopyPlugin = require ( 'copy-webpack-plugin' ) ;
5
6
6
7
const sliderConfig = {
7
8
entry : {
@@ -47,7 +48,8 @@ const sliderConfig = {
47
48
new MiniCssExtractPlugin ( {
48
49
filename : '[name].css' ,
49
50
chunkFilename : '[name].css' ,
50
- } ) ,
51
+ } ) ,
52
+ new CopyPlugin ( [ { from : './src/index.d.ts' , to : './index.d.ts' } ] )
51
53
] ,
52
54
} ;
53
55
You can’t perform that action at this time.
0 commit comments