Skip to content

Commit 097f8d4

Browse files
ralfstxclaude
andcommitted
💥 Remove deprecated Polyline type from graphics API
The `Polyline` and `PolyLineOpts` types were deprecated in favor of the more versatile `Path` type. Remove them and update the `Shape` union type accordingly. Also document all deprecated API removals in the 0.6.0 changelog. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8a17bbc commit 097f8d4

2 files changed

Lines changed: 14 additions & 20 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@
2222
registered with `PdfMaker.registerFont()`. The `FontsDefinition` and
2323
`FontDefinition` types have been removed.
2424

25+
- The deprecated standalone `makePdf` function. Use
26+
`new PdfMaker().makePdf()` instead.
27+
28+
- The deprecated `Polyline` and `PolyLineOpts` types from the graphics
29+
API. Use `Path` instead.
30+
31+
- The deprecated `bold` and `italic` text properties. Use
32+
`fontWeight: 'bold'` and `fontStyle: 'italic'` instead.
33+
34+
- The deprecated type aliases `InfoAttrs`, `CustomInfoAttrs`,
35+
`LineOpts`, `RectOpts`, `CircleOpts`, `PathOpts`, `BlockAttrs`,
36+
and `TextAttrs`. Use their `*Props` counterparts instead.
37+
2538
### Breaking
2639

2740
- Text height is now based on the OS/2 typographic metrics

‎src/api/graphics.ts‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Color } from './colors.ts';
22

3-
export type Shape = Rect | Circle | Line | Path | Polyline;
3+
export type Shape = Rect | Circle | Line | Path;
44

55
/**
66
* A straight line.
@@ -134,25 +134,6 @@ export function path(d: string, props?: PathProps): Path {
134134
return { ...props, type: 'path', d };
135135
}
136136

137-
/**
138-
* A polyline, i.e. a line consisting of multiple segments.
139-
* @deprecated Use `Path` instead.
140-
*/
141-
export type Polyline = {
142-
type: 'polyline';
143-
/**
144-
* The points of the polyline, each point as an object with `x` and `y` coordinates.
145-
*/
146-
points: { x: number; y: number }[];
147-
/**
148-
* Whether to close the path by drawing a line from the last point to the first point.
149-
*/
150-
closePath?: boolean;
151-
} & PolyLineOpts;
152-
153-
/** @deprecated Use `Path` instead of `PolyLine`. */
154-
export type PolyLineOpts = StrokeProps & FillProps & TransformProps;
155-
156137
export type LineCap = 'butt' | 'round' | 'square';
157138
export type LineJoin = 'miter' | 'round' | 'bevel';
158139

0 commit comments

Comments
 (0)