File tree 6 files changed +208
-283
lines changed
6 files changed +208
-283
lines changed Original file line number Diff line number Diff line change 1
1
2
+ ## 2.2.1
3
+
4
+ * tons of internal refactors
5
+ * adding typings file
6
+ * added new method, ` destroy ` which removes the canvas and timers.
7
+
2
8
## 2.2.0
3
9
4
10
* adding a kill method that forcibly kills the fireworks
Original file line number Diff line number Diff line change @@ -39,6 +39,20 @@ fireworks.kill() // forcibly stop fireworks
39
39
fireworks .fire () // fire a single rocket.
40
40
```
41
41
42
+ ## usage with typscript
43
+
44
+ ``` ts
45
+ import * as FireworksCanvas from ' fireworks-canvas'
46
+ const fireworks = new FireworksCanvas (container )
47
+ ```
48
+
49
+ OR
50
+
51
+ ``` ts
52
+ import FireworksCanvas = require (' fireworks-canvas' )
53
+ const fireworks = new FireworksCanvas (container )
54
+ ```
55
+
42
56
## support
43
57
44
58
Requires es6 in the browser
@@ -47,7 +61,8 @@ Requires es6 in the browser
47
61
48
62
``` sh
49
63
npm i
50
- npm run build
51
- # open ./index.html in your favourite evergreen browser
64
+ npm run build:dev
65
+ # edit ./gh-pages/index.html, change reference to '../dist/fireworks.js`
66
+ # open ./gh-pages/index.html in your favourite evergreen browser
52
67
```
53
68
Original file line number Diff line number Diff line change
1
+
2
+ export as namespace Fireworks ;
3
+
4
+ declare class Fireworks2 {
5
+ constructor ( container : HTMLElement , options ?: Fireworks . FireworksOptions ) ;
6
+ destroy ( ) : void ;
7
+ start ( ) : ( ) => void ;
8
+ stop ( ) : void ;
9
+ kill ( ) : void ;
10
+ fire ( ) : void ;
11
+ update ( ) : void ;
12
+ }
13
+
14
+ declare namespace Fireworks {
15
+ export type FireworksOptions = {
16
+ maxRockets ?: number
17
+ numParticles ?: number
18
+ explosionMinHeight ?: number
19
+ explosionMaxHeight ?: number
20
+ explosionChance ?: number
21
+ rocketSpawnInterval ?: number
22
+ }
23
+ }
24
+
25
+ export default Fireworks
You can’t perform that action at this time.
0 commit comments