'How to handle TemplateStringsArray in Typescript?

I have trouble getting around with "TemplateStringsArray" in Typescript declare function foo (type: "buffer"): Buffer This function doesn't work with foobuffer, which is supported in the script How can I handle declaration with TemplateStringsArray? Thanks

(Type: "buffer"): buffer; -Only work with strings (Type: TemplateStringsArray<"buffer">): buffer; -Not working



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source