Skip to content

Commit

Permalink
refactor(hiccup-canvas): update type usage
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Apr 19, 2024
1 parent 33f8451 commit 33ffebf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/hiccup-canvas/src/draw.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Maybe } from "@thi.ng/api";
import { implementsFunction } from "@thi.ng/checks/implements-function";
import { isArray } from "@thi.ng/checks/is-array";
import type { DrawState } from "./api.js";
Expand Down Expand Up @@ -153,7 +154,7 @@ export const draw = (

const defs = (
ctx: CanvasRenderingContext2D,
state: DrawState | undefined,
state: Maybe<DrawState>,
pstate: DrawState,
shape: any[]
) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/hiccup-canvas/src/internal/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IObjectOf } from "@thi.ng/api";
import type { IObjectOf, Maybe } from "@thi.ng/api";
import { isArrayLike } from "@thi.ng/checks/is-arraylike";
import type { DrawState } from "../api.js";
import { resolveGradientOrColor } from "../color.js";
Expand Down Expand Up @@ -64,7 +64,7 @@ export const __mergeState = (
state: DrawState,
attribs: IObjectOf<any>
) => {
let res: DrawState | undefined;
let res: Maybe<DrawState>;
if (!attribs) return;
if (applyTransform(ctx, attribs)) {
res = __newState(state, true);
Expand Down

0 comments on commit 33ffebf

Please sign in to comment.