Skip to content

Commit 9e95c50

Browse files
authored
update docs API (#887)
Core: 1.5.0 Compiler: 11.0_release branch
1 parent f0a7e11 commit 9e95c50

File tree

1 file changed

+52
-7
lines changed

1 file changed

+52
-7
lines changed

data/api/latest/core.json

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
"docstrings": [
255255
"Type representing the result of a `RegExp` execution."
256256
],
257-
"signature": "type t = array<string>"
257+
"signature": "type t = array<option<string>>"
258258
},
259259
{
260260
"id": "Core.Re.Result.fullMatch",
@@ -1233,7 +1233,7 @@
12331233
"kind": "type",
12341234
"name": "formatMatcher",
12351235
"docstrings": [],
1236-
"signature": "type formatMatcher = [#basic | #bestFit]"
1236+
"signature": "type formatMatcher = [#basic | #\"best fit\"]"
12371237
},
12381238
{
12391239
"id": "Core.Intl.DateTimeFormat.fractionalSecondDigits",
@@ -1436,7 +1436,7 @@
14361436
"kind": "type",
14371437
"name": "localeMatcher",
14381438
"docstrings": [],
1439-
"signature": "type localeMatcher = [#bestFit | #lookup]"
1439+
"signature": "type localeMatcher = [#\"best fit\" | #lookup]"
14401440
},
14411441
{
14421442
"id": "Core.Intl.Common.calendar",
@@ -1862,7 +1862,7 @@
18621862
"docstrings": [
18631863
"Type representing the result of a `RegExp` execution."
18641864
],
1865-
"signature": "type t = array<string>"
1865+
"signature": "type t = array<option<string>>"
18661866
},
18671867
{
18681868
"id": "Core.RegExp.Result.fullMatch",
@@ -1993,10 +1993,19 @@
19931993
"kind": "value",
19941994
"name": "floor",
19951995
"docstrings": [
1996-
"floor(v) returns the largest `int` less than or equal to the argument; \n the result is pinned to the range of the `int` data type: -2147483648 to 2147483647. \n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n Math.Int.floor(-1.0e15) == -2147483648\n Math.Int.floor(1.0e15) == 2147483647\n ```"
1996+
"floor(v) returns the largest `int` less than or equal to the argument; \n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n ```"
19971997
],
19981998
"signature": "let floor: float => int"
19991999
},
2000+
{
2001+
"id": "Core.Math.Int.ceil",
2002+
"kind": "value",
2003+
"name": "ceil",
2004+
"docstrings": [
2005+
"ceil(v) returns the smallest `int` greater than or equal to the argument;\n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.ceil(3.7) == 4\n Math.Int.ceil(3.0) == 3\n Math.Int.ceil(-3.1) == -3\n ```"
2006+
],
2007+
"signature": "let ceil: float => int"
2008+
},
20002009
{
20012010
"id": "Core.Math.Int.random",
20022011
"kind": "value",
@@ -3176,6 +3185,15 @@
31763185
],
31773186
"signature": "let lastIndex: t => int"
31783187
},
3188+
{
3189+
"id": "Core.Re.setLastIndex",
3190+
"kind": "value",
3191+
"name": "setLastIndex",
3192+
"docstrings": [
3193+
"`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```"
3194+
],
3195+
"signature": "let setLastIndex: (t, int) => unit"
3196+
},
31793197
{
31803198
"id": "Core.Re.ignoreCase",
31813199
"kind": "value",
@@ -5401,6 +5419,15 @@
54015419
],
54025420
"signature": "let get: (string, int) => option<string>"
54035421
},
5422+
{
5423+
"id": "Core.String.getUnsafe",
5424+
"kind": "value",
5425+
"name": "getUnsafe",
5426+
"docstrings": [
5427+
"`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```"
5428+
],
5429+
"signature": "let getUnsafe: (string, int) => string"
5430+
},
54045431
{
54055432
"id": "Core.String.charAt",
54065433
"kind": "value",
@@ -5541,7 +5568,7 @@
55415568
"kind": "value",
55425569
"name": "match",
55435570
"docstrings": [
5544-
"`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\nFor regular expressions with the g modifier, a matched expression returns\n`Some(array)` with all the matched substrings and no capture groups.\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", %re(\"/b[aeiou]t/\")) == Some([\"bet\"])\nString.match(\"The better bats\", %re(\"/b[aeiou]t/g\")) == Some([\"bet\", \"bat\"])\nString.match(\"Today is 2018-04-05.\", %re(\"/(\\d+)-(\\d+)-(\\d+)/\")) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nString.match(\"The large container.\", %re(\"/b[aeiou]g/\")) == None\n```"
5571+
"`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\nFor regular expressions with the g modifier, a matched expression returns\n`Some(array)` with all the matched substrings and no capture groups.\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", %re(\"/b[aeiou]t/\")) == Some([Some(\"bet\")])\nString.match(\"The better bats\", %re(\"/b[aeiou]t/g\")) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", %re(\"/(\\d+)-(\\d+)-(\\d+)/\")) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", %re(\"/(foo)?(example)/\")) == Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", %re(\"/b[aeiou]g/\")) == None\n```"
55455572
],
55465573
"signature": "let match: (string, Core__RegExp.t) => option<Core__RegExp.Result.t>"
55475574
},
@@ -5933,6 +5960,15 @@
59335960
],
59345961
"signature": "let lastIndex: t => int"
59355962
},
5963+
{
5964+
"id": "Core.RegExp.setLastIndex",
5965+
"kind": "value",
5966+
"name": "setLastIndex",
5967+
"docstrings": [
5968+
"`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```"
5969+
],
5970+
"signature": "let setLastIndex: (t, int) => unit"
5971+
},
59365972
{
59375973
"id": "Core.RegExp.ignoreCase",
59385974
"kind": "value",
@@ -6523,6 +6559,15 @@
65236559
],
65246560
"signature": "let undefined: t<'a>"
65256561
},
6562+
{
6563+
"id": "Core.Nullable.isNullable",
6564+
"kind": "value",
6565+
"name": "isNullable",
6566+
"docstrings": [
6567+
"`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```"
6568+
],
6569+
"signature": "let isNullable: t<'a> => bool"
6570+
},
65266571
{
65276572
"id": "Core.Nullable.make",
65286573
"kind": "value",
@@ -9782,7 +9827,7 @@
97829827
"kind": "value",
97839828
"name": "every",
97849829
"docstrings": [
9785-
"`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n```rescript\nlet array = [1, 2, 3, 4]\n\nConsole.log(array->Array.every(num => num > 4)) // true\nConsole.log(array->Array.every(num => num === 1)) // false\n```"
9830+
"`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n```rescript\nlet array = [1, 2, 3, 4]\n\nConsole.log(array->Array.every(num => num <= 4)) // true\nConsole.log(array->Array.every(num => num === 1)) // false\n```"
97869831
],
97879832
"signature": "let every: (array<'a>, 'a => bool) => bool"
97889833
},

0 commit comments

Comments
 (0)