From e4f65766a0b8030879c036c39e8322f00977a453 Mon Sep 17 00:00:00 2001 From: Ralf Sternberg Date: Sun, 15 Feb 2026 16:07:49 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=92=A5=20Remove=20deprecated=20type?= =?UTF-8?q?=20aliases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These deprecated type aliases (`InfoAttrs`, `CustomInfoAttrs`, `LineOpts`, `RectOpts`, `CircleOpts`, `PathOpts`, `BlockAttrs`, `TextAttrs`) were kept for backwards compatibility after renaming to the `*Props` convention. Remove them as part of the ongoing API cleanup for the 0.6 release. Co-Authored-By: Claude Opus 4.6 --- src/api/document.ts | 10 ---------- src/api/graphics.ts | 12 ------------ src/api/layout.ts | 5 ----- src/api/text.ts | 5 ----- 4 files changed, 32 deletions(-) diff --git a/src/api/document.ts b/src/api/document.ts index f01edf8..91fd8af 100644 --- a/src/api/document.ts +++ b/src/api/document.ts @@ -147,11 +147,6 @@ export type EmbeddedFile = { relationship?: FileRelationShip; }; -/** - * @deprecated Use `InfoProps` instead. - */ -export type InfoAttrs = InfoProps; - /** * Standard metadata properties to include in the PDF's *document * information dictionary*. These properties are usually displayed by @@ -195,11 +190,6 @@ export type InfoProps = { producer?: string; }; -/** - * @deprecated Use `CustomInfoProps` instead. - */ -export type CustomInfoAttrs = CustomInfoProps; - /** * Custom metadata properties to include in the PDF's *document * information dictionary*. These properties should be prefixed with diff --git a/src/api/graphics.ts b/src/api/graphics.ts index a6dbed3..d11e66a 100644 --- a/src/api/graphics.ts +++ b/src/api/graphics.ts @@ -27,9 +27,6 @@ export type Line = { export type LineProps = Omit & TransformProps; -/** @deprecated Use `LineProps` instead. */ -export type LineOpts = LineProps; - /** * Creates a line with the given coordinates and properties. * @@ -68,9 +65,6 @@ export type Rect = { export type RectProps = Omit & FillProps & TransformProps; -/** @deprecated Use `RectProps` instead. */ -export type RectOpts = RectProps; - /** * Creates a rectangle with the given coordinates and properties. * @@ -105,9 +99,6 @@ export type Circle = { export type CircleProps = Omit & FillProps & TransformProps; -/** @deprecated Use `CircleProps` instead. */ -export type CircleOpts = CircleProps; - /** * Creates a circle with the given center, radius, and properties. * @@ -133,9 +124,6 @@ export type Path = { export type PathProps = StrokeProps & FillProps & TransformProps; -/** @deprecated Use `PathProps` instead. */ -export type PathOpts = PathProps; - /** * Creates a path with the given path data and properties. * diff --git a/src/api/layout.ts b/src/api/layout.ts index a56428f..996ad37 100644 --- a/src/api/layout.ts +++ b/src/api/layout.ts @@ -134,11 +134,6 @@ export function rows(rows: Block[], props?: Omit): RowsBlock */ export type EmptyBlock = BlockProps; -/** - * @deprecated Use `BlockProps` instead. - */ -export type BlockAttrs = BlockProps; - /** * Properties that can be applied to a block. */ diff --git a/src/api/text.ts b/src/api/text.ts index a97994a..82f0f6c 100644 --- a/src/api/text.ts +++ b/src/api/text.ts @@ -57,11 +57,6 @@ export type FontWeight = number | 'normal' | 'bold'; */ export type FontStyle = 'normal' | 'italic' | 'oblique'; -/** - * @deprecated Use `TextProps` instead. - */ -export type TextAttrs = TextProps; - /** * Text properties that can be applied to a text. */ From 2647ef06f667439a38c47e73cce3bd4806d4cb86 Mon Sep 17 00:00:00 2001 From: Ralf Sternberg Date: Sun, 15 Feb 2026 16:39:46 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=92=A5=20Remove=20deprecated=20bold?= =?UTF-8?q?=20and=20italic=20text=20properties?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `bold` and `italic` properties on `TextProps` were deprecated in favor of `fontWeight: 'bold'` and `fontStyle: 'italic'`. Remove them as part of the ongoing API cleanup for the 0.6 release. Co-Authored-By: Claude Opus 4.6 --- src/api/text.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/api/text.ts b/src/api/text.ts index 82f0f6c..c6eb49d 100644 --- a/src/api/text.ts +++ b/src/api/text.ts @@ -87,18 +87,6 @@ export type TextProps = { */ lineHeight?: number; - /** - * Whether to use a bold variant of the selected font. - * @deprecated Use `fontWeight: 'bold'` instead. - */ - bold?: boolean; - - /** - * Whether to use an italic variant of the selected font. - * @deprecated Use `fontStyle: 'italic'` instead. - */ - italic?: boolean; - /** * The text color. */ From 8a17bbc5b080d8af3d9a2f49cc297dba5c1eb7c0 Mon Sep 17 00:00:00 2001 From: Ralf Sternberg Date: Sun, 15 Feb 2026 16:43:19 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=92=A5=20Remove=20deprecated=20standa?= =?UTF-8?q?lone=20makePdf=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The standalone `makePdf` function was deprecated in favor of creating a `PdfMaker` instance and calling `makePdf` on it. Remove it as part of the ongoing API cleanup for the 0.6 release. Co-Authored-By: Claude Opus 4.6 --- src/api/PdfMaker.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/api/PdfMaker.ts b/src/api/PdfMaker.ts index f7679dc..19c6dab 100644 --- a/src/api/PdfMaker.ts +++ b/src/api/PdfMaker.ts @@ -64,20 +64,3 @@ export class PdfMaker { return await renderDocument(def, pages); } } - -/** - * Generates a PDF from the given document definition. - * - * @param definition The definition of the document to generate. - * @returns The generated PDF document. - * - * @deprecated Create an instance of `PdfMaker` and call `makePdf` on - * that instance. - */ -export async function makePdf(definition: DocumentDefinition): Promise { - console.warn( - 'makePdf is deprecated. Create an instance of `PdfMaker` and call `makePdf` on that instance.', - ); - const pdfMaker = new PdfMaker(); - return await pdfMaker.makePdf(definition); -} From 097f8d477338e0bc33ff6fc88401a45e6899b620 Mon Sep 17 00:00:00 2001 From: Ralf Sternberg Date: Sun, 15 Feb 2026 16:47:49 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=92=A5=20Remove=20deprecated=20Polyli?= =?UTF-8?q?ne=20type=20from=20graphics=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CHANGELOG.md | 13 +++++++++++++ src/api/graphics.ts | 21 +-------------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 370e0e2..29478c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,19 @@ registered with `PdfMaker.registerFont()`. The `FontsDefinition` and `FontDefinition` types have been removed. +- The deprecated standalone `makePdf` function. Use + `new PdfMaker().makePdf()` instead. + +- The deprecated `Polyline` and `PolyLineOpts` types from the graphics + API. Use `Path` instead. + +- The deprecated `bold` and `italic` text properties. Use + `fontWeight: 'bold'` and `fontStyle: 'italic'` instead. + +- The deprecated type aliases `InfoAttrs`, `CustomInfoAttrs`, + `LineOpts`, `RectOpts`, `CircleOpts`, `PathOpts`, `BlockAttrs`, + and `TextAttrs`. Use their `*Props` counterparts instead. + ### Breaking - Text height is now based on the OS/2 typographic metrics diff --git a/src/api/graphics.ts b/src/api/graphics.ts index d11e66a..7368607 100644 --- a/src/api/graphics.ts +++ b/src/api/graphics.ts @@ -1,6 +1,6 @@ import type { Color } from './colors.ts'; -export type Shape = Rect | Circle | Line | Path | Polyline; +export type Shape = Rect | Circle | Line | Path; /** * A straight line. @@ -134,25 +134,6 @@ export function path(d: string, props?: PathProps): Path { return { ...props, type: 'path', d }; } -/** - * A polyline, i.e. a line consisting of multiple segments. - * @deprecated Use `Path` instead. - */ -export type Polyline = { - type: 'polyline'; - /** - * The points of the polyline, each point as an object with `x` and `y` coordinates. - */ - points: { x: number; y: number }[]; - /** - * Whether to close the path by drawing a line from the last point to the first point. - */ - closePath?: boolean; -} & PolyLineOpts; - -/** @deprecated Use `Path` instead of `PolyLine`. */ -export type PolyLineOpts = StrokeProps & FillProps & TransformProps; - export type LineCap = 'butt' | 'round' | 'square'; export type LineJoin = 'miter' | 'round' | 'bevel';