diff --git a/data/api/latest/core.json b/data/api/latest/core.json index f19a63e03..37bb7d056 100644 --- a/data/api/latest/core.json +++ b/data/api/latest/core.json @@ -607,7 +607,7 @@ "kind": "value", "name": "selectBigInt", "docstrings": [], - "signature": "let selectBigInt: (t, Core__BigInt.t) => rule" + "signature": "let selectBigInt: (t, bigint) => rule" }, { "id": "Core.Intl.PluralRules.selectRange", @@ -628,7 +628,7 @@ "kind": "value", "name": "selectRangeBigInt", "docstrings": [], - "signature": "let selectRangeBigInt: (t, ~start: Core__BigInt.t, ~end: Core__BigInt.t) => rule" + "signature": "let selectRangeBigInt: (t, ~start: bigint, ~end: bigint) => rule" } ] }, @@ -874,28 +874,28 @@ "kind": "value", "name": "formatBigInt", "docstrings": [], - "signature": "let formatBigInt: (t, Core__BigInt.t) => string" + "signature": "let formatBigInt: (t, bigint) => string" }, { "id": "Core.Intl.NumberFormat.formatBigIntRange", "kind": "value", "name": "formatBigIntRange", "docstrings": [], - "signature": "let formatBigIntRange: (\n t,\n ~start: Core__BigInt.t,\n ~end: Core__BigInt.t,\n) => array" + "signature": "let formatBigIntRange: (t, ~start: bigint, ~end: bigint) => array" }, { "id": "Core.Intl.NumberFormat.formatBigIntToParts", "kind": "value", "name": "formatBigIntToParts", "docstrings": [], - "signature": "let formatBigIntToParts: (t, Core__BigInt.t) => array" + "signature": "let formatBigIntToParts: (t, bigint) => array" }, { "id": "Core.Intl.NumberFormat.formatBigIntRangeToParts", "kind": "value", "name": "formatBigIntRangeToParts", "docstrings": [], - "signature": "let formatBigIntRangeToParts: (\n t,\n ~start: Core__BigInt.t,\n ~end: Core__BigInt.t,\n) => array" + "signature": "let formatBigIntRangeToParts: (t, ~start: bigint, ~end: bigint) => array" }, { "id": "Core.Intl.NumberFormat.formatString", @@ -1837,7 +1837,7 @@ "docstrings": [ "The type representing a classified JavaScript value." ], - "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Core__Symbol.t)\n | BigInt(Core__BigInt.t)" + "signature": "type t =\n | Bool(bool)\n | Null\n | Undefined\n | String(string)\n | Number(float)\n | Object(object)\n | Function(function)\n | Symbol(Core__Symbol.t)\n | BigInt(bigint)" }, { "id": "Core.Type.Classify.classify", @@ -2997,9 +2997,9 @@ "kind": "value", "name": "getExn", "docstrings": [ - "`getExn(opt)` returns `value` if `opt` is `Some(value)`, otherwise raises an exception.\n\n```rescript\nOption.getExn(Some(3)) // 3\nOption.getExn(None) /* Raises an Error */\n```\n\n## Exceptions\n\n- Raises an error if `opt` is `None`" + "`getExn(opt, ~message=?)` returns `value` if `opt` is `Some(value)`, otherwise raises an exception with the message provided, or a generic message if no message was provided.\n\n```rescript\nOption.getExn(Some(3)) // 3\nOption.getExn(None) /* Raises an Error */\nOption.getExn(None, ~message=\"was None!\") /* Raises an Error with the message \"was None!\" */\n```\n\n## Exceptions\n\n- Raises an error if `opt` is `None`" ], - "signature": "let getExn: option<'a> => 'a" + "signature": "let getExn: (option<'a>, ~message: string=?) => 'a" }, { "id": "Core.Option.getUnsafe", @@ -3290,7 +3290,7 @@ "docstrings": [ "The `BigUint64Array` typed array represents an array of 64-bit unsigned integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)" ], - "signature": "type t = Core__TypedArray.t" + "signature": "type t = Core__TypedArray.t" }, { "id": "Core.BigUint64Array.fromArray", @@ -3299,7 +3299,7 @@ "docstrings": [ "`fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)" ], - "signature": "let fromArray: array => t" + "signature": "let fromArray: array => t" }, { "id": "Core.BigUint64Array.fromBuffer", @@ -3353,7 +3353,7 @@ "docstrings": [ "`fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => Core__BigInt.t) => t" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t" } ] }, @@ -3369,7 +3369,7 @@ "docstrings": [ "The `BigInt64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigInt64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)" ], - "signature": "type t = Core__TypedArray.t" + "signature": "type t = Core__TypedArray.t" }, { "id": "Core.BigInt64Array.fromArray", @@ -3378,7 +3378,7 @@ "docstrings": [ "`fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)" ], - "signature": "let fromArray: array => t" + "signature": "let fromArray: array => t" }, { "id": "Core.BigInt64Array.fromBuffer", @@ -3432,7 +3432,7 @@ "docstrings": [ "`fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)" ], - "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => Core__BigInt.t) => t" + "signature": "let fromArrayLikeOrIterableWithMap: ('a, ('b, int) => bigint) => t" } ] }, @@ -7139,187 +7139,215 @@ "name": "BigInt", "docstrings": [], "items": [ - { - "id": "Core.BigInt.t", - "kind": "type", - "name": "t", - "docstrings": [], - "signature": "type t = Js.Types.bigint_val" - }, { "id": "Core.BigInt.asIntN", "kind": "value", "name": "asIntN", "docstrings": [], - "signature": "let asIntN: (~width: int, t) => t" + "signature": "let asIntN: (~width: int, bigint) => bigint" }, { "id": "Core.BigInt.asUintN", "kind": "value", "name": "asUintN", "docstrings": [], - "signature": "let asUintN: (~width: int, t) => t" + "signature": "let asUintN: (~width: int, bigint) => bigint" }, { "id": "Core.BigInt.fromString", "kind": "value", "name": "fromString", "docstrings": [], - "signature": "let fromString: string => t" + "signature": "let fromString: string => bigint" + }, + { + "id": "Core.BigInt.fromStringExn", + "kind": "value", + "name": "fromStringExn", + "docstrings": [ + "Parses the given `string` into a `bigint` using JavaScript semantics. Return the\nnumber as a `bigint` if successfully parsed. Uncaught syntax exception otherwise.\n\n## Examples\n\n```rescript\n/* returns 123n */\nBigInt.fromStringExn(\"123\")\n\n/* returns 0n */\nBigInt.fromStringExn(\"\")\n\n/* returns 17n */\nBigInt.fromStringExn(\"0x11\")\n\n/* returns 3n */\nBigInt.fromStringExn(\"0b11\")\n\n/* returns 9n */\nBigInt.fromStringExn(\"0o11\")\n\n/* catch exception */\ntry {\n BigInt.fromStringExn(\"a\")\n} catch {\n| Exn.Error(_error) => 0n\n}\n```" + ], + "signature": "let fromStringExn: string => bigint" }, { "id": "Core.BigInt.fromInt", "kind": "value", "name": "fromInt", "docstrings": [], - "signature": "let fromInt: int => t" + "signature": "let fromInt: int => bigint" }, { "id": "Core.BigInt.fromFloat", "kind": "value", "name": "fromFloat", "docstrings": [], - "signature": "let fromFloat: float => t" + "signature": "let fromFloat: float => bigint" }, { "id": "Core.BigInt.toString", "kind": "value", "name": "toString", - "docstrings": [], - "signature": "let toString: t => string" + "docstrings": [ + "Formats a `bigint` as a string. Return a `string` representing the given value.\nSee [`toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" + ], + "signature": "let toString: (bigint, ~radix: int=?) => string" }, { "id": "Core.BigInt.toStringWithRadix", "kind": "value", "name": "toStringWithRadix", "docstrings": [], - "signature": "let toStringWithRadix: (t, ~radix: int) => string" + "signature": "let toStringWithRadix: (bigint, ~radix: int) => string", + "deprecated": "Use `toString` with `~radix` instead" }, { "id": "Core.BigInt.toLocaleString", "kind": "value", "name": "toLocaleString", - "docstrings": [], - "signature": "let toLocaleString: t => string" + "docstrings": [ + "Returns a string with a language-sensitive representation of this BigInt value.\n\n## Examples\n\n```rescript\n/* prints \"123\" */\nJs.BigInt.toString(123n)->Js.log\n```" + ], + "signature": "let toLocaleString: bigint => string" }, { "id": "Core.BigInt.toFloat", "kind": "value", "name": "toFloat", "docstrings": [], - "signature": "let toFloat: t => float" + "signature": "let toFloat: bigint => float" }, { "id": "Core.BigInt.toInt", "kind": "value", "name": "toInt", "docstrings": [], - "signature": "let toInt: t => int" + "signature": "let toInt: bigint => int" }, { "id": "Core.BigInt.+", "kind": "value", "name": "+", "docstrings": [], - "signature": "let +: (t, t) => t" + "signature": "let +: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.-", "kind": "value", "name": "-", "docstrings": [], - "signature": "let -: (t, t) => t" + "signature": "let -: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.*", "kind": "value", "name": "*", "docstrings": [], - "signature": "let *: (t, t) => t" + "signature": "let *: (bigint, bigint) => bigint" }, { "id": "Core.BigInt./", "kind": "value", "name": "/", "docstrings": [], - "signature": "let /: (t, t) => t" + "signature": "let /: (bigint, bigint) => bigint" + }, + { + "id": "Core.BigInt.~-", + "kind": "value", + "name": "~-", + "docstrings": [], + "signature": "let ~-: bigint => bigint" + }, + { + "id": "Core.BigInt.~+", + "kind": "value", + "name": "~+", + "docstrings": [], + "signature": "let ~+: bigint => bigint" + }, + { + "id": "Core.BigInt.**", + "kind": "value", + "name": "**", + "docstrings": [], + "signature": "let **: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.add", "kind": "value", "name": "add", "docstrings": [], - "signature": "let add: (t, t) => t" + "signature": "let add: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.sub", "kind": "value", "name": "sub", "docstrings": [], - "signature": "let sub: (t, t) => t" + "signature": "let sub: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.mul", "kind": "value", "name": "mul", "docstrings": [], - "signature": "let mul: (t, t) => t" + "signature": "let mul: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.div", "kind": "value", "name": "div", "docstrings": [], - "signature": "let div: (t, t) => t" + "signature": "let div: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.mod", "kind": "value", "name": "mod", "docstrings": [], - "signature": "let mod: (t, t) => t" + "signature": "let mod: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.land", "kind": "value", "name": "land", "docstrings": [], - "signature": "let land: (t, t) => t" + "signature": "let land: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.lor", "kind": "value", "name": "lor", "docstrings": [], - "signature": "let lor: (t, t) => t" + "signature": "let lor: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.lxor", "kind": "value", "name": "lxor", "docstrings": [], - "signature": "let lxor: (t, t) => t" + "signature": "let lxor: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.lsl", "kind": "value", "name": "lsl", "docstrings": [], - "signature": "let lsl: (t, t) => t" + "signature": "let lsl: (bigint, bigint) => bigint" }, { "id": "Core.BigInt.asr", "kind": "value", "name": "asr", "docstrings": [], - "signature": "let asr: (t, t) => t" + "signature": "let asr: (bigint, bigint) => bigint" }, { - "id": "Core.BigInt.exp", + "id": "Core.BigInt.lnot", "kind": "value", - "name": "exp", + "name": "lnot", "docstrings": [], - "signature": "let exp: (t, t) => 'a" + "signature": "let lnot: bigint => bigint" } ] }, @@ -7349,9 +7377,9 @@ "kind": "value", "name": "toExponential", "docstrings": [ - "`toExponential(n)` return a `string` representing the given value in exponential\nnotation.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\n```" + "`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." ], - "signature": "let toExponential: int => string" + "signature": "let toExponential: (int, ~digits: int=?) => string" }, { "id": "Core.Int.toExponentialWithPrecision", @@ -7360,16 +7388,17 @@ "docstrings": [ "`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." ], - "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string" + "signature": "let toExponentialWithPrecision: (int, ~digits: int) => string", + "deprecated": "Use `toExponential` instead" }, { "id": "Core.Int.toFixed", "kind": "value", "name": "toFixed", "docstrings": [ - "`toFixed(n)` return a `string` representing the given value using fixed-point\nnotation. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\n```" + "`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." ], - "signature": "let toFixed: int => string" + "signature": "let toFixed: (int, ~digits: int=?) => string" }, { "id": "Core.Int.toFixedWithPrecision", @@ -7378,16 +7407,17 @@ "docstrings": [ "`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." ], - "signature": "let toFixedWithPrecision: (int, ~digits: int) => string" + "signature": "let toFixedWithPrecision: (int, ~digits: int) => string", + "deprecated": "Use `toFixed` instead" }, { "id": "Core.Int.toPrecision", "kind": "value", "name": "toPrecision", "docstrings": [ - "`toPrecision(n)` return a `string` representing the giver value with precision.\nThis function omits the argument that controls precision, so it behaves like\n`toString`. See `toPrecisionWithPrecision` to control precision. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\n```" + "`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\nImplementations are allowed to support larger and smaller values as well.\nECMA-262 only requires a precision of up to 21 significant digits." ], - "signature": "let toPrecision: int => string" + "signature": "let toPrecision: (int, ~digits: int=?) => string" }, { "id": "Core.Int.toPrecisionWithPrecision", @@ -7396,16 +7426,17 @@ "docstrings": [ "`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\nImplementations are allowed to support larger and smaller values as well.\nECMA-262 only requires a precision of up to 21 significant digits." ], - "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string" + "signature": "let toPrecisionWithPrecision: (int, ~digits: int) => string", + "deprecated": "Use `toPrecision` instead" }, { "id": "Core.Int.toString", "kind": "value", "name": "toString", "docstrings": [ - "`toString(n)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\n```" + "`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." ], - "signature": "let toString: int => string" + "signature": "let toString: (int, ~radix: int=?) => string" }, { "id": "Core.Int.toStringWithRadix", @@ -7414,7 +7445,8 @@ "docstrings": [ "`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." ], - "signature": "let toStringWithRadix: (int, ~radix: int) => string" + "signature": "let toStringWithRadix: (int, ~radix: int) => string", + "deprecated": "Use `toString` instead" }, { "id": "Core.Int.toLocaleString", @@ -7448,9 +7480,9 @@ "kind": "value", "name": "fromString", "docstrings": [ - "`fromString(~radix?, str)` return an `option` representing the given value\n`str`. `~radix` specifies the radix base to use for the formatted number.\n\n## Examples\n\n```rescript\nInt.fromString(\"0\") == Some(0)\nInt.fromString(\"NaN\") == None\nInt.fromString(~radix=2, \"6\") == None\n```" + "`fromString(str, ~radix=?)` return an `option` representing the given value\n`str`. `~radix` specifies the radix base to use for the formatted number.\n\n## Examples\n\n```rescript\nInt.fromString(\"0\") == Some(0)\nInt.fromString(\"NaN\") == None\nInt.fromString(\"6\", ~radix=2) == None\n```" ], - "signature": "let fromString: (~radix: int=?, string) => option" + "signature": "let fromString: (string, ~radix: int=?) => option" }, { "id": "Core.Int.mod", @@ -7461,24 +7493,24 @@ ], "signature": "let mod: (int, int) => int" }, - { - "id": "Core.Int.range", - "kind": "value", - "name": "range", - "docstrings": [ - "`range(start, end)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `start < end` the sequence will be increasing in steps of 1.\n\nIf `start > end` the sequence will be decreasing in steps of -1.\n\nThis is equivalent to `rangeWithOptions` with `inclusive` set to `false` and\n`step` set to `1` if `start < end` and `-1` otherwise.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\n```" - ], - "signature": "let range: (int, int) => array" - }, { "id": "Core.Int.rangeOptions", "kind": "type", "name": "rangeOptions", "docstrings": [ - "The options for `rangeWithOptions`." + "The options for `range`." ], "signature": "type rangeOptions = {step?: int, inclusive?: bool}" }, + { + "id": "Core.Int.range", + "kind": "value", + "name": "range", + "docstrings": [ + "`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." + ], + "signature": "let range: (int, int, ~options: rangeOptions=?) => array" + }, { "id": "Core.Int.rangeWithOptions", "kind": "value", @@ -7486,7 +7518,8 @@ "docstrings": [ "`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`." ], - "signature": "let rangeWithOptions: (int, int, rangeOptions) => array" + "signature": "let rangeWithOptions: (int, int, rangeOptions) => array", + "deprecated": "Use `range` instead" }, { "id": "Core.Int.clamp", @@ -7552,9 +7585,9 @@ "kind": "value", "name": "parseInt", "docstrings": [ - "`parseInt(v)` parse the given `v` and returns a float. Leading whitespace in\n`v` is ignored. Returns `NaN` if `v` can't be parsed.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseInt(\"1.0\") // 1.0\nFloat.parseInt(\" 3.14 \") // 3.0\nFloat.parseInt(3) // 3.0\nFloat.parseInt(\"3.14some non-digit characters\") // 3.0\nFloat.parseInt(\"error\")->Float.isNaN // true\n```" + "`parseInt(v, ~radix=?)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range [2, 36] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseInt(\"1.0\") // 1.0\nFloat.parseInt(\" 3.14 \") // 3.0\nFloat.parseInt(3) // 3.0\nFloat.parseInt(\"3.14some non-digit characters\") // 3.0\nFloat.parseInt(\"error\")->Float.isNaN // true\nFloat.parseInt(\"10.0\", ~radix=2) // 2.0\nFloat.parseInt(\"15 * 3\", ~radix=10) // 15.0\nFloat.parseInt(\"12\", ~radix=13) // 15.0\nFloat.parseInt(\"17\", ~radix=40)->Float.isNaN // true\n```" ], - "signature": "let parseInt: 'a => float" + "signature": "let parseInt: ('a, ~radix: int=?) => float" }, { "id": "Core.Float.parseIntWithRadix", @@ -7563,16 +7596,17 @@ "docstrings": [ "`parseIntWithRadix(v, ~radix)` parse the given `v` and returns a float. Leading\nwhitespace in this argument `v`is ignored. `radix` specifies the radix base to\nuse for the formatted number. The value must be in the range [2, 36] (inclusive).\nReturns `NaN` if `v` can't be parsed and `radix` is smaller than 2 or bigger\nthan 36.\nSee [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) on MDN.\n\n## Examples\n\n```rescript\nFloat.parseIntWithRadix(\"10.0\", ~radix=2) // 2.0\nFloat.parseIntWithRadix(\"15 * 3\", ~radix=10) // 15.0\nFloat.parseIntWithRadix(\"12\", ~radix=13) // 15.0\nFloat.parseIntWithRadix(\"17\", ~radix=40)->Float.isNaN // true\n```" ], - "signature": "let parseIntWithRadix: ('a, ~radix: int) => float" + "signature": "let parseIntWithRadix: ('a, ~radix: int) => float", + "deprecated": "Use `parseInt` instead" }, { "id": "Core.Float.toExponential", "kind": "value", "name": "toExponential", "docstrings": [ - "`toExponential(v)` return a `string` representing the given value in exponential\nnotation.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) // \"1e+3\"\nFloat.toExponential(-1000.0) // \"-1e+3\"\n```" + "`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) // \"1e+3\"\nFloat.toExponential(-1000.0) // \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) // \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." ], - "signature": "let toExponential: float => string" + "signature": "let toExponential: (float, ~digits: int=?) => string" }, { "id": "Core.Float.toExponentialWithPrecision", @@ -7581,16 +7615,17 @@ "docstrings": [ "`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) // \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10." ], - "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string" + "signature": "let toExponentialWithPrecision: (float, ~digits: int) => string", + "deprecated": "Use `toExponential` instead" }, { "id": "Core.Float.toFixed", "kind": "value", "name": "toFixed", "docstrings": [ - "`toFixed(v)` return a `string` representing the given value using fixed-point\nnotation.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) // \"123456.00\"\nFloat.toFixed(10.0) // \"10.00\"\n```" + "`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) // \"123456.00\"\nFloat.toFixed(10.0) // \"10.00\"\nFloat.toFixed(300.0, ~digits=4) // \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." ], - "signature": "let toFixed: float => string" + "signature": "let toFixed: (float, ~digits: int=?) => string" }, { "id": "Core.Float.toFixedWithPrecision", @@ -7599,16 +7634,17 @@ "docstrings": [ "`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) // \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100." ], - "signature": "let toFixedWithPrecision: (float, ~digits: int) => string" + "signature": "let toFixedWithPrecision: (float, ~digits: int) => string", + "deprecated": "Use `toFixed` instead" }, { "id": "Core.Float.toPrecision", "kind": "value", "name": "toPrecision", "docstrings": [ - "`toPrecision(v)` return a `string` representing the giver value with precision.\nThis function omits the argument that controls precision, so it behaves like\n`toString`. See `toPrecisionWithPrecision` to control precision.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) // \"100\"\nFloat.toPrecision(1.0) // \"1\"\n```" + "`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) // \"100\"\nFloat.toPrecision(1.0) // \"1\"\nFloat.toPrecision(100.0, ~digits=2) // \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) // \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\nImplementations are allowed to support larger and smaller values as well.\nECMA-262 only requires a precision of up to 21 significant digits." ], - "signature": "let toPrecision: float => string" + "signature": "let toPrecision: (float, ~digits: int=?) => string" }, { "id": "Core.Float.toPrecisionWithPrecision", @@ -7617,7 +7653,8 @@ "docstrings": [ "`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) // \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) // \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\nImplementations are allowed to support larger and smaller values as well.\nECMA-262 only requires a precision of up to 21 significant digits." ], - "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string" + "signature": "let toPrecisionWithPrecision: (float, ~digits: int) => string", + "deprecated": "Use `toPrecision` instead" }, { "id": "Core.Float.toString", @@ -7626,7 +7663,7 @@ "docstrings": [ "`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) // \"1000\"\nFloat.toString(-1000.0) // \"-1000\"\n```" ], - "signature": "let toString: float => string" + "signature": "let toString: (float, ~radix: int=?) => string" }, { "id": "Core.Float.toStringWithRadix", @@ -7635,7 +7672,8 @@ "docstrings": [ "`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) // \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) // \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36." ], - "signature": "let toStringWithRadix: (float, ~radix: int) => string" + "signature": "let toStringWithRadix: (float, ~radix: int) => string", + "deprecated": "Use `toString` with `~radix` instead" }, { "id": "Core.Float.toLocaleString", @@ -7937,7 +7975,7 @@ "kind": "value", "name": "mapValues", "docstrings": [ - "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([(\"key1\", 1), (\"key2\", 2)])\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(Int.toString)->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" + "`mapValues(dictionary, f)` returns a new dictionary with the same keys, and `f` applied to each value in the original dictionary.\n\n## Examples\n\n```rescript\nlet dict = Dict.fromArray([(\"key1\", 1), (\"key2\", 2)])\n\ndict->Dict.mapValues(v => v + 10)->Dict.toArray // [(\"key1\", 11), (\"key2\", 12)]\ndict->Dict.mapValues(v => Int.toString(v))->Dict.toArray // [(\"key1\", \"1\"), (\"key2\", \"2\")]\n```" ], "signature": "let mapValues: (t<'a>, 'a => 'b) => t<'b>" } @@ -8765,14 +8803,14 @@ "kind": "value", "name": "getBigInt64", "docstrings": [], - "signature": "let getBigInt64: t => Core__BigInt.t" + "signature": "let getBigInt64: t => bigint" }, { "id": "Core.DataView.getBigUint64", "kind": "value", "name": "getBigUint64", "docstrings": [], - "signature": "let getBigUint64: t => Core__BigInt.t" + "signature": "let getBigUint64: t => bigint" }, { "id": "Core.DataView.setInt8", @@ -8835,14 +8873,14 @@ "kind": "value", "name": "setBigInt64", "docstrings": [], - "signature": "let setBigInt64: (t, Core__BigInt.t) => unit" + "signature": "let setBigInt64: (t, bigint) => unit" }, { "id": "Core.DataView.setBigUint64", "kind": "value", "name": "setBigUint64", "docstrings": [], - "signature": "let setBigUint64: (t, Core__BigInt.t) => unit" + "signature": "let setBigUint64: (t, bigint) => unit" } ] }, diff --git a/data/api/latest/js.json b/data/api/latest/js.json index 77c645d63..c9b052ef9 100644 --- a/data/api/latest/js.json +++ b/data/api/latest/js.json @@ -9057,8 +9057,8 @@ "id": "Js.WeakMap", "name": "WeakMap", "docstrings": [ - "Provides bindings for JavaScript WeakMap", - "WeakMap API" + "Provides bindings for ES6 WeakMap", + "ES6 WeakMap API" ], "items": [ { @@ -9074,8 +9074,8 @@ "id": "Js.Map", "name": "Map", "docstrings": [ - "Provides bindings for JavaScript Map", - "Map API" + "Provides bindings for ES6 Map", + "ES6 Map API" ], "items": [ { @@ -9091,8 +9091,8 @@ "id": "Js.WeakSet", "name": "WeakSet", "docstrings": [ - "Provides bindings for JavaScript WeakSet", - "WeakSet API" + "Provides bindings for ES6 WeakSet", + "ES6 WeakSet API" ], "items": [ { @@ -9108,8 +9108,8 @@ "id": "Js.Set", "name": "Set", "docstrings": [ - "Provides bindings for JavaScript Set", - "Set API" + "Provides bindings for ES6 Set", + "ES6 Set API" ], "items": [ { @@ -10138,7 +10138,7 @@ "kind": "type", "name": "symbol", "docstrings": [ - "Js symbol type" + "Js symbol type (only available in ES6)" ], "signature": "type symbol" }, @@ -14984,4 +14984,4 @@ } ] } -} +} \ No newline at end of file