Browse Source

Merge pull request #18021 from lgarron/stats-typings

Add typings for `stats.module.js`.
Mr.doob 5 years ago
parent
commit
cffa9b3be2
1 changed files with 24 additions and 0 deletions
  1. 24 0
      examples/jsm/libs/stats.module.d.ts

+ 24 - 0
examples/jsm/libs/stats.module.d.ts

@@ -0,0 +1,24 @@
+declare interface Stats {
+  REVISION: number;
+  dom: HTMLDivElement;
+  addPanel(panel: Stats.Panel): Stats.Panel;
+  showPanel(id: number): void;
+  begin(): void;
+  end(): void;
+  update(): void;
+  domElement: HTMLDivElement;
+  setMode(id: number): void;
+}
+
+declare function Stats(): Stats;
+
+declare namespace Stats {
+  interface Panel {
+    dom: HTMLCanvasElement;
+    update(value: number, maxValue: number): void;
+  }
+
+  function Panel(): Panel;
+}
+
+export default Stats