Lead Front-End Engineer / Tech Lead
steveholgado / particle-explosions Goto Github PK
View Code? Open in Web Editor NEWCreate particle explosions on a HTML5 canvas (npm-package)
License: MIT License
Create particle explosions on a HTML5 canvas (npm-package)
License: MIT License
Hi,
I'm trying to use this package with Angular, but when I build my app I get several errors :
Here is the code to reproduce :
import {createEmitter} from 'particle-explosions';
......
public toto(index, coord): void {
const canvas: any = document.getElementById(`canvas-${index}`)
const ctx = canvas.getContext('2d');
const emitter = createEmitter(ctx);
emitter.explode(50, {
minSize: 20,
maxSize: 40,
minSpeed: 50,
maxSpeed: 100,
resistance: 0.85,
gravity: 0.98,
decay: 0.9,
sizeToRemove: 0.1,
color: '#FF0000' // Also accepts array: ['#00FF00', '#0000FF']
});
}
When I run ng build --prod
or ng build
I get these errors :
Error: node_modules/particle-explosions/dist/particle-explosions.d.ts:9:22 - error TS2528: A module cannot have multiple default exports.
9 export default class CanvasRenderer implements ICanvasRenderer {
~~~~~~~~~~~~~~
node_modules/particle-explosions/dist/particle-explosions.d.ts:25:22
25 export default class Emitter implements IEmitter {
~~~~~~~
Another export default is here.
node_modules/particle-explosions/dist/particle-explosions.d.ts:25:22 - error TS2528: A module cannot have multiple default exports.
25 export default class Emitter implements IEmitter {
~~~~~~~
node_modules/particle-explosions/dist/particle-explosions.d.ts:9:22
9 export default class CanvasRenderer implements ICanvasRenderer {
~~~~~~~~~~~~~~
The first export default is here.
node_modules/particle-explosions/dist/particle-explosions.d.ts:9:22 - error TS2528: A module cannot have multiple default exports.
9 export default class CanvasRenderer implements ICanvasRenderer {
~~~~~~~~~~~~~~
0m node_modules/particle-explosions/dist/particle-explosions.d.ts:55:22
55 export default class Particle implements IParticle {
~~~~~~~~
Another export default is here.
node_modules/particle-explosions/dist/particle-explosions.d.ts:55:22 - error TS2528: A module cannot have multiple default exports.
55 export default class Particle implements IParticle {
~~~~~~~~
node_modules/particle-explosions/dist/particle-explosions.d.ts:9:22
9 export default class CanvasRenderer implements ICanvasRenderer {
~~~~~~~~~~~~~~
The first export default is here.
node_modules/particle-explosions/dist/particle-explosions.d.ts:9:22 - error TS2528: A module cannot have multiple default exports.
9 export default class CanvasRenderer implements ICanvasRenderer {
~~~~~~~~~~~~~~
node_modules/particle-explosions/dist/particle-explosions.d.ts:70:22
70 export default class ParticleFactory implements IParticleFactory {
~~~~~~~~~~~~~~~
Another export default is here.
node_modules/particle-explosions/dist/particle-explosions.d.ts:70:22 - error TS2528: A module cannot have multiple default exports.
70 export default class ParticleFactory implements IParticleFactory {
~~~~~~~~~~~~~~~
node_modules/particle-explosions/dist/particle-explosions.d.ts:9:22
9 export default class CanvasRenderer implements ICanvasRenderer {
~~~~~~~~~~~~~~
The first export default is here.
node_modules/particle-explosions/dist/particle-explosions.d.ts:71:27 - error TS2304: Cannot find name 'Particle'.
71 create(options?: {}): Particle;
~~~~~~~~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.