File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 7
7
"version" : " 1.9.0" ,
8
8
"description" : " A small, simple and customizable cookie consent bar for use in React applications." ,
9
9
"main" : " build/index.js" ,
10
+ "types" : " build/index.d.ts" ,
10
11
"dependencies" : {
12
+ "copy-webpack-plugin" : " ^4.6.0" ,
11
13
"js-cookie" : " ^2.2.0" ,
12
14
"react" : " ^16.4.0"
13
15
},
Original file line number Diff line number Diff line change
1
+ import * as React from 'react' ;
2
+ import Cookies from "js-cookie" ;
3
+
4
+ export interface CookieConsentProps {
5
+ location ?: "top" | "bottom" | "none" ,
6
+ style ?: object ,
7
+ buttonStyle ?: object ,
8
+ contentStyle ?: object ,
9
+ children ?: React . ReactNode ,
10
+ disableStyles ?: boolean ,
11
+ hideOnAccept ?: boolean ,
12
+ onAccept ?: Function ,
13
+ buttonText ?: Function | React . ReactNode ,
14
+ cookieName ?: string ,
15
+ cookieValue ?: string | boolean | number ,
16
+ debug ?: boolean ,
17
+ expires ?: number ,
18
+ containerClasses ?: string ,
19
+ contentClasses ?: string ,
20
+ buttonClasses ?: string ,
21
+ buttonId ?: string ,
22
+ acceptOnScroll ?: boolean ,
23
+ acceptOnScrollPercentage ?: number ,
24
+ extraCookieOptions ?: object
25
+ }
26
+
27
+ export default class CookieConsent extends React . Component < CookieConsentProps , { } > { }
28
+
29
+ export { Cookies } ;
Original file line number Diff line number Diff line change 1
1
var path = require ( 'path' ) ;
2
+ var CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
3
+
2
4
module . exports = {
3
5
entry : './src/index.js' ,
4
6
output : {
@@ -23,5 +25,8 @@ module.exports = {
23
25
} ,
24
26
externals : {
25
27
'react' : 'commonjs react' // this line is just to use the React dependency of our parent-testing-project instead of using our own React.
26
- }
27
- } ;
28
+ } ,
29
+ plugins : [
30
+ new CopyWebpackPlugin ( [ { from : 'src/index.d.ts' , to : 'index.d.ts' } ] )
31
+ ]
32
+ } ;
You can’t perform that action at this time.
0 commit comments