UNPKG

10.6 kBTypeScriptView Raw
1declare class NativeString {
2 protected _value: string;
3 constructor(value: string);
4 /**
5 * Returns the character at the specified index.
6 *
7 * @param {number} pos The zero-based index of the desired character.
8 */
9 charAt(pos: number): this;
10 /**
11 * Returns the Unicode value of the character at the specified location.
12 *
13 * @param {number} index The zero-based index of the desired character. If there
14 * is no character at the specified index, NaN is returned.
15 */
16 charCodeAt(index: number): number;
17 /**
18 * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the
19 * code point value of the UTF-16 encoded code point starting at the string
20 * element at position pos in the String resulting from converting this object to
21 * a String. If there is no element at that position, the result is undefined. If
22 * a valid UTF-16 surrogate pair does not begin at pos, the result is the code
23 * unit at pos.
24 *
25 * @param {number} pos
26 */
27 codePointAt(pos: number): number | undefined;
28 /**
29 * Returns a string that contains the concatenation of two or more strings.
30 *
31 * @param {string[]} strings The strings to append to the end of the string.
32 */
33 concat(...strings: any[]): this;
34 /**
35 * Returns true if the sequence of elements of searchString converted to a String
36 * is the same as the corresponding elements of this object (converted to a
37 * String) starting at endPosition – length(this). Otherwise returns false.
38 *
39 * @param {string} searchString
40 * @param {number} [endPosition]
41 */
42 endsWith(searchString: string, endPosition: number | undefined): boolean;
43 /**
44 * Returns true if searchString appears as a substring of the result of converting
45 * this object to a String, at one or more positions that are greater than or
46 * equal to position; otherwise, returns false.
47 *
48 * @param {string} searchString Search string
49 * @param {number} [position] If position is undefined, 0 is assumed, so as to
50 * search all of the String.
51 */
52 includes(searchString: string, position: number | undefined): boolean;
53 /**
54 * Returns the position of the first occurrence of a substring.
55 *
56 * @param {string} searchString The substring to search for in the string
57 * @param {number} [position] The index at which to begin searching the String
58 * object. If omitted, search starts at the beginning of the string.
59 */
60 indexOf(searchString: string, position: number | undefined): number;
61 /**
62 * Returns the last occurrence of a substring in the string.
63 *
64 * @param {string} searchString The substring to search for.
65 * @param {number} [position] The index at which to begin searching. If omitted,
66 * the search begins at the end of the string.
67 */
68 lastIndexOf(searchString: string, position: number | undefined): number;
69 /** Returns the length of a String object. */
70 get length(): number;
71 /**
72 * Determines whether two strings are equivalent in the current locale.
73 *
74 * @param {string} value String to compare to target string
75 * @returns {number}
76 */
77 localeCompare(value: string): number;
78 /**
79 * Matches a string an object that supports being matched against, and returns an
80 * array containing the results of that search.
81 *
82 * @param {{ [Symbol.match](string: string): RegExpMatchArray | null }} matcher An
83 * object that supports being matched against.
84 * @returns {RegExpMatchArray | null}
85 */
86 match(matcher: {
87 [Symbol.match](string: string): RegExpMatchArray | null;
88 }): RegExpMatchArray | null;
89 /**
90 * Returns the String value result of normalizing the string into the
91 * normalization form named by form as specified in Unicode Standard Annex #15,
92 * Unicode Normalization Forms.
93 *
94 * @param {"NFC" | "NFD" | "NFKC" | "NFKD"} form Applicable values: "NFC", "NFD",
95 * "NFKC", or "NFKD", If not specified default is "NFC"
96 */
97 normalize(form: string): this;
98 /**
99 * Pads the current string with a given string (possibly repeated) so that the
100 * resulting string reaches a given length. The padding is applied from the end
101 * (right) of the current string.
102 *
103 * @param {number} maxLength The length of the resulting string once the current
104 * string has been padded. If this parameter is smaller than the current
105 * string's length, the current string will be returned as it is.
106 * @param {string} [fillString] The string to pad the current string with. If this
107 * string is too long, it will be truncated and the left-most part will be
108 * applied. The default value for this parameter is " " (U+0020).
109 */
110 padEnd(maxLength: number, fillString: string | undefined): this;
111 /**
112 * Pads the current string with a given string (possibly repeated) so that the
113 * resulting string reaches a given length. The padding is applied from the start
114 * (left) of the current string.
115 *
116 * @param {number} maxLength The length of the resulting string once the current
117 * string has been padded. If this parameter is smaller than the current
118 * string's length, the current string will be returned as it is.
119 * @param {string} [fillString] The string to pad the current string with. If this
120 * string is too long, it will be truncated and the left-most part will be
121 * applied. The default value for this parameter is " " (U+0020).
122 */
123 padStart(maxLength: number, fillString: string | undefined): this;
124 /**
125 * Returns a String value that is made from count copies appended together. If
126 * count is 0, the empty string is returned.
127 *
128 * @param {number} count Number of copies to append
129 */
130 repeat(count: number): this;
131 /**
132 * Replaces text in a string, using a regular expression or search string.
133 *
134 * @param {string | RegExp} searchValue A string to search for.
135 * @param {string} replaceValue A string containing the text to replace for every
136 * successful match of searchValue in this string.
137 */
138 replace(searchValue: {
139 [Symbol.replace](string: string, replaceValue: string): string;
140 }, replaceValue: string): this;
141 /**
142 * Finds the first substring match in a regular expression search.
143 *
144 * @param {string | RegExp} regexp The regular expression pattern and applicable
145 * flags.
146 * @returns {number}
147 */
148 search(regexp: {
149 [Symbol.search](string: string): number;
150 }): number;
151 /**
152 * Returns a section of a string.
153 *
154 * @param {number} [start] The index to the beginning of the specified portion of
155 * stringObj.
156 * @param {number} [end] The index to the end of the specified portion of
157 * stringObj. The substring includes the characters up to, but not including,
158 * the character indicated by end. If this value is not specified, the
159 * substring continues to the end of stringObj.
160 */
161 slice(start: number | undefined, end: number | undefined): this;
162 /**
163 * Split a string into substrings using the specified separator and return them as
164 * an array.
165 *
166 * @param {string | RegExp} separator A string that identifies character or
167 * characters to use in separating the string. If omitted, a single-element
168 * array containing the entire string is returned.
169 * @param {number} [limit] A value used to limit the number of elements returned
170 * in the array.
171 * @returns {string[]}
172 */
173 split(separator: {
174 [Symbol.split](string: string, limit?: number | undefined): string[];
175 }, limit: number | undefined): string[];
176 /**
177 * Gets a substring beginning at the specified location and having the specified
178 * length.
179 *
180 * @param {number} from The starting position of the desired substring. The index
181 * of the first character in the string is zero.
182 * @param {number} [length] The number of characters to include in the returned
183 * substring.
184 */
185 substr(from: number, length: number | undefined): this;
186 /**
187 * Returns the substring at the specified location within a String object.
188 *
189 * @param {number} start The zero-based index number indicating the beginning of
190 * the substring.
191 * @param {number} [end] Zero-based index number indicating the end of the
192 * substring. The substring includes the characters up to, but not including,
193 * the character indicated by end. If end is omitted, the characters from
194 * start through the end of the original string are returned.
195 */
196 substring(start: number, end: number | undefined): this;
197 /**
198 * Returns true if the sequence of elements of searchString converted to a String
199 * is the same as the corresponding elements of this object (converted to a
200 * String) starting at position. Otherwise returns false.
201 *
202 * @param {string} searchString
203 * @param {number} [position]
204 * @returns {boolean}
205 */
206 startsWith(searchString: string, position: number | undefined): boolean;
207 /** Converts all the alphabetic characters in a string to lowercase. */
208 toLowerCase(): this;
209 /**
210 * Converts all alphabetic characters to lowercase, taking into account the host
211 * environment's current locale.
212 */
213 toLocaleLowerCase(): this;
214 /** Converts all the alphabetic characters in a string to uppercase. */
215 toUpperCase(): this;
216 /**
217 * Returns a string where all alphabetic characters have been converted to
218 * uppercase, taking into account the host environment's current locale.
219 */
220 toLocaleUpperCase(): this;
221 /**
222 * Returns a string representation of a StarkStringType & NativeString Object
223 *
224 * @returns {string}
225 */
226 toString(): string;
227 /**
228 * Removes the leading and trailing white space and line terminator characters
229 * from a string.
230 */
231 trim(): this;
232 /** Removes whitespace from the left end of a string. */
233 trimLeft(): this;
234 /** Removes whitespace from the right end of a string. */
235 trimRight(): this;
236 /** Returns the primitive value of the specified object. */
237 valueOf(): string;
238}
239export default NativeString;
240//# sourceMappingURL=NativeString.d.ts.map
\No newline at end of file