Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 32 additions & 12 deletions slugify.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
declare module slugify {
type ExtendArgs = {
[key: string]: any;
}
};

export function extend (args: ExtendArgs): void;
export function extend(args: ExtendArgs): void;
}

/**
* @param string
* @param replacement replace spaces with replacement character, defaults to `-`
*/
declare function slugify(string: string, replacement?: string): string;
declare function slugify(
string: string,
options?:
| {
replacement?: string;
remove?: RegExp;
lower?: boolean;
strict?: boolean;
locale?: string;
}
| string,

options?: {
/**
* replace spaces with replacement character
* @default '-'
*/
replacement?: string;
/**
* remove characters that match regex
*/
remove?: RegExp;
/**
* convert to lower case
* @default false
*/
lower?: boolean;
/**
* strip special characters except replacement
* @default false
*/
strict?: boolean;
/**
* language code of the locale to use
*/
locale?: string;
}
): string;

export default slugify;