From 0cd4b658d6934f3a66d75164718f79d26ec1fb31 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Sat, 31 Aug 2024 16:24:26 -0700 Subject: [PATCH] Change TS typings to expose slugify.extend The current typings make `slugify.extend` inaccessible since the default export is just the function, and not the module. This version exports a value which is both callable (the function) and has an `extend` property. --- slugify.d.ts | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/slugify.d.ts b/slugify.d.ts index e20f795..b74c5b7 100644 --- a/slugify.d.ts +++ b/slugify.d.ts @@ -1,24 +1,19 @@ -declare module slugify { - type ExtendArgs = { - [key: string]: any; - } +declare const slugify: { + ( + string: string, + options?: + | { + replacement?: string; + remove?: RegExp; + lower?: boolean; + strict?: boolean; + locale?: string; + trim?: boolean; + } + | string, - export function extend (args: ExtendArgs): void; -} - -declare function slugify( - string: string, - options?: - | { - replacement?: string; - remove?: RegExp; - lower?: boolean; - strict?: boolean; - locale?: string; - trim?: boolean; - } - | string, - -): string; + ): string; + extend: (args: Record) => void; +}; export default slugify;