Skip to content

Commit

Permalink
refactor(imgui): update type-only imports
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Dec 7, 2020
1 parent dc88789 commit f01e3f4
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/imgui/src/behaviors/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { pointInside } from "@thi.ng/geom";
import type { IShape } from "@thi.ng/geom-api";
import { Key } from "../api";
import { tooltipRaw } from "../components/tooltip";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";

export const hoverButton = (
gui: IMGUI,
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/behaviors/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { IShape } from "@thi.ng/geom-api";
import { clamp, roundTo } from "@thi.ng/math";
import { add2, clamp2, roundN2, Vec } from "@thi.ng/vectors";
import { Key } from "../api";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";

export const isHoverSlider = (
gui: IMGUI,
Expand Down
4 changes: 2 additions & 2 deletions packages/imgui/src/behaviors/text.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Predicate } from "@thi.ng/api";
import type { Predicate } from "@thi.ng/api";
import { Key } from "../api";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";

const WS = /\s/;

Expand Down
4 changes: 2 additions & 2 deletions packages/imgui/src/components/button.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Fn5 } from "@thi.ng/api";
import type { Fn5 } from "@thi.ng/api";
import { rect } from "@thi.ng/geom";
import type { IShape } from "@thi.ng/geom-api";
import type { IGridLayout, LayoutBox } from "@thi.ng/layout";
import { hash, ZERO2 } from "@thi.ng/vectors";
import type { GUITheme, Hash } from "../api";
import { handleButtonKeys, hoverButton } from "../behaviors/button";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { labelHash } from "../hash";
import { layoutBox } from "../layout";
import { textLabelRaw, textTransformH, textTransformV } from "./textlabel";
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/dial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { HALF_PI, norm, PI, TAU } from "@thi.ng/math";
import { cartesian2, hash } from "@thi.ng/vectors";
import { dialVal } from "../behaviors/dial";
import { handleSlider1Keys, isHoverSlider } from "../behaviors/slider";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { dialValueLabel } from "./textlabel";
import { tooltipRaw } from "./tooltip";

Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { polygon } from "@thi.ng/geom";
import { gridLayout, IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
import { hash } from "@thi.ng/vectors";
import { Key } from "../api";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { buttonH } from "./button";

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/icon-button.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { rect } from "@thi.ng/geom";
import { IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
import { hash } from "@thi.ng/vectors";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { mixHash } from "../hash";
import { buttonRaw } from "./button";
import { textLabelRaw } from "./textlabel";
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/radial-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { fmod } from "@thi.ng/math";
import { mapIndexed } from "@thi.ng/transducers";
import { add2, hash } from "@thi.ng/vectors";
import { Hash, Key } from "../api";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { buttonRaw } from "./button";
import { textLabelRaw } from "./textlabel";

Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/radio.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gridLayout, IGridLayout, isLayout, LayoutBox } from "@thi.ng/layout";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { toggle } from "./toggle";

export const radio = (
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/ring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { map, normRange } from "@thi.ng/transducers";
import { cartesian2, hash, Vec } from "@thi.ng/vectors";
import { dialVal } from "../behaviors/dial";
import { handleSlider1Keys } from "../behaviors/slider";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { dialValueLabel } from "./textlabel";
import { tooltipRaw } from "./tooltip";

Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/sliderh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
isHoverSlider,
slider1Val,
} from "../behaviors/slider";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { valHash } from "../hash";
import { layoutBox } from "../layout";
import { textLabelRaw } from "./textlabel";
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/sliderv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
isHoverSlider,
slider1Val,
} from "../behaviors/slider";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { valHash } from "../hash";
import { layoutBox } from "../layout";
import { textLabelRaw, textTransformV } from "./textlabel";
Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/textfield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { fitClamped } from "@thi.ng/math";
import { hash } from "@thi.ng/vectors";
import { isHoverSlider } from "../behaviors/slider";
import { handleTextfieldKeys } from "../behaviors/text";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { layoutBox } from "../layout";
import { textLabelRaw } from "./textlabel";
import { tooltipRaw } from "./tooltip";
Expand Down
4 changes: 2 additions & 2 deletions packages/imgui/src/components/textlabel.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Fn } from "@thi.ng/api";
import type { Fn } from "@thi.ng/api";
import { isPlainObject } from "@thi.ng/checks";
import type { IGridLayout, LayoutBox } from "@thi.ng/layout";
import type { ReadonlyVec } from "@thi.ng/vectors";
import type { Color, GUITheme } from "../api";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { valHash } from "../hash";
import { layoutBox } from "../layout";

Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { rect } from "@thi.ng/geom";
import type { IGridLayout, LayoutBox } from "@thi.ng/layout";
import { hash } from "@thi.ng/vectors";
import { handleButtonKeys, hoverButton } from "../behaviors/button";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { layoutBox } from "../layout";
import { textLabelRaw } from "./textlabel";

Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/components/tooltip.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { rect } from "@thi.ng/geom";
import { add2 } from "@thi.ng/vectors";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { textLabelRaw } from "./textlabel";

export const tooltipRaw = (gui: IMGUI, tooltip: string) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/imgui/src/components/xypad.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Fn } from "@thi.ng/api";
import { line, rect } from "@thi.ng/geom";
import { IGridLayout, LayoutBox } from "@thi.ng/layout";
import type { IGridLayout, LayoutBox } from "@thi.ng/layout";
import { fit2, hash, Vec } from "@thi.ng/vectors";
import {
handleSlider2Keys,
isHoverSlider,
slider2Val,
} from "../behaviors/slider";
import { IMGUI } from "../gui";
import type { IMGUI } from "../gui";
import { textLabelRaw } from "./textlabel";
import { tooltipRaw } from "./tooltip";

Expand Down
2 changes: 1 addition & 1 deletion packages/imgui/src/events.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MouseButton } from "./api";
import { IMGUI } from "./gui";
import type { IMGUI } from "./gui";

/**
* Injects default mouse & touch event handlers into `gui.attribs` and
Expand Down

0 comments on commit f01e3f4

Please sign in to comment.