From 8b311f19a13d80750080b1ae9159a43c170e9121 Mon Sep 17 00:00:00 2001 From: John Kenny Date: Tue, 22 Oct 2024 07:51:28 -0700 Subject: [PATCH] Clean up type definitions. --- lib/attvalue.js | 2 +- lib/color.js | 2 +- lib/css-parse-decl.js | 2 +- lib/length.js | 2 +- lib/svg-parse-att.js | 2 +- lib/types.d.ts | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/attvalue.js b/lib/attvalue.js index 154961f..6559fd9 100644 --- a/lib/attvalue.js +++ b/lib/attvalue.js @@ -54,7 +54,7 @@ export class OpacityValue extends AttValue { } /** - * @param {string|AttValue} value + * @param {import('./types.js').SVGAttValue} value * @returns {OpacityValue} */ static getOpacityObj(value) { diff --git a/lib/color.js b/lib/color.js index 5af0f67..8a11490 100644 --- a/lib/color.js +++ b/lib/color.js @@ -38,7 +38,7 @@ export class ColorValue extends AttValue { } /** - * @param {string|AttValue} value + * @param {import('./types.js').SVGAttValue} value * @returns {ColorValue} */ static getColorObj(value) { diff --git a/lib/css-parse-decl.js b/lib/css-parse-decl.js index 0055d7b..ccca9a4 100644 --- a/lib/css-parse-decl.js +++ b/lib/css-parse-decl.js @@ -157,7 +157,7 @@ export class CSSTransformValue extends AttValue { } /** - * @param {string|AttValue} value + * @param {import('./types.js').SVGAttValue} value * @returns {CSSTransformValue} */ static getTransformObj(value) { diff --git a/lib/length.js b/lib/length.js index 0ba0853..65154b0 100644 --- a/lib/length.js +++ b/lib/length.js @@ -25,7 +25,7 @@ export class LengthValue extends AttValue { } /** - * @param {string|AttValue} value + * @param {import('./types.js').SVGAttValue} value * @returns {LengthValue} */ static getLengthObj(value) { diff --git a/lib/svg-parse-att.js b/lib/svg-parse-att.js index fddcef1..37999ed 100644 --- a/lib/svg-parse-att.js +++ b/lib/svg-parse-att.js @@ -142,7 +142,7 @@ export class SVGTransformValue extends AttValue { } /** - * @param {string|AttValue} value + * @param {import('./types.js').SVGAttValue} value * @returns {SVGTransformValue} */ static getTransformObj(value) { diff --git a/lib/types.d.ts b/lib/types.d.ts index e616380..957c33e 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -1,5 +1,3 @@ -import type { AttValue } from './attvalue.js'; - export type XastDoctype = { type: 'doctype'; parentNode: XastParent; @@ -134,6 +132,8 @@ type CSSFeatures = | 'pseudos' | 'simple-selectors'; +export class AttValue {} + export class StyleData { computeOwnStyle(node: XastElement): Map; computeParentStyle( @@ -184,7 +184,7 @@ export type CSSParsedTransform = { }; export type CSSPropertyValue = { - value: string | AttValue; + value: SVGAttValue; important: boolean; };