pts 0.11.3 → 0.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -76,5 +76,5 @@ For larger PRs, please ping [@williamngan](https://twitter.com/williamngan) to d
76
76
 
77
77
  ### License
78
78
  Apache License 2.0. See LICENSE file for details.
79
- Copyright © 2017-2019 by William Ngan and contributors.
79
+ Copyright © 2017-today by William Ngan and contributors.
80
80
 
package/dist/index.d.ts CHANGED
@@ -205,7 +205,7 @@ declare type CanvasPatternRepetition = "repeat" | "repeat-x" | "repeat-y" | "no-
205
205
 
206
206
  declare class Pt extends Float32Array implements IPt, Iterable<number> {
207
207
  protected _id: string;
208
- constructor(...args: any[]);
208
+ constructor(...args: Array<number | number[] | IPt | Float32Array>);
209
209
  static make(dimensions: number, defaultValue?: number, randomize?: boolean): Pt;
210
210
  get id(): string;
211
211
  set id(s: string);
@@ -619,14 +619,16 @@ declare class CanvasForm extends VisualForm {
619
619
  protected _ctx: CanvasRenderingContext2D;
620
620
  protected _estimateTextWidth: (string: any) => number;
621
621
  protected _style: DefaultFormStyle;
622
- constructor(space: CanvasSpace | CanvasRenderingContext2D);
622
+ constructor(space?: CanvasSpace | CanvasRenderingContext2D);
623
623
  get space(): CanvasSpace;
624
624
  get ctx(): PtsCanvasRenderingContext2D;
625
625
  useOffscreen(off?: boolean, clear?: boolean | string): this;
626
626
  renderOffscreen(offset?: PtLike): void;
627
627
  alpha(a: number): this;
628
628
  fill(c: string | boolean | CanvasGradient | CanvasPattern): this;
629
+ fillOnly(c: string | boolean | CanvasGradient | CanvasPattern): this;
629
630
  stroke(c: string | boolean | CanvasGradient | CanvasPattern, width?: number, linejoin?: CanvasLineJoin, linecap?: CanvasLineCap): this;
631
+ strokeOnly(c: string | boolean | CanvasGradient | CanvasPattern, width?: number, linejoin?: CanvasLineJoin, linecap?: CanvasLineCap): this;
630
632
  applyFillStroke(filled?: boolean | string, stroked?: boolean | string, strokeWidth?: number): this;
631
633
  gradient(stops: [number, string][] | string[]): ((area1: GroupLike, area2?: GroupLike) => CanvasGradient);
632
634
  composite(mode?: GlobalCompositeOperation): this;
@@ -1209,6 +1211,7 @@ declare class World {
1209
1211
  protected _gravity: Pt;
1210
1212
  protected _friction: number;
1211
1213
  protected _damping: number;
1214
+ protected _iterations: number;
1212
1215
  protected _bound: Bound;
1213
1216
  protected _particles: Particle[];
1214
1217
  protected _bodies: Body[];
@@ -1225,6 +1228,8 @@ declare class World {
1225
1228
  set friction(f: number);
1226
1229
  get damping(): number;
1227
1230
  set damping(f: number);
1231
+ get iterations(): number;
1232
+ set iterations(f: number);
1228
1233
  get bodyCount(): number;
1229
1234
  get particleCount(): number;
1230
1235
  body(id: number | string): any;
@@ -1329,6 +1334,7 @@ declare class Sound {
1329
1334
  protected _playing: boolean;
1330
1335
  protected _timestamp: number;
1331
1336
  constructor(type: SoundType);
1337
+ protected _createAudioContext(): void;
1332
1338
  static from(node: AudioNode, ctx: AudioContext, type?: SoundType, stream?: MediaStream): Sound;
1333
1339
  static load(source: HTMLMediaElement | string, crossOrigin?: string): Promise<Sound>;
1334
1340
  static loadAsBuffer(url: string): Promise<Sound>;