@grey-ts/types 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +31 -3
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1540,12 +1540,23 @@ interface String {
1540
1540
  * In case the string is not numeric it will return the original string.
1541
1541
  */
1542
1542
  toInt(): string | number;
1543
- /** Removes the leading and trailing white space and line terminator characters from a string. */
1543
+ /** Removes the leading and trailing white space characters from a string. */
1544
1544
  trim(): string;
1545
1545
  /** Returns a number which is parsed from the string. In case the string is not numeric it will return a zero. */
1546
1546
  val(): number;
1547
1547
  /** Returns an array where each item is a string representing all available characters in the string. Could be compared to using {@link String.split|split} but with empty separator. */
1548
1548
  values(): string[];
1549
+ /** Removes the leading white space characters from a string. */
1550
+ trimStart(): string;
1551
+ /** Removes the trailing white space characters from a string. */
1552
+ trimEnd(): string;
1553
+ /**
1554
+ * Returns true if searchString appears as a substring of this string, at one or more positions that are greater than or equal to position; otherwise, returns false.
1555
+ *
1556
+ * @param searchString search string
1557
+ * @param position If position is undefined, 0 is assumed, so as to search all of the string.
1558
+ */
1559
+ includes(searchString: string, position?: number): boolean;
1549
1560
  /** Returns true if this string starts with the searchString. Otherwise returns false. */
1550
1561
  startsWith(searchString: string, position?: number): boolean;
1551
1562
  /** Returns true if this string ends with the searchString. Otherwise returns false. */
@@ -1569,6 +1580,11 @@ interface String {
1569
1580
  interface Number {
1570
1581
  /** Returns a string representation of a number. */
1571
1582
  toString(): string;
1583
+ /**
1584
+ * Returns a string representing a number in fixed-point notation.
1585
+ * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
1586
+ */
1587
+ toFixed(fractionDigits?: number): string;
1572
1588
  }
1573
1589
  type PropertyKey = number | string | symbol;
1574
1590
  interface Object {
@@ -1681,7 +1697,10 @@ interface Array<T> {
1681
1697
  /** Returns a sum of all values inside the array. Any non-numeric values will be considered a zero. */
1682
1698
  sum(): number;
1683
1699
  values(): T[];
1684
- /** Combines two or more arrays. This method returns a new array without modifying any existing arrays.
1700
+ /** Determines whether an array includes a certain element, returning true or false as appropriate. */
1701
+ includes(searchElement: T, fromIndex?: number): boolean;
1702
+ /**
1703
+ * Combines two or more arrays. This method returns a new array without modifying any existing arrays.
1685
1704
  * @param items Additional arrays and/or items to add to the end of the array.
1686
1705
  */
1687
1706
  concat(...items: (T | T[])[]): T[];
@@ -1695,13 +1714,22 @@ interface Array<T> {
1695
1714
  some(predicate: (value: T, index: number, array: T[]) => unknown): boolean;
1696
1715
  /** Determines whether all the members of an array satisfy the specified test. */
1697
1716
  every(predicate: (value: T, index: number, array: T[]) => unknown): boolean;
1698
- /** Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array.
1717
+ /**
1718
+ * Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array.
1699
1719
  *
1700
1720
  * For example, -2 refers to the second to last element of the array.
1701
1721
  * @param start The beginning index of the specified portion of the array. If start is undefined, then the slice begins at index 0.
1702
1722
  * @param end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'. If end is undefined, then the slice extends to the end of the array.
1703
1723
  * */
1704
1724
  slice(start?: number, end?: number): T[];
1725
+ /**
1726
+ * Removes elements from an array and returns the deleted elements.
1727
+ *
1728
+ * For example, -2 refers to the second to last element of the array.
1729
+ * @param start The zero-based location in the array from which to start removing elements
1730
+ * @param end The number of elements to remove. Omitting this argument will remove all elements from the start paramater location to end of the array.
1731
+ * */
1732
+ splice(start: number, deleteCount?: number): T[];
1705
1733
  /** Returns a string representation of an array. */
1706
1734
  toString(): string;
1707
1735
  [n: number]: T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grey-ts/types",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "TypeScript definitions for GreyHack's functions and objects",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",