From 7f02ded579785858d53d430868f5b732d478ed33 Mon Sep 17 00:00:00 2001 From: Hugues Tavernier Date: Wed, 18 Mar 2026 22:24:21 +0100 Subject: [PATCH 1/2] add typing for addIconParts --- index.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.d.ts b/index.d.ts index 1d1d781..074ba7c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -286,6 +286,7 @@ type DrawText = { stroke: string | false; strokedasharray?: string; strokewidth?: number; + text: string; }; type DrawSVG = { @@ -334,6 +335,15 @@ export type ExtensionFunction = ( export function addSymbolPart(extension: ExtensionFunction): typeof _default; +export type IconPartsFunction = ( + this: Symbol, + iconParts: Record, + metadata: SymbolMetadata, + colors: SymbolColors +) => void; + +export function addIconParts(iconParts: IconPartsFunction); + declare const _default: { Symbol: typeof Symbol; BBox: BBoxConstructor; @@ -347,6 +357,7 @@ declare const _default: { getVersion: typeof getVersion; setStandard: typeof setStandard; addSymbolPart: typeof addSymbolPart; + addIconParts: typeof addIconParts; }; export default _default; From b76e783d9e34b6da48a7c28f663fef5966dc594c Mon Sep 17 00:00:00 2001 From: Hugues Tavernier Date: Thu, 19 Mar 2026 08:13:26 +0100 Subject: [PATCH 2/2] fix return type of addIconParts --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 074ba7c..ddad65c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -342,7 +342,7 @@ export type IconPartsFunction = ( colors: SymbolColors ) => void; -export function addIconParts(iconParts: IconPartsFunction); +export function addIconParts(iconParts: IconPartsFunction): typeof _default; declare const _default: { Symbol: typeof Symbol;