5a1354bfcd9e1e003845d00f70814a731d2ead9d062cfc297aabad5efef3b2111c277fcac5423393c27ec386e36f642d78c97c610440adda2966f3fddeae05 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. import _ = require("../index");
  2. declare module "../index" {
  3. interface LoDashStatic {
  4. /**
  5. * Converts string to camel case.
  6. *
  7. * @param string The string to convert.
  8. * @return Returns the camel cased string.
  9. */
  10. camelCase(string?: string): string;
  11. }
  12. interface LoDashImplicitWrapper<TValue> {
  13. /**
  14. * @see _.camelCase
  15. */
  16. camelCase(): string;
  17. }
  18. interface LoDashExplicitWrapper<TValue> {
  19. /**
  20. * @see _.camelCase
  21. */
  22. camelCase(): StringChain;
  23. }
  24. interface LoDashStatic {
  25. /**
  26. * Converts the first character of string to upper case and the remaining to lower case.
  27. *
  28. * @param string The string to capitalize.
  29. * @return Returns the capitalized string.
  30. */
  31. capitalize<T extends string>(string?: T): string extends T ? string : Capitalize<Lowercase<T>>;
  32. }
  33. interface LoDashImplicitWrapper<TValue> {
  34. /**
  35. * @see _.capitalize
  36. */
  37. capitalize(): string extends TValue ? string : Capitalize<Lowercase<TValue extends string ? TValue : never>>;
  38. }
  39. interface LoDashExplicitWrapper<TValue> {
  40. /**
  41. * @see _.capitalize
  42. */
  43. capitalize(): StringChain<string extends TValue ? string : Capitalize<Lowercase<TValue extends string ? TValue : never>>>;
  44. }
  45. interface LoDashStatic {
  46. /**
  47. * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining
  48. * diacritical marks.
  49. *
  50. * @param string The string to deburr.
  51. * @return Returns the deburred string.
  52. */
  53. deburr(string?: string): string;
  54. }
  55. interface LoDashImplicitWrapper<TValue> {
  56. /**
  57. * @see _.deburr
  58. */
  59. deburr(): string;
  60. }
  61. interface LoDashExplicitWrapper<TValue> {
  62. /**
  63. * @see _.deburr
  64. */
  65. deburr(): StringChain;
  66. }
  67. interface LoDashStatic {
  68. /**
  69. * Checks if string ends with the given target string.
  70. *
  71. * @param string The string to search.
  72. * @param target The string to search for.
  73. * @param position The position to search from.
  74. * @return Returns true if string ends with target, else false.
  75. */
  76. endsWith(string?: string, target?: string, position?: number): boolean;
  77. }
  78. interface LoDashImplicitWrapper<TValue> {
  79. /**
  80. * @see _.endsWith
  81. */
  82. endsWith(target?: string, position?: number): boolean;
  83. }
  84. interface LoDashExplicitWrapper<TValue> {
  85. /**
  86. * @see _.endsWith
  87. */
  88. endsWith(target?: string, position?: number): PrimitiveChain<boolean>;
  89. }
  90. interface LoDashStatic {
  91. /**
  92. * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities.
  93. *
  94. * Note: No other characters are escaped. To escape additional characters use a third-party library like he.
  95. *
  96. * Though the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML
  97. * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s
  98. * article (under "semi-related fun fact") for more details.
  99. *
  100. * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59,
  101. * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details.
  102. *
  103. * When working with HTML you should always quote attribute values to reduce XSS vectors.
  104. *
  105. * @param string The string to escape.
  106. * @return Returns the escaped string.
  107. */
  108. escape(string?: string): string;
  109. }
  110. interface LoDashImplicitWrapper<TValue> {
  111. /**
  112. * @see _.escape
  113. */
  114. escape(): string;
  115. }
  116. interface LoDashExplicitWrapper<TValue> {
  117. /**
  118. * @see _.escape
  119. */
  120. escape(): StringChain;
  121. }
  122. interface LoDashStatic {
  123. /**
  124. * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]",
  125. * "{", "}", and "|" in string.
  126. *
  127. * @param string The string to escape.
  128. * @return Returns the escaped string.
  129. */
  130. escapeRegExp(string?: string): string;
  131. }
  132. interface LoDashImplicitWrapper<TValue> {
  133. /**
  134. * @see _.escapeRegExp
  135. */
  136. escapeRegExp(): string;
  137. }
  138. interface LoDashExplicitWrapper<TValue> {
  139. /**
  140. * @see _.escapeRegExp
  141. */
  142. escapeRegExp(): StringChain;
  143. }
  144. interface LoDashStatic {
  145. /**
  146. * Converts string to kebab case.
  147. *
  148. * @param string The string to convert.
  149. * @return Returns the kebab cased string.
  150. */
  151. kebabCase(string?: string): string;
  152. }
  153. interface LoDashImplicitWrapper<TValue> {
  154. /**
  155. * @see _.kebabCase
  156. */
  157. kebabCase(): string;
  158. }
  159. interface LoDashExplicitWrapper<TValue> {
  160. /**
  161. * @see _.kebabCase
  162. */
  163. kebabCase(): StringChain;
  164. }
  165. interface LoDashStatic {
  166. /**
  167. * Converts `string`, as space separated words, to lower case.
  168. *
  169. * @param string The string to convert.
  170. * @return Returns the lower cased string.
  171. */
  172. lowerCase(string?: string): string;
  173. }
  174. interface LoDashImplicitWrapper<TValue> {
  175. /**
  176. * @see _.lowerCase
  177. */
  178. lowerCase(): string;
  179. }
  180. interface LoDashExplicitWrapper<TValue> {
  181. /**
  182. * @see _.lowerCase
  183. */
  184. lowerCase(): StringChain;
  185. }
  186. interface LoDashStatic {
  187. /**
  188. * Converts the first character of `string` to lower case.
  189. *
  190. * @param string The string to convert.
  191. * @return Returns the converted string.
  192. */
  193. lowerFirst<T extends string = string>(string?: T): Uncapitalize<T>;
  194. }
  195. interface LoDashImplicitWrapper<TValue> {
  196. /**
  197. * @see _.lowerFirst
  198. */
  199. lowerFirst(): TValue extends string ? Uncapitalize<TValue> : string;
  200. }
  201. interface LoDashExplicitWrapper<TValue> {
  202. /**
  203. * @see _.lowerFirst
  204. */
  205. lowerFirst(): StringChain<TValue extends string ? Uncapitalize<TValue> : string>;
  206. }
  207. interface LoDashStatic {
  208. /**
  209. * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if
  210. * they can’t be evenly divided by length.
  211. *
  212. * @param string The string to pad.
  213. * @param length The padding length.
  214. * @param chars The string used as padding.
  215. * @return Returns the padded string.
  216. */
  217. pad(string?: string, length?: number, chars?: string): string;
  218. }
  219. interface LoDashImplicitWrapper<TValue> {
  220. /**
  221. * @see _.pad
  222. */
  223. pad(length?: number, chars?: string): string;
  224. }
  225. interface LoDashExplicitWrapper<TValue> {
  226. /**
  227. * @see _.pad
  228. */
  229. pad(length?: number, chars?: string): StringChain;
  230. }
  231. interface LoDashStatic {
  232. /**
  233. * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed
  234. * length.
  235. *
  236. * @param string The string to pad.
  237. * @param length The padding length.
  238. * @param chars The string used as padding.
  239. * @return Returns the padded string.
  240. */
  241. padEnd(string?: string, length?: number, chars?: string): string;
  242. }
  243. interface LoDashImplicitWrapper<TValue> {
  244. /**
  245. * @see _.padEnd
  246. */
  247. padEnd(length?: number, chars?: string): string;
  248. }
  249. interface LoDashExplicitWrapper<TValue> {
  250. /**
  251. * @see _.padEnd
  252. */
  253. padEnd(length?: number, chars?: string): StringChain;
  254. }
  255. interface LoDashStatic {
  256. /**
  257. * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed
  258. * length.
  259. *
  260. * @param string The string to pad.
  261. * @param length The padding length.
  262. * @param chars The string used as padding.
  263. * @return Returns the padded string.
  264. */
  265. padStart(string?: string, length?: number, chars?: string): string;
  266. }
  267. interface LoDashImplicitWrapper<TValue> {
  268. /**
  269. * @see _.padStart
  270. */
  271. padStart(length?: number, chars?: string): string;
  272. }
  273. interface LoDashExplicitWrapper<TValue> {
  274. /**
  275. * @see _.padStart
  276. */
  277. padStart(length?: number, chars?: string): StringChain;
  278. }
  279. interface LoDashStatic {
  280. /**
  281. * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used
  282. * unless value is a hexadecimal, in which case a radix of 16 is used.
  283. *
  284. * Note: This method aligns with the ES5 implementation of parseInt.
  285. *
  286. * @param string The string to convert.
  287. * @param radix The radix to interpret value by.
  288. * @return Returns the converted integer.
  289. */
  290. parseInt(string: string, radix?: number): number;
  291. }
  292. interface LoDashImplicitWrapper<TValue> {
  293. /**
  294. * @see _.parseInt
  295. */
  296. parseInt(radix?: number): number;
  297. }
  298. interface LoDashExplicitWrapper<TValue> {
  299. /**
  300. * @see _.parseInt
  301. */
  302. parseInt(radix?: number): PrimitiveChain<number>;
  303. }
  304. interface LoDashStatic {
  305. /**
  306. * Repeats the given string n times.
  307. *
  308. * @param string The string to repeat.
  309. * @param n The number of times to repeat the string.
  310. * @return Returns the repeated string.
  311. */
  312. repeat(string?: string, n?: number): string;
  313. }
  314. interface LoDashImplicitWrapper<TValue> {
  315. /**
  316. * @see _.repeat
  317. */
  318. repeat(n?: number): string;
  319. }
  320. interface LoDashExplicitWrapper<TValue> {
  321. /**
  322. * @see _.repeat
  323. */
  324. repeat(n?: number): StringChain;
  325. }
  326. type ReplaceFunction = (match: string, ...args: any[]) => string;
  327. interface LoDashStatic {
  328. /**
  329. * Replaces matches for pattern in string with replacement.
  330. *
  331. * Note: This method is based on String#replace.
  332. *
  333. * @return Returns the modified string.
  334. */
  335. replace(string: string, pattern: RegExp | string, replacement: ReplaceFunction | string): string;
  336. /**
  337. * @see _.replace
  338. */
  339. replace(pattern: RegExp | string, replacement: ReplaceFunction | string): string;
  340. }
  341. interface LoDashImplicitWrapper<TValue> {
  342. /**
  343. * @see _.replace
  344. */
  345. replace(pattern: RegExp | string, replacement: ReplaceFunction | string): string;
  346. /**
  347. * @see _.replace
  348. */
  349. replace(replacement: ReplaceFunction | string): string;
  350. }
  351. interface LoDashExplicitWrapper<TValue> {
  352. /**
  353. * @see _.replace
  354. */
  355. replace(pattern: RegExp | string, replacement: ReplaceFunction | string): StringChain;
  356. /**
  357. * @see _.replace
  358. */
  359. replace(replacement: ReplaceFunction | string): StringChain;
  360. }
  361. interface LoDashStatic {
  362. /**
  363. * Converts string to snake case.
  364. *
  365. * @param string The string to convert.
  366. * @return Returns the snake cased string.
  367. */
  368. snakeCase(string?: string): string;
  369. }
  370. interface LoDashImplicitWrapper<TValue> {
  371. /**
  372. * @see _.snakeCase
  373. */
  374. snakeCase(): string;
  375. }
  376. interface LoDashExplicitWrapper<TValue> {
  377. /**
  378. * @see _.snakeCase
  379. */
  380. snakeCase(): StringChain;
  381. }
  382. interface LoDashStatic {
  383. /**
  384. * Splits string by separator.
  385. *
  386. * Note: This method is based on String#split.
  387. *
  388. * @param string The string to split.
  389. * @param separator The separator pattern to split by.
  390. * @param limit The length to truncate results to.
  391. * @return Returns the new array of string segments.
  392. */
  393. split(string: string | null | undefined, separator?: RegExp | string, limit?: number): string[];
  394. /**
  395. * @see _.split
  396. */
  397. split(string: string | null | undefined, index: string | number, guard: object): string[];
  398. }
  399. interface LoDashImplicitWrapper<TValue> {
  400. /**
  401. * @see _.split
  402. */
  403. split(separator?: RegExp | string, limit?: number): Collection<string>;
  404. }
  405. interface LoDashExplicitWrapper<TValue> {
  406. /**
  407. * @see _.split
  408. */
  409. split(separator?: RegExp | string, limit?: number): CollectionChain<string>;
  410. }
  411. interface LoDashStatic {
  412. /**
  413. * Converts string to start case.
  414. *
  415. * @param string The string to convert.
  416. * @return Returns the start cased string.
  417. */
  418. startCase(string?: string): string;
  419. }
  420. interface LoDashImplicitWrapper<TValue> {
  421. /**
  422. * @see _.startCase
  423. */
  424. startCase(): string;
  425. }
  426. interface LoDashExplicitWrapper<TValue> {
  427. /**
  428. * @see _.startCase
  429. */
  430. startCase(): StringChain;
  431. }
  432. interface LoDashStatic {
  433. /**
  434. * Checks if string starts with the given target string.
  435. *
  436. * @param string The string to search.
  437. * @param target The string to search for.
  438. * @param position The position to search from.
  439. * @return Returns true if string starts with target, else false.
  440. */
  441. startsWith(string?: string, target?: string, position?: number): boolean;
  442. }
  443. interface LoDashImplicitWrapper<TValue> {
  444. /**
  445. * @see _.startsWith
  446. */
  447. startsWith(target?: string, position?: number): boolean;
  448. }
  449. interface LoDashExplicitWrapper<TValue> {
  450. /**
  451. * @see _.startsWith
  452. */
  453. startsWith(target?: string, position?: number): PrimitiveChain<boolean>;
  454. }
  455. interface TemplateOptions extends TemplateSettings {
  456. /**
  457. * @see _.sourceURL
  458. */
  459. sourceURL?: string | undefined;
  460. }
  461. interface TemplateExecutor {
  462. (data?: object): string;
  463. /**
  464. * @see _.source
  465. */
  466. source: string;
  467. }
  468. interface LoDashStatic {
  469. /**
  470. * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters,
  471. * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate"
  472. * delimiters. Data properties may be accessed as free variables in the template. If a setting object is
  473. * provided it takes precedence over _.templateSettings values.
  474. *
  475. * Note: In the development build _.template utilizes
  476. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier
  477. * debugging.
  478. *
  479. * For more information on precompiling templates see
  480. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  481. *
  482. * For more information on Chrome extension sandboxes see
  483. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  484. *
  485. * @param string The template string.
  486. * @param options The options object.
  487. * @param options.escape The HTML "escape" delimiter.
  488. * @param options.evaluate The "evaluate" delimiter.
  489. * @param options.imports An object to import into the template as free variables.
  490. * @param options.interpolate The "interpolate" delimiter.
  491. * @param options.sourceURL The sourceURL of the template's compiled source.
  492. * @param options.variable The data object variable name.
  493. * @return Returns the compiled template function.
  494. */
  495. template(string?: string, options?: TemplateOptions): TemplateExecutor;
  496. }
  497. interface LoDashImplicitWrapper<TValue> {
  498. /**
  499. * @see _.template
  500. */
  501. template(options?: TemplateOptions): TemplateExecutor;
  502. }
  503. interface LoDashExplicitWrapper<TValue> {
  504. /**
  505. * @see _.template
  506. */
  507. template(options?: TemplateOptions): FunctionChain<TemplateExecutor>;
  508. }
  509. interface LoDashStatic {
  510. /**
  511. * Converts `string`, as a whole, to lower case.
  512. *
  513. * @param string The string to convert.
  514. * @return Returns the lower cased string.
  515. */
  516. toLower<T extends string = string>(string?: T): Lowercase<T>;
  517. }
  518. interface LoDashImplicitWrapper<TValue> {
  519. /**
  520. * @see _.toLower
  521. */
  522. toLower(): TValue extends string ? Lowercase<TValue> : string;
  523. }
  524. interface LoDashExplicitWrapper<TValue> {
  525. /**
  526. * @see _.toLower
  527. */
  528. toLower(): StringChain<TValue extends string ? Lowercase<TValue> : string>;
  529. }
  530. interface LoDashStatic {
  531. /**
  532. * Converts `string`, as a whole, to upper case.
  533. *
  534. * @param string The string to convert.
  535. * @return Returns the upper cased string.
  536. */
  537. toUpper<T extends string = string>(string?: T): Uppercase<T>;
  538. }
  539. interface LoDashImplicitWrapper<TValue> {
  540. /**
  541. * @see _.toUpper
  542. */
  543. toUpper(): TValue extends string ? Uppercase<TValue> : string;
  544. }
  545. interface LoDashExplicitWrapper<TValue> {
  546. /**
  547. * @see _.toUpper
  548. */
  549. toUpper(): StringChain<TValue extends string ? Uppercase<TValue> : string>;
  550. }
  551. interface LoDashStatic {
  552. /**
  553. * Removes leading and trailing whitespace or specified characters from string.
  554. *
  555. * @param string The string to trim.
  556. * @param chars The characters to trim.
  557. * @return Returns the trimmed string.
  558. */
  559. trim(string?: string, chars?: string): string;
  560. /**
  561. * @see _.trim
  562. */
  563. trim(string: string, index: string | number, guard: object): string;
  564. }
  565. interface LoDashImplicitWrapper<TValue> {
  566. /**
  567. * @see _.trim
  568. */
  569. trim(chars?: string): string;
  570. }
  571. interface LoDashExplicitWrapper<TValue> {
  572. /**
  573. * @see _.trim
  574. */
  575. trim(chars?: string): StringChain;
  576. }
  577. interface LoDashStatic {
  578. /**
  579. * Removes trailing whitespace or specified characters from string.
  580. *
  581. * @param string The string to trim.
  582. * @param chars The characters to trim.
  583. * @return Returns the trimmed string.
  584. */
  585. trimEnd(string?: string, chars?: string): string;
  586. /**
  587. * @see _.trimEnd
  588. */
  589. trimEnd(string: string, index: string | number, guard: object): string;
  590. }
  591. interface LoDashImplicitWrapper<TValue> {
  592. /**
  593. * @see _.trimEnd
  594. */
  595. trimEnd(chars?: string): string;
  596. }
  597. interface LoDashExplicitWrapper<TValue> {
  598. /**
  599. * @see _.trimEnd
  600. */
  601. trimEnd(chars?: string): StringChain;
  602. }
  603. interface LoDashStatic {
  604. /**
  605. * Removes leading whitespace or specified characters from string.
  606. *
  607. * @param string The string to trim.
  608. * @param chars The characters to trim.
  609. * @return Returns the trimmed string.
  610. */
  611. trimStart(string?: string, chars?: string): string;
  612. /**
  613. * @see _.trimStart
  614. */
  615. trimStart(string: string, index: string | number, guard: object): string;
  616. }
  617. interface LoDashImplicitWrapper<TValue> {
  618. /**
  619. * @see _.trimStart
  620. */
  621. trimStart(chars?: string): string;
  622. }
  623. interface LoDashExplicitWrapper<TValue> {
  624. /**
  625. * @see _.trimStart
  626. */
  627. trimStart(chars?: string): StringChain;
  628. }
  629. interface TruncateOptions {
  630. /**
  631. * @see _.length
  632. */
  633. length?: number | undefined;
  634. /**
  635. * @see _.omission
  636. */
  637. omission?: string | undefined;
  638. /**
  639. * @see _.separator
  640. */
  641. separator?: string | RegExp | undefined;
  642. }
  643. interface LoDashStatic {
  644. /**
  645. * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated
  646. * string are replaced with the omission string which defaults to "…".
  647. *
  648. * @param string The string to truncate.
  649. * @param options The options object or maximum string length.
  650. * @return Returns the truncated string.
  651. */
  652. truncate(string?: string, options?: TruncateOptions): string;
  653. }
  654. interface LoDashImplicitWrapper<TValue> {
  655. /**
  656. * @see _.truncate
  657. */
  658. truncate(options?: TruncateOptions): string;
  659. }
  660. interface LoDashExplicitWrapper<TValue> {
  661. /**
  662. * @see _.truncate
  663. */
  664. truncate(options?: TruncateOptions): StringChain;
  665. }
  666. interface LoDashStatic {
  667. /**
  668. * The inverse of _.escape; this method converts the HTML entities &amp;, &lt;, &gt;, &quot;, &#39;, and &#96;
  669. * in string to their corresponding characters.
  670. *
  671. * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library
  672. * like he.
  673. *
  674. * @param string The string to unescape.
  675. * @return Returns the unescaped string.
  676. */
  677. unescape(string?: string): string;
  678. }
  679. interface LoDashImplicitWrapper<TValue> {
  680. /**
  681. * @see _.unescape
  682. */
  683. unescape(): string;
  684. }
  685. interface LoDashExplicitWrapper<TValue> {
  686. /**
  687. * @see _.unescape
  688. */
  689. unescape(): StringChain;
  690. }
  691. interface LoDashStatic {
  692. /**
  693. * Converts `string`, as space separated words, to upper case.
  694. *
  695. * @param string The string to convert.
  696. * @return Returns the upper cased string.
  697. */
  698. upperCase(string?: string): string;
  699. }
  700. interface LoDashImplicitWrapper<TValue> {
  701. /**
  702. * @see _.upperCase
  703. */
  704. upperCase(): string;
  705. }
  706. interface LoDashExplicitWrapper<TValue> {
  707. /**
  708. * @see _.upperCase
  709. */
  710. upperCase(): StringChain;
  711. }
  712. interface LoDashStatic {
  713. /**
  714. * Converts the first character of `string` to upper case.
  715. *
  716. * @param string The string to convert.
  717. * @return Returns the converted string.
  718. */
  719. upperFirst<T extends string = string>(string?: T): Capitalize<T>;
  720. }
  721. interface LoDashImplicitWrapper<TValue> {
  722. /**
  723. * @see _.upperFirst
  724. */
  725. upperFirst(): TValue extends string ? Capitalize<TValue> : string;
  726. }
  727. interface LoDashExplicitWrapper<TValue> {
  728. /**
  729. * @see _.upperFirst
  730. */
  731. upperFirst(): StringChain<TValue extends string ? Capitalize<TValue> : string>;
  732. }
  733. interface LoDashStatic {
  734. /**
  735. * Splits `string` into an array of its words.
  736. *
  737. * @param string The string to inspect.
  738. * @param pattern The pattern to match words.
  739. * @return Returns the words of `string`.
  740. */
  741. words(string?: string, pattern?: string | RegExp): string[];
  742. /**
  743. * @see _.words
  744. */
  745. words(string: string, index: string | number, guard: object): string[];
  746. }
  747. interface LoDashImplicitWrapper<TValue> {
  748. /**
  749. * @see _.words
  750. */
  751. words(pattern?: string | RegExp): Collection<string>;
  752. }
  753. interface LoDashExplicitWrapper<TValue> {
  754. /**
  755. * @see _.words
  756. */
  757. words(pattern?: string | RegExp): CollectionChain<string>;
  758. }
  759. }