Skip to content

Commit

Permalink
Clean up ExactNum TypeScript.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkenny54 committed Nov 2, 2024
1 parent 0d4a78c commit 6bc857e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/svg-to-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ export function svgAttTransformToCSS(attValue) {
}

/**
* @param {import('./exactnum.js').ExactNum} tx
* @param {import('./exactnum.js').ExactNum} ty
* @param {import('./types.js').ExactNum} tx
* @param {import('./types.js').ExactNum} ty
* @returns {import('./types-css-decl.js').CSSTransFnTranslate}
*/
function makeCSSTranslate(tx, ty) {
Expand Down
2 changes: 1 addition & 1 deletion lib/types-css-decl.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ExactNum } from './exactnum.js';
import type { ExactNum } from './types.js';

export type CSSTypeAngle = {
n: ExactNum;
Expand Down
2 changes: 1 addition & 1 deletion lib/types-svg-attr.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ExactNum } from './exactnum.js';
import type { ExactNum } from './types.js';

export type SVGTransFnMatrix = {
name: 'matrix';
Expand Down
9 changes: 9 additions & 0 deletions lib/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,12 @@ export type PathDataItem = {
};

export type DataUri = 'base64' | 'enc' | 'unenc';

export type ExactNum = {
clone(): ExactNum;
getMinifiedString(): string;
isEqualTo(n: ExactNum): boolean;
isZero(): boolean;
negate(): ExactNum;
setNumberOfDigits(d: number): void;
};

0 comments on commit 6bc857e

Please sign in to comment.