DefinitelyTyped/types/uslug/index.d.ts
Junyoung Choi 5afa9902c6 Add uslug (#34054)
* Add uslug type definitions

* Fix header of uslug
2019-03-29 20:27:46 -07:00

25 lines
803 B
TypeScript

// Type definitions for uslug 1.0
// Project: https://github.com/jeremys/uslug
// Definitions by: Junyoung Choi <https://github.com/rokt33r>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Generate a slug for the string passed.
* @param value The string you want to slugify
* @param options An optional object that can contain:
* - allowedChars: a String of chars that you want to be whitelisted. Default: '-_~'.
* - lower: a Boolean to force to lower case the slug. Default: true.
* - spaces: a Boolean to allow spaces. Default: false.
*/
declare function uslug(value: string, options?: uslug.UslugOptions): string;
declare namespace uslug {
interface UslugOptions {
allowedChars?: string;
lower?: boolean;
spaces?: boolean;
}
}
export = uslug;