Skip to content

Commit

Permalink
refactor(text-canvas): update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Feb 24, 2020
1 parent 3937dc6 commit 4f87d2c
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/text-canvas/src/ansi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memoize1 } from "@thi.ng/memoize";
import { StringFormat } from "./api";
import type { StringFormat } from "./api";

const ANSI_RESET = `\x1b[0m`;

Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fn, NumOrString } from "@thi.ng/api";
import type { Fn, NumOrString } from "@thi.ng/api";

export const enum Align {
LEFT,
Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/canvas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Fn0, NumOrString } from "@thi.ng/api";
import { peek } from "@thi.ng/arrays";
import { clamp } from "@thi.ng/math";
import {
Expand All @@ -8,6 +7,7 @@ import {
STYLE_ASCII
} from "./api";
import { charCode, intersectRect } from "./utils";
import type { Fn0, NumOrString } from "@thi.ng/api";

export class Canvas {
buf: Uint32Array;
Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/circle.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NumOrString } from "@thi.ng/api";
import { peek } from "@thi.ng/arrays";
import { Canvas } from "./canvas";
import { hline } from "./hvline";
import { charCode, intersectRectCircle } from "./utils";
import type { NumOrString } from "@thi.ng/api";

/**
* Draws a circle (filled or outline) at given center position and
Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/html.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memoize1 } from "@thi.ng/memoize";
import { HtmlFormatOpts, StringFormat } from "./api";
import type { HtmlFormatOpts, StringFormat } from "./api";

/**
* Constructs an HTML formatter using given config options.
Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/hvline.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NumOrString } from "@thi.ng/api";
import { peek } from "@thi.ng/arrays";
import { Canvas } from "./canvas";
import { charCode } from "./utils";
import type { NumOrString } from "@thi.ng/api";

/**
* Draws horizontal line from `x`,`y`, taking the current clip rect,
Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/line.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NumOrString } from "@thi.ng/api";
import { peek } from "@thi.ng/arrays";
import { liangBarsky2Raw } from "@thi.ng/geom-clip-line";
import { Canvas } from "./canvas";
import { charCode } from "./utils";
import type { NumOrString } from "@thi.ng/api";

/**
* Draws a line between `ax`,`ay` and `bx`,`by`, using `char` and taking
Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/rect.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NumOrString } from "@thi.ng/api";
import { peek } from "@thi.ng/arrays";
import { Canvas } from "./canvas";
import { hline, vline } from "./hvline";
import { charCode } from "./utils";
import type { NumOrString } from "@thi.ng/api";

/**
* Clears/fills the canvas' current clip rect with given char (default:
Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/string.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { StringFormat } from "./api";
import { Canvas } from "./canvas";
import type { StringFormat } from "./api";

/**
* Returns string representation of canvas, optionally using given
Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StrokeStyle } from "./api";
import type { StrokeStyle } from "./api";

export const horizontalOnly = ({ hl, dot }: StrokeStyle): StrokeStyle => ({
hl: hl,
Expand Down
2 changes: 1 addition & 1 deletion packages/text-canvas/src/text.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { peek } from "@thi.ng/arrays";
import { wordWrap } from "@thi.ng/transducers";
import { TextBoxOpts } from "./api";
import {
beginClip,
beginStyle,
Expand All @@ -9,6 +8,7 @@ import {
endStyle
} from "./canvas";
import { fillRect, strokeRect } from "./rect";
import type { TextBoxOpts } from "./api";

/**
* Writes given string at position `x`,`y`, taking the current clip rect
Expand Down
4 changes: 2 additions & 2 deletions packages/text-canvas/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NumOrString } from "@thi.ng/api";
import { ClipRect } from "./api";
import type { NumOrString } from "@thi.ng/api";
import type { ClipRect } from "./api";

export const charCode = (x: NumOrString, format: number) =>
(typeof x === "string" ? x.charCodeAt(0) : x) | (format << 16);
Expand Down

0 comments on commit 4f87d2c

Please sign in to comment.