Skip to content

Commit

Permalink
feat(types): export core types
Browse files Browse the repository at this point in the history
fix #75
  • Loading branch information
nfroidure committed Aug 30, 2024
1 parent ad2c021 commit 4ccd1fa
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/SVGPathData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { encodeSVGPath } from './SVGPathDataEncoder.js';
import { SVGPathDataParser } from './SVGPathDataParser.js';
import { SVGPathDataTransformer } from './SVGPathDataTransformer.js';
import { TransformableSVG } from './TransformableSVG.js';
import { SVGCommand } from './types.js';
import type { SVGCommand } from './types.js';

export class SVGPathData extends TransformableSVG {
commands: SVGCommand[];
Expand Down
2 changes: 1 addition & 1 deletion src/SVGPathDataEncoder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SVGPathData } from './SVGPathData.js';
import { SVGCommand } from './types.js';
import type { SVGCommand } from './types.js';

// Encode SVG PathData
// http://www.w3.org/TR/SVG/paths.html#PathDataBNF
Expand Down
2 changes: 1 addition & 1 deletion src/SVGPathDataParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// http://www.w3.org/TR/SVG/paths.html#PathDataBNF
import { COMMAND_ARG_COUNTS, SVGPathData } from './SVGPathData.js';
import { TransformableSVG } from './TransformableSVG.js';
import { SVGCommand, TransformFunction } from './types.js';
import type { SVGCommand, TransformFunction } from './types.js';
// Private consts : Char groups
const isWhiteSpace = (c: string) =>
' ' === c || '\t' === c || '\r' === c || '\n' === c;
Expand Down
2 changes: 1 addition & 1 deletion src/SVGPathDataTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
intersectionUnitCircleLine,
} from './mathUtils.js';
import { SVGPathData } from './SVGPathData.js';
import { SVGCommand, TransformFunction } from './types.js';
import type { SVGCommand, TransformFunction } from './types.js';

// Predefined transforming functions
// Rounds commands values
Expand Down
2 changes: 1 addition & 1 deletion src/TransformableSVG.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SVGPathDataTransformer } from './SVGPathDataTransformer.js';
import { TransformFunction } from './types.js';
import type { TransformFunction } from './types.js';

export abstract class TransformableSVG {
round(x?: number) {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './SVGPathData.js';
export type * from './types.js';
export { encodeSVGPath } from './SVGPathDataEncoder.js';
export { SVGPathDataParser } from './SVGPathDataParser.js';
export { SVGPathDataTransformer } from './SVGPathDataTransformer.js';
2 changes: 1 addition & 1 deletion src/tests/moveto.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, test, expect } from '@jest/globals';
import { SVGPathData } from '../index.js';
import { assertThrows } from './testUtils.js';
import { CommandM } from '../types.js';
import type { CommandM } from '../types.js';

describe('Parsing move to commands', () => {
test('should not work with single coordinate', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/quadraticbeziercurveto.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, test, expect } from '@jest/globals';
import { SVGPathData } from '../index.js';
import { assertThrows } from './testUtils.js';
import { CommandQ } from '../types.js';
import type { CommandQ } from '../types.js';

describe('Parsing quadratic bezier curve to commands', () => {
test('should not work when badly declared', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/smoothcurveto.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, test, expect } from '@jest/globals';
import { SVGPathData } from '../index.js';
import { assertThrows } from './testUtils.js';
import { CommandS } from '../types.js';
import type { CommandS } from '../types.js';

describe('Parsing smooth curve to commands', () => {
test('should not work when badly declared', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/smoothquadraticcurveto.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, test, expect } from '@jest/globals';
import { SVGPathData } from '../index.js';
import { assertThrows } from './testUtils.js';
import { CommandT } from '../types.js';
import type { CommandT } from '../types.js';

describe('Parsing smooth quadratic curve to commands', () => {
test('should fail with a with single coordinate', () => {
Expand Down

0 comments on commit 4ccd1fa

Please sign in to comment.