Skip to content

Commit 3888367

Browse files
committed
Release 2.2.1
1 parent d88f220 commit 3888367

6 files changed

+208
-283
lines changed

CHANGES.MD

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11

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+
28
## 2.2.0
39

410
* adding a kill method that forcibly kills the fireworks

README.MD

+17-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ fireworks.kill() // forcibly stop fireworks
3939
fireworks.fire() // fire a single rocket.
4040
```
4141

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+
4256
## support
4357

4458
Requires es6 in the browser
@@ -47,7 +61,8 @@ Requires es6 in the browser
4761

4862
```sh
4963
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
5267
```
5368

fireworks.d.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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

0 commit comments

Comments
 (0)