WXL
9 天以前 2895b4ea66e09cb355aeb4e030ca0de297bf8ce3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**
 * Interface for the SpeakingURL options
 * @see {@link https://github.com/pid/speakingurl#usage}
 */
interface speakingurlOptions {
    /**
    * Character that replaces the whitespaces
    *  @default '-'
    */
    separator?: string;
    /**
    * ISO 639-1 Codes for language specific transliteration
    *  @default 'en'
    */
    lang?: string | boolean;
 
    /**
    * Converts symbols according to the 'lang' setting if true. Don't convert symbols if false
    *  @default true
    */
    symbols?: boolean;
 
 
    /**
    * Maintains case chars if true. Convert all chars to lower case if false
    *  @default false
    */
    maintainCase?: boolean;
 
 
    /**
    * converts input string to title-case if true. Omit the words from the array if array is given.
    *  @default false
    */
    titleCase?: boolean | Array<string>;
 
 
    /**
    * Don't trim length if 0. Trim to max length while not breaking any words if greater or equal to 1.
    *  @default 0
    */
    truncate?: number;
 
 
    /**
    *  Allow additional characters if true.
    *  Characters allowed: ";", "?", ":", "@", "&", "=", "+", "\$", ",", "/"
    *  @default false
    */
    uric?: boolean;
 
 
    /**
    *  Allow additional characters if true.
    *  Characters allowed: ";", "?", ":", "@", "&", "=", "+", "\$", ","
    *  @default false
    */
    uricNoSlash?: boolean;
 
 
    /**
    *  Allow additional characters if true.
    *  Characters allowed: "-", "_", ".", "!", "~", "*", "'", "(", ")"
    *  @default false
    */
    mark?: boolean;
 
 
    /**
    *  custom map for translation if object provided. Add array chars to allowed charMap if array provided.
    *  @default {}
    */
    custom?: Object | Array<string>
 
}
 
 
/**
 * Determines slug from given input.
 * @param {string} input string to convert
 * @param {object|string} options configuration object or separator string
 * @return {string} slug
 */
declare function getSlug(input: string, options?: speakingurlOptions | string): string;
 
/**
 * @function createSlug
 * @param {object|string} options configuration object or separator string
 */
declare function createSlug(options?: speakingurlOptions | string): ((input: string) => string);