From def6caad6e359b5cbacfb17c1eaf806f2adedd64 Mon Sep 17 00:00:00 2001 From: Joakim Carlstein Date: Thu, 14 Dec 2023 11:09:03 +0100 Subject: [PATCH] fix: use function overload to make the tagged template have the correct type Without this TypeScript complains when using the tagged template literal with the error: "error TS2554: Expected 1 arguments, but got 2" --- src/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.d.ts b/src/index.d.ts index 144d304..4b4d892 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -6,7 +6,8 @@ interface Ansis { * * @param {string | TemplateStringsArray} string */ - (string: string | TemplateStringsArray): string; + (string: string): string; + (string: TemplateStringsArray, ...parameters: string[]): string; /** * Set [256-color ANSI code](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) for foreground color.