Skip to content

Commit

Permalink
fix linter issues, update types
Browse files Browse the repository at this point in the history
  • Loading branch information
aeroheim committed May 19, 2020
1 parent 6695a33 commit a74f38a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/midori.d.ts
Expand Up @@ -363,6 +363,7 @@ export interface ParticleGroupConfig {
minOpacity?: number;
maxOpacity?: number;
color?: number;
smoothing?: number;
}
export declare class Particles {
private _width;
Expand Down Expand Up @@ -433,9 +434,10 @@ export declare class Particles {
sway(name: string, offset: ParticleSwayOffset | boolean, transition?: LoopableTransitionConfig): void;
/**
* Generates a new random averaged value based off a given value and its range.
* @param {number} value - the value to use.
* @param {number} prevValue - the previous value.
* @param {number} minValue - the minimum value for the given value.
* @param {number} maxValue - the maximum value for the given value.
* @param {number} smoothing - optional amount of smoothing to use as a value between 0 and 1. Defaults to 0.5.
* @returns number
*/
private _generateNewRandomAveragedValue;
Expand Down
4 changes: 2 additions & 2 deletions src/effects/particles.ts
Expand Up @@ -39,7 +39,7 @@ export interface ParticleGroupConfig {
// optional color of the particles. Defaults to 0xffffff.
color?: number;
// the amount of smoothing for animated values (i.e size, gradient, opacity), specified as a value between 0 and 1. Defaults to 0.5.
smoothing?: number
smoothing?: number;
}

type ParticleGroupMap = {[name: string]: ParticleGroup};
Expand Down Expand Up @@ -363,7 +363,7 @@ class Particles {
* @param {number} smoothing - optional amount of smoothing to use as a value between 0 and 1. Defaults to 0.5.
* @returns number
*/
private _generateNewRandomAveragedValue(prevValue: number, minValue: number, maxValue: number, smoothing: number = 0.5): number {
private _generateNewRandomAveragedValue(prevValue: number, minValue: number, maxValue: number, smoothing = 0.5): number {
// cap smoothing at 0.95
smoothing = Math.min(smoothing, 0.95);
const offset = (maxValue - minValue) / 2;
Expand Down

0 comments on commit a74f38a

Please sign in to comment.