You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{(Completion.create ~name~kind:(Label"") ~env) with docstring}
1408
1407
in
1409
1408
[
1410
-
("as", []);
1411
-
("dead", ["...docs for dead..."]);
1412
-
("deriving", []);
1413
-
("genType", []);
1414
-
("genType.as", []);
1415
-
("genType.import", []);
1416
-
("genType.opaque", []);
1417
-
("get", []);
1418
-
("get_index", []);
1419
-
("inline", []);
1420
-
("int", []);
1421
-
("live", ["...docs for live..."]);
1422
-
("meth", []);
1423
-
("module", []);
1424
-
("new", []);
1425
-
("obj", []);
1426
-
("react.component", []);
1427
-
("return", []);
1428
-
("scope", []);
1429
-
("send", []);
1430
-
("set", []);
1431
-
("set_index", []);
1432
-
("string", []);
1433
-
("this", []);
1434
-
("unboxed", []);
1435
-
("uncurry", []);
1436
-
("unwrap", []);
1437
-
("val", []);
1438
-
("variadic", []);
1409
+
( "as",
1410
+
[
1411
+
{|The `@as` decorator is commonly used on record types to alias record field names to a different JavaScript attribute name.
1412
+
1413
+
This is useful to map toJavaScript attribute names that cannot be expressed inReScript (such as keywords).
1414
+
1415
+
It is also possible to map a ReScript record to a JavaScriptarray by passing indices to the `@as` decorator.
1416
+
1417
+
[Read more andseeexamplesinthedocumentation](https://rescript-lang.org/syntax-lookup#as-decorator).|};
1418
+
] );
1419
+
( "dead",
1420
+
[
1421
+
{|The `@dead` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.
1422
+
1423
+
`@dead` suppresses reporting on the value/type, but can also be used to force the analysis to consider a value as dead. Typically used to acknowledge cases of dead code you are not planning to address right now, but can be searched easily later.
1424
+
1425
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#dead-decorator).|};
1426
+
] );
1427
+
( "deriving",
1428
+
[
1429
+
{|When the `@deriving` decorator is applied to a record type, it expands the type into a factory function plus a set of getter/setter functions for its fields.
1430
+
1431
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#deriving-decorator).|};
1432
+
] );
1433
+
( "deprecated",
1434
+
[
1435
+
{|The `@deprecated` decorator is used to add deprecation notes to types, values and submodules. The compiler and editor tooling will yield a warning whenever a deprecated entity is being used.
1436
+
1437
+
Alternatively, use the `@@deprecated` decorator to add a deprecation warning to the file level.
1438
+
1439
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#expression-deprecated-decorator).|};
1440
+
] );
1441
+
("genType", [""]);
1442
+
("genType.as", [""]);
1443
+
("genType.import", [""]);
1444
+
("genType.opaque", [""]);
1445
+
( "get",
1446
+
[
1447
+
{|The `@get` decorator is used to bind to a property of an object.
1448
+
1449
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#get-decorator).|};
1450
+
] );
1451
+
( "get_index",
1452
+
[
1453
+
{|The `@get_index` decorator is used to access a dynamic property on an object, or an index of an array.
1454
+
1455
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#get-index-decorator).|};
1456
+
] );
1457
+
( "inline",
1458
+
[
1459
+
{|The `@inline` decorator tells the compiler to inline its value in every place the binding is being used, rather than use a variable.
1460
+
1461
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#inline-decorator).|};
1462
+
] );
1463
+
( "int",
1464
+
[
1465
+
{|The `@int` decorator can be used with polymorphic variants and the @as decorator on externals to modify the compiled JavaScript to use integers for the values instead of strings.
1466
+
1467
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#int-decorator).|};
1468
+
] );
1469
+
( "live",
1470
+
[
1471
+
{|The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.
1472
+
1473
+
`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.
1474
+
1475
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).|};
1476
+
] );
1477
+
( "meth",
1478
+
[
1479
+
{|The `@meth` decorator is used to call a function on a JavaScript object, and avoid issues with currying.
1480
+
1481
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#meth-decorator).|};
1482
+
] );
1483
+
( "module",
1484
+
[
1485
+
{|The `@module` decorator is used to bind to a JavaScript module.
1486
+
1487
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#module-decorator).|};
1488
+
] );
1489
+
( "new",
1490
+
[
1491
+
{|
1492
+
The `@new` decorator is used whenever you need to bind to a JavaScript class constructor that requires the new keword for instantiation.|
1493
+
1494
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#new-decorator).|};
1495
+
] );
1496
+
( "obj",
1497
+
[
1498
+
{|The `@obj` decorator is used to create functions that return JavaScript objects with properties that match the function's parameter labels.
1499
+
1500
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#obj-decorator).|};
1501
+
] );
1502
+
( "react.component",
1503
+
[
1504
+
{|The `@react.component` decorator is used to annotate functions that are RescriptReact components.
1505
+
1506
+
You will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.
1507
+
1508
+
Note: The `@react.component` decorator requires the react-jsx config to be set in your `bsconfig.json` to enable the required React transformations.
1509
+
1510
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator).|};
1511
+
] );
1512
+
( "return",
1513
+
[
1514
+
{|The `@return` decorator is used to control how `null` and `undefined` values are converted to option types in ReScript.
1515
+
1516
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#return-decorator).|};
1517
+
] );
1518
+
( "scope",
1519
+
[
1520
+
{|The `@scope` decorator is used with other decorators such as `@val` and `@module` to declare a parent scope for the binding.
1521
+
1522
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#scope-decorator).|};
1523
+
] );
1524
+
( "send",
1525
+
[
1526
+
{|The `@send` decorator is used to bind to a method on an object or array.
1527
+
1528
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#send-decorator).|};
1529
+
] );
1530
+
( "set",
1531
+
[
1532
+
{|The `@set` decorator is used to set a property of an object.
1533
+
1534
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#set-decorator).|};
1535
+
] );
1536
+
( "set_index",
1537
+
[
1538
+
{|The `@set_index` decorator is used to set a dynamic property on an object, or an index of an array.
1539
+
1540
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#set-index-decorator).|};
1541
+
] );
1542
+
( "string",
1543
+
[
1544
+
{|The `@string` decorator can be used with polymorphic variants and the `@as` decorator on externals to modify the string values used for the variants in the compiled JavaScript.
1545
+
1546
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#string-decorator).|};
1547
+
] );
1548
+
( "this",
1549
+
[
1550
+
{|The `@this` decorator may be used to bind to an external callback function that require access to a this context.
1551
+
1552
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#this-decorator).|};
1553
+
] );
1554
+
( "unboxed",
1555
+
[
1556
+
{|The `@unboxed` decorator provides a way to unwrap variant constructors that have a single argument, or record objects that have a single field.
1557
+
1558
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#unboxed-decorator).|};
1559
+
] );
1560
+
( "uncurry",
1561
+
[
1562
+
{|The `@uncurry` decorator can be used to mark any callback argument within an external function as an uncurried function without the need for any explicit uncurried function syntax (`(.) => { ... }`).
0 commit comments