refactor: enable typescript option verbatimModuleSyntax

This commit is contained in:
Nathan Muir
2025-08-20 11:27:20 +12:00
parent 0568cfc7c9
commit 9aac5b4ebf
58 changed files with 173 additions and 128 deletions

View File

@@ -1,6 +1,6 @@
import { glob } from './Global.ts'; import { glob } from './Global.ts';
import { Layer } from './Layer.ts'; import type { Layer } from './Layer.ts';
import { IFrame, AnimationFn } from './types.ts'; import type { IFrame, AnimationFn } from './types.ts';
import { Util } from './Util.ts'; import { Util } from './Util.ts';
const now = (function (): () => number { const now = (function (): () => number {

View File

@@ -1,5 +1,6 @@
import { Util } from './Util.ts'; import { Util } from './Util.ts';
import { SceneContext, HitContext, Context } from './Context.ts'; import type { Context } from './Context.ts';
import { SceneContext, HitContext } from './Context.ts';
import { Konva } from './Global.ts'; import { Konva } from './Global.ts';
// calculate pixel ratio // calculate pixel ratio

View File

@@ -1,9 +1,10 @@
import { HitCanvas, SceneCanvas } from './Canvas.ts'; import type { HitCanvas, SceneCanvas } from './Canvas.ts';
import { SceneContext } from './Context.ts'; import type { SceneContext } from './Context.ts';
import { Factory } from './Factory.ts'; import { Factory } from './Factory.ts';
import { Node, NodeConfig } from './Node.ts'; import type { NodeConfig } from './Node.ts';
import { Shape } from './Shape.ts'; import { Node } from './Node.ts';
import { GetSet, IRect } from './types.ts'; import type { Shape } from './Shape.ts';
import type { GetSet, IRect } from './types.ts';
import { getNumberValidator } from './Validators.ts'; import { getNumberValidator } from './Validators.ts';
export type ClipFuncOutput = export type ClipFuncOutput =

View File

@@ -1,8 +1,8 @@
import { Util } from './Util.ts'; import { Util } from './Util.ts';
import { Konva } from './Global.ts'; import { Konva } from './Global.ts';
import { Canvas } from './Canvas.ts'; import type { Canvas } from './Canvas.ts';
import { Shape } from './Shape.ts'; import type { Shape } from './Shape.ts';
import { IRect } from './types.ts'; import type { IRect } from './types.ts';
import type { Node } from './Node.ts'; import type { Node } from './Node.ts';
function simplifyArray(arr: Array<any>) { function simplifyArray(arr: Array<any>) {

View File

@@ -1,7 +1,7 @@
import { Container } from './Container.ts'; import type { Container } from './Container.ts';
import { Konva } from './Global.ts'; import { Konva } from './Global.ts';
import { Node } from './Node.ts'; import type { Node } from './Node.ts';
import { Vector2d } from './types.ts'; import type { Vector2d } from './types.ts';
import { Util } from './Util.ts'; import { Util } from './Util.ts';
export const DD = { export const DD = {

View File

@@ -1,5 +1,5 @@
import { Node } from './Node.ts'; import type { Node } from './Node.ts';
import { GetSet } from './types.ts'; import type { GetSet } from './types.ts';
import { Util } from './Util.ts'; import { Util } from './Util.ts';
import { getComponentValidator } from './Validators.ts'; import { getComponentValidator } from './Validators.ts';

View File

@@ -1,8 +1,9 @@
import { Util } from './Util.ts'; import { Util } from './Util.ts';
import { Container, ContainerConfig } from './Container.ts'; import type { ContainerConfig } from './Container.ts';
import { Container } from './Container.ts';
import { _registerNode } from './Global.ts'; import { _registerNode } from './Global.ts';
import { Node } from './Node.ts'; import type { Node } from './Node.ts';
import { Shape } from './Shape.ts'; import type { Shape } from './Shape.ts';
export interface GroupConfig extends ContainerConfig {} export interface GroupConfig extends ContainerConfig {}

View File

@@ -1,14 +1,16 @@
import { Util } from './Util.ts'; import { Util } from './Util.ts';
import { Container, ContainerConfig } from './Container.ts'; import type { ContainerConfig } from './Container.ts';
import { Container } from './Container.ts';
import { Node } from './Node.ts'; import { Node } from './Node.ts';
import { Factory } from './Factory.ts'; import { Factory } from './Factory.ts';
import { SceneCanvas, HitCanvas } from './Canvas.ts'; import { SceneCanvas, HitCanvas } from './Canvas.ts';
import { Stage } from './Stage.ts'; import type { Stage } from './Stage.ts';
import { getBooleanValidator } from './Validators.ts'; import { getBooleanValidator } from './Validators.ts';
import { GetSet, Vector2d } from './types.ts'; import type { GetSet, Vector2d } from './types.ts';
import { Group } from './Group.ts'; import type { Group } from './Group.ts';
import { Shape, shapes } from './Shape.ts'; import type { Shape } from './Shape.ts';
import { shapes } from './Shape.ts';
import { _registerNode } from './Global.ts'; import { _registerNode } from './Global.ts';
export interface LayerConfig extends ContainerConfig { export interface LayerConfig extends ContainerConfig {

View File

@@ -1,13 +1,14 @@
import { Canvas, HitCanvas, SceneCanvas } from './Canvas.ts'; import type { Canvas } from './Canvas.ts';
import { Container } from './Container.ts'; import { HitCanvas, SceneCanvas } from './Canvas.ts';
import { Context } from './Context.ts'; import type { Container } from './Container.ts';
import type { Context } from './Context.ts';
import { DD } from './DragAndDrop.ts'; import { DD } from './DragAndDrop.ts';
import { Factory } from './Factory.ts'; import { Factory } from './Factory.ts';
import { Konva } from './Global.ts'; import { Konva } from './Global.ts';
import { Layer } from './Layer.ts'; import type { Layer } from './Layer.ts';
import { Shape } from './Shape.ts'; import type { Shape } from './Shape.ts';
import { Stage } from './Stage.ts'; import type { Stage } from './Stage.ts';
import { GetSet, IRect, Vector2d } from './types.ts'; import type { GetSet, IRect, Vector2d } from './types.ts';
import { Transform, Util } from './Util.ts'; import { Transform, Util } from './Util.ts';
import { import {
getBooleanValidator, getBooleanValidator,

View File

@@ -1,8 +1,8 @@
import { KonvaEventObject } from './Node.ts'; import type { KonvaEventObject } from './Node.ts';
import { Konva } from './Global.ts'; import { Konva } from './Global.ts';
import { Shape } from './Shape.ts'; import type { Shape } from './Shape.ts';
import { Stage } from './Stage.ts'; import type { Stage } from './Stage.ts';
const Captures = new Map<number, Shape | Stage>(); const Captures = new Map<number, Shape | Stage>();

View File

@@ -1,7 +1,8 @@
import { Konva } from './Global.ts'; import { Konva } from './Global.ts';
import { Transform, Util } from './Util.ts'; import { Transform, Util } from './Util.ts';
import { Factory } from './Factory.ts'; import { Factory } from './Factory.ts';
import { Node, NodeConfig } from './Node.ts'; import type { NodeConfig } from './Node.ts';
import { Node } from './Node.ts';
import { import {
getNumberValidator, getNumberValidator,
getNumberOrAutoValidator, getNumberOrAutoValidator,
@@ -10,12 +11,12 @@ import {
getStringOrGradientValidator, getStringOrGradientValidator,
} from './Validators.ts'; } from './Validators.ts';
import { Context, SceneContext } from './Context.ts'; import type { Context, SceneContext } from './Context.ts';
import { _registerNode } from './Global.ts'; import { _registerNode } from './Global.ts';
import * as PointerEvents from './PointerEvents.ts'; import * as PointerEvents from './PointerEvents.ts';
import { GetSet, Vector2d } from './types.ts'; import type { GetSet, Vector2d } from './types.ts';
import { HitCanvas, SceneCanvas } from './Canvas.ts'; import type { HitCanvas, SceneCanvas } from './Canvas.ts';
// hack from here https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types/52668133#52668133 // hack from here https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types/52668133#52668133
export type ShapeConfigHandler<TTarget> = { export type ShapeConfigHandler<TTarget> = {

View File

@@ -1,11 +1,12 @@
import { Util } from './Util.ts'; import { Util } from './Util.ts';
import { Factory } from './Factory.ts'; import { Factory } from './Factory.ts';
import { Container, ContainerConfig } from './Container.ts'; import type { ContainerConfig } from './Container.ts';
import { Container } from './Container.ts';
import { Konva } from './Global.ts'; import { Konva } from './Global.ts';
import { SceneCanvas, HitCanvas } from './Canvas.ts'; import { SceneCanvas, HitCanvas } from './Canvas.ts';
import { GetSet, Vector2d } from './types.ts'; import type { GetSet, Vector2d } from './types.ts';
import { Shape } from './Shape.ts'; import type { Shape } from './Shape.ts';
import { Layer } from './Layer.ts'; import type { Layer } from './Layer.ts';
import { DD } from './DragAndDrop.ts'; import { DD } from './DragAndDrop.ts';
import { _registerNode } from './Global.ts'; import { _registerNode } from './Global.ts';
import * as PointerEvents from './PointerEvents.ts'; import * as PointerEvents from './PointerEvents.ts';

View File

@@ -1,8 +1,9 @@
import { Util } from './Util.ts'; import { Util } from './Util.ts';
import { Animation } from './Animation.ts'; import { Animation } from './Animation.ts';
import { Node, NodeConfig } from './Node.ts'; import type { NodeConfig } from './Node.ts';
import { Node } from './Node.ts';
import { Konva } from './Global.ts'; import { Konva } from './Global.ts';
import { Line } from './shapes/Line.ts'; import type { Line } from './shapes/Line.ts';
const blacklist = { const blacklist = {
node: 1, node: 1,

View File

@@ -1,6 +1,6 @@
import { Konva } from './Global.ts'; import { Konva } from './Global.ts';
import { Context } from './Context.ts'; import type { Context } from './Context.ts';
import { IRect, RGB, Vector2d } from './types.ts'; import type { IRect, RGB, Vector2d } from './types.ts';
const NODE_ERROR = `Konva.js unsupported environment. const NODE_ERROR = `Konva.js unsupported environment.

View File

@@ -46,11 +46,14 @@ export namespace Konva {
export type Vector2d = import('./types.ts').Vector2d; export type Vector2d = import('./types.ts').Vector2d;
export type Node = import('./Node.ts').Node; export type Node = import('./Node.ts').Node;
export type NodeConfig = import('./Node.ts').NodeConfig; export type NodeConfig = import('./Node.ts').NodeConfig;
export type KonvaEventObject<EventType> = import('./Node.ts').KonvaEventObject<EventType>; export type KonvaEventObject<EventType> =
import('./Node.ts').KonvaEventObject<EventType>;
export type KonvaPointerEvent = import('./PointerEvents.ts').KonvaPointerEvent; export type KonvaPointerEvent =
import('./PointerEvents.ts').KonvaPointerEvent;
export type KonvaEventListener<This, EventType> = import('./Node.ts').KonvaEventListener<This, EventType>; export type KonvaEventListener<This, EventType> =
import('./Node.ts').KonvaEventListener<This, EventType>;
export type Container = import('./Container.ts').Container<Node>; export type Container = import('./Container.ts').Container<Node>;
export type ContainerConfig = import('./Container.ts').ContainerConfig; export type ContainerConfig = import('./Container.ts').ContainerConfig;

View File

@@ -96,7 +96,10 @@ export namespace Konva {
export type KonvaPointerEvent = Core.KonvaPointerEvent; export type KonvaPointerEvent = Core.KonvaPointerEvent;
export type KonvaEventListener<This, EventType> = Core.KonvaEventListener<This, EventType>; export type KonvaEventListener<This, EventType> = Core.KonvaEventListener<
This,
EventType
>;
export type Container = Core.Container; export type Container = Core.Container;
export type ContainerConfig = Core.ContainerConfig; export type ContainerConfig = Core.ContainerConfig;

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
/* /*
the Gauss filter the Gauss filter

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
/** /**

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
/** /**
* Contrast Filter. * Contrast Filter.

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { Util } from '../Util.ts'; import { Util } from '../Util.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
/** /**

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
function remap( function remap(

View File

@@ -1,4 +1,4 @@
import { Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
/** /**
* Grayscale Filter * Grayscale Filter

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
Factory.addGetterSetter( Factory.addGetterSetter(

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Filter, Node } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
/** /**

View File

@@ -1,4 +1,4 @@
import { Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
/** /**
* Invert Filter * Invert Filter
* @function * @function

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Filter, Node } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { Util } from '../Util.ts'; import { Util } from '../Util.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Filter, Node } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
function pixelAt(idata, x: number, y: number) { function pixelAt(idata, x: number, y: number) {

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Filter, Node } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
/** /**

View File

@@ -1,6 +1,7 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Util } from '../Util.ts'; import { Util } from '../Util.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
/** /**

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Filter, Node } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
/** /**

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { RGBComponent } from '../Validators.ts'; import { RGBComponent } from '../Validators.ts';
/** /**

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { RGBComponent } from '../Validators.ts'; import { RGBComponent } from '../Validators.ts';
/** /**

View File

@@ -1,4 +1,4 @@
import { Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
// based on https://stackoverflow.com/questions/1061093/how-is-a-sepia-tone-created // based on https://stackoverflow.com/questions/1061093/how-is-a-sepia-tone-created

View File

@@ -1,4 +1,4 @@
import { Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
/** /**
* Solarize Filter * Solarize Filter
* Pixastic Lib - Solarize filter - v0.1.0 * Pixastic Lib - Solarize filter - v0.1.0

View File

@@ -1,5 +1,6 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Node, Filter } from '../Node.ts'; import type { Filter } from '../Node.ts';
import { Node } from '../Node.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
/** /**
* Threshold Filter. Pushes any value above the mid point to * Threshold Filter. Pushes any value above the mid point to

View File

@@ -1,10 +1,11 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { Konva } from '../Global.ts'; import { Konva } from '../Global.ts';
import { GetSet } from '../types.ts'; import type { GetSet } from '../types.ts';
import { getNumberValidator, getBooleanValidator } from '../Validators.ts'; import { getNumberValidator, getBooleanValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
export interface ArcConfig extends ShapeConfig { export interface ArcConfig extends ShapeConfig {
angle: number; angle: number;

View File

@@ -1,10 +1,11 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Line, LineConfig } from './Line.ts'; import type { LineConfig } from './Line.ts';
import { GetSet } from '../types.ts'; import { Line } from './Line.ts';
import type { GetSet } from '../types.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { Path } from './Path.ts'; import { Path } from './Path.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
export interface ArrowConfig extends LineConfig { export interface ArrowConfig extends LineConfig {
points: number[]; points: number[];

View File

@@ -1,9 +1,10 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { GetSet } from '../types.ts'; import { Shape } from '../Shape.ts';
import type { GetSet } from '../types.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
export interface CircleConfig extends ShapeConfig { export interface CircleConfig extends ShapeConfig {
radius?: number; radius?: number;

View File

@@ -1,10 +1,11 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { GetSet, Vector2d } from '../types.ts'; import type { GetSet, Vector2d } from '../types.ts';
export interface EllipseConfig extends ShapeConfig { export interface EllipseConfig extends ShapeConfig {
radiusX: number; radiusX: number;

View File

@@ -1,14 +1,15 @@
import { Util } from '../Util.ts'; import { Util } from '../Util.ts';
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { import {
getNumberOrArrayOfNumbersValidator, getNumberOrArrayOfNumbersValidator,
getNumberValidator, getNumberValidator,
} from '../Validators.ts'; } from '../Validators.ts';
import { GetSet, IRect } from '../types.ts'; import type { GetSet, IRect } from '../types.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
export interface ImageConfig extends ShapeConfig { export interface ImageConfig extends ShapeConfig {
image: CanvasImageSource | undefined; image: CanvasImageSource | undefined;

View File

@@ -1,16 +1,17 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { Group } from '../Group.ts'; import { Group } from '../Group.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { ContainerConfig } from '../Container.ts'; import type { ContainerConfig } from '../Container.ts';
import { import {
getNumberOrArrayOfNumbersValidator, getNumberOrArrayOfNumbersValidator,
getNumberValidator, getNumberValidator,
} from '../Validators.ts'; } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { GetSet } from '../types.ts'; import type { GetSet } from '../types.ts';
import { Text } from './Text.ts'; import type { Text } from './Text.ts';
export interface LabelConfig extends ContainerConfig {} export interface LabelConfig extends ContainerConfig {}

View File

@@ -1,10 +1,11 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { getNumberArrayValidator, getNumberValidator } from '../Validators.ts'; import { getNumberArrayValidator, getNumberValidator } from '../Validators.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { GetSet } from '../types.ts'; import type { GetSet } from '../types.ts';
function getControlPoints( function getControlPoints(
x0: number, x0: number,

View File

@@ -1,13 +1,14 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { import {
getCubicArcLength, getCubicArcLength,
getQuadraticArcLength, getQuadraticArcLength,
t2length, t2length,
} from '../BezierFunctions.ts'; } from '../BezierFunctions.ts';
import { GetSet, PathSegment } from '../types.ts'; import type { GetSet, PathSegment } from '../types.ts';
export interface PathConfig extends ShapeConfig { export interface PathConfig extends ShapeConfig {
data?: string; data?: string;

View File

@@ -1,10 +1,11 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { Util } from '../Util.ts'; import { Util } from '../Util.ts';
import { GetSet } from '../types.ts'; import type { GetSet } from '../types.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { getNumberOrArrayOfNumbersValidator } from '../Validators.ts'; import { getNumberOrArrayOfNumbersValidator } from '../Validators.ts';
export interface RectConfig extends ShapeConfig { export interface RectConfig extends ShapeConfig {

View File

@@ -1,12 +1,13 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { GetSet, Vector2d } from '../types.ts'; import { Shape } from '../Shape.ts';
import type { GetSet, Vector2d } from '../types.ts';
import { import {
getNumberOrArrayOfNumbersValidator, getNumberOrArrayOfNumbersValidator,
getNumberValidator, getNumberValidator,
} from '../Validators.ts'; } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { Util } from '../Util.ts'; import { Util } from '../Util.ts';
export interface RegularPolygonConfig extends ShapeConfig { export interface RegularPolygonConfig extends ShapeConfig {

View File

@@ -1,9 +1,10 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { GetSet } from '../types.ts'; import { Shape } from '../Shape.ts';
import type { GetSet } from '../types.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
export interface RingConfig extends ShapeConfig { export interface RingConfig extends ShapeConfig {
innerRadius: number; innerRadius: number;

View File

@@ -1,11 +1,12 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { Animation } from '../Animation.ts'; import { Animation } from '../Animation.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { GetSet } from '../types.ts'; import type { GetSet } from '../types.ts';
export interface SpriteConfig extends ShapeConfig { export interface SpriteConfig extends ShapeConfig {
animation: string; animation: string;

View File

@@ -1,10 +1,11 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { GetSet } from '../types.ts'; import type { GetSet } from '../types.ts';
export interface StarConfig extends ShapeConfig { export interface StarConfig extends ShapeConfig {
numPoints: number; numPoints: number;

View File

@@ -1,7 +1,8 @@
import { Util } from '../Util.ts'; import { Util } from '../Util.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { Konva } from '../Global.ts'; import { Konva } from '../Global.ts';
import { import {
getNumberValidator, getNumberValidator,
@@ -11,7 +12,7 @@ import {
} from '../Validators.ts'; } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { GetSet } from '../types.ts'; import type { GetSet } from '../types.ts';
export interface CharRenderProps { export interface CharRenderProps {
char: string; char: string;

View File

@@ -1,13 +1,14 @@
import { Util } from '../Util.ts'; import { Util } from '../Util.ts';
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { Path } from './Path.ts'; import { Path } from './Path.ts';
import { Text, stringToArray } from './Text.ts'; import { Text, stringToArray } from './Text.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { GetSet, PathSegment, Vector2d } from '../types.ts'; import type { GetSet, PathSegment, Vector2d } from '../types.ts';
export interface TextPathConfig extends ShapeConfig { export interface TextPathConfig extends ShapeConfig {
text?: string; text?: string;

View File

@@ -4,12 +4,12 @@ import { Node } from '../Node.ts';
import { Shape } from '../Shape.ts'; import { Shape } from '../Shape.ts';
import { Rect } from './Rect.ts'; import { Rect } from './Rect.ts';
import { Group } from '../Group.ts'; import { Group } from '../Group.ts';
import { ContainerConfig } from '../Container.ts'; import type { ContainerConfig } from '../Container.ts';
import { Konva } from '../Global.ts'; import { Konva } from '../Global.ts';
import { getBooleanValidator, getNumberValidator } from '../Validators.ts'; import { getBooleanValidator, getNumberValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { GetSet, IRect, Vector2d } from '../types.ts'; import type { GetSet, IRect, Vector2d } from '../types.ts';
export interface Box extends IRect { export interface Box extends IRect {
rotation: number; rotation: number;

View File

@@ -1,11 +1,12 @@
import { Factory } from '../Factory.ts'; import { Factory } from '../Factory.ts';
import { Context } from '../Context.ts'; import type { Context } from '../Context.ts';
import { Shape, ShapeConfig } from '../Shape.ts'; import type { ShapeConfig } from '../Shape.ts';
import { Shape } from '../Shape.ts';
import { Konva } from '../Global.ts'; import { Konva } from '../Global.ts';
import { getNumberValidator } from '../Validators.ts'; import { getNumberValidator } from '../Validators.ts';
import { _registerNode } from '../Global.ts'; import { _registerNode } from '../Global.ts';
import { GetSet } from '../types.ts'; import type { GetSet } from '../types.ts';
export interface WedgeConfig extends ShapeConfig { export interface WedgeConfig extends ShapeConfig {
angle: number; angle: number;

View File

@@ -1,5 +1,5 @@
import { assert } from 'chai'; import { assert } from 'chai';
import { Line } from '../../src/shapes/Line.ts'; import type { Line } from '../../src/shapes/Line.ts';
import { addStage, Konva, cloneAndCompareLayer } from './test-utils.ts'; import { addStage, Konva, cloneAndCompareLayer } from './test-utils.ts';

View File

@@ -1,5 +1,5 @@
import { assert } from 'chai'; import { assert } from 'chai';
import { Shape } from '../../src/Shape.js'; import type { Shape } from '../../src/Shape.js';
import { addStage, Konva, compareLayers, isNode } from './test-utils.ts'; import { addStage, Konva, compareLayers, isNode } from './test-utils.ts';
describe('Container', function () { describe('Container', function () {

View File

@@ -1,5 +1,5 @@
import { assert } from 'chai'; import { assert } from 'chai';
import { Shape } from '../../src/Shape.ts'; import type { Shape } from '../../src/Shape.ts';
import { import {
addStage, addStage,

View File

@@ -1,5 +1,5 @@
import { assert } from 'chai'; import { assert } from 'chai';
import { Transformer } from '../../src/shapes/Transformer.ts'; import type { Transformer } from '../../src/shapes/Transformer.ts';
import type { Rect } from '../../src/shapes/Rect.ts'; import type { Rect } from '../../src/shapes/Rect.ts';
import type { Shape } from '../../src/Shape.ts'; import type { Shape } from '../../src/Shape.ts';

View File

@@ -9,8 +9,8 @@ Konva.enableTrace = true;
Konva.showWarnings = true; Konva.showWarnings = true;
import { imagediff } from './imagediff.ts'; import { imagediff } from './imagediff.ts';
import { Layer } from '../../src/Layer.ts'; import type { Layer } from '../../src/Layer.ts';
import { Stage } from '../../src/Stage.ts'; import type { Stage } from '../../src/Stage.ts';
// reset some data // reset some data
beforeEach(function () { beforeEach(function () {

View File

@@ -8,8 +8,7 @@
"rewriteRelativeImportExtensions": true, "rewriteRelativeImportExtensions": true,
"isolatedModules": true, "isolatedModules": true,
"erasableSyntaxOnly": true, "erasableSyntaxOnly": true,
// ideally we want to enable erasableSyntaxOnly & verbatimModuleSyntax for true node interop "verbatimModuleSyntax": true,
"verbatimModuleSyntax": false,
// "sourceMap": true, // "sourceMap": true,
"noEmitOnError": true, "noEmitOnError": true,
"declaration": true, "declaration": true,