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
type kind = TopLevel of string | Local of string | TopLevelOrLocal of string
2
+
1
3
let decorators =
2
4
[
3
-
( "as",
5
+
( Local "as",
4
6
[
5
7
{|The `@as` decorator is commonly used on record types to alias record field names to a different JavaScript attribute name.
6
8
@@ -10,7 +12,7 @@ It is also possible to map a ReScript record to a JavaScript array by passing in
10
12
11
13
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#as-decorator).|};
12
14
] );
13
-
( "dead",
15
+
( Local "dead",
14
16
[
15
17
{|The `@dead` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.
16
18
@@ -20,21 +22,21 @@ It is also possible to map a ReScript record to a JavaScript array by passing in
20
22
21
23
> Hint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!|};
22
24
] );
23
-
( "deriving",
25
+
( Local "deriving",
24
26
[
25
27
{|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.
26
28
27
29
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#deriving-decorator).|};
28
30
] );
29
-
( "deprecated",
31
+
( TopLevelOrLocal "deprecated",
30
32
[
31
33
{|The `@deprecated` decorator is used to add deprecation notes to types, values andsubmodules. The compiler andeditor tooling will yield a warning whenever a deprecated entity is being used.
32
34
33
35
Alternatively, use the `@@deprecated` decorator to add a deprecation warning to the file level.
34
36
35
37
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#expression-deprecated-decorator).|};
36
38
] );
37
-
( "doesNotRaise",
39
+
( Local "doesNotRaise",
38
40
[
39
41
{|The `@doesNotRaise` decorator is for reanalyze, a static analysis tool for ReScript that can perform exception analysis.
40
42
@@ -45,55 +47,55 @@ could potentially raise.
45
47
[Read more andsee examples in the documentation](https://github.com/rescript-association/reanalyze/blob/master/EXCEPTION.md).
46
48
> Hint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!|};
47
49
] );
48
-
( "genType",
50
+
( Local "genType",
49
51
[
50
52
{|The @genType decorator may be used to export ReScript values andtypes to JavaScript, andimport JavaScript values andtypes into ReScript. It allows seamless integration of compiled ReScript modules in existing TypeScript, Flow, or plain JavaScript codebases, without loosing type information across different type systems.
51
53
52
54
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#gentype-decorator).|};
53
55
] );
54
-
( "genType.as",
56
+
( Local "genType.as",
55
57
[
56
58
{|The @genType decorator may be used to export ReScript values andtypes to JavaScript, andimport JavaScript values andtypes into ReScript. It allows seamless integration of compiled ReScript modules in existing TypeScript, Flow, or plain JavaScript codebases, without loosing type information across different type systems.
57
59
58
60
[Read more andsee examples in the documentation](https://rescript-lang.org/docs/gentype/latest/usage).|};
59
61
] );
60
-
( "genType.import",
62
+
( Local "genType.import",
61
63
[
62
64
{|The @genType decorator may be used to export ReScript values andtypes to JavaScript, andimport JavaScript values andtypes into ReScript. It allows seamless integration of compiled ReScript modules in existing TypeScript, Flow, or plain JavaScript codebases, without loosing type information across different type systems.
63
65
64
66
[Read more andsee examples in the documentation](https://rescript-lang.org/docs/gentype/latest/usage).|};
65
67
] );
66
-
( "genType.opaque",
68
+
( Local "genType.opaque",
67
69
[
68
70
{|The @genType decorator may be used to export ReScript values andtypes to JavaScript, andimport JavaScript values andtypes into ReScript. It allows seamless integration of compiled ReScript modules in existing TypeScript, Flow, or plain JavaScript codebases, without loosing type information across different type systems.
69
71
70
72
[Read more andsee examples in the documentation](https://rescript-lang.org/docs/gentype/latest/usage).|};
71
73
] );
72
-
( "get",
74
+
( Local "get",
73
75
[
74
76
{|The `@get` decorator is used to bind to a property of an object.
75
77
76
78
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#get-decorator).|};
77
79
] );
78
-
( "get_index",
80
+
( Local "get_index",
79
81
[
80
82
{|The `@get_index` decorator is used to access a dynamic property on an object, or an index of an array.
81
83
82
84
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#get-index-decorator).|};
83
85
] );
84
-
( "inline",
86
+
( Local "inline",
85
87
[
86
88
{|The `@inline` decorator tells the compiler to inline its value in every place the binding is being used, rather than use a variable.
87
89
88
90
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#inline-decorator).|};
89
91
] );
90
-
( "int",
92
+
( Local "int",
91
93
[
92
94
{|The `@int` decorator can be used with polymorphic variants andthe @as decorator on externals to modify the compiled JavaScript to use integers for the values instead of strings.
93
95
94
96
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#int-decorator).|};
95
97
] );
96
-
( "live",
98
+
( Local "live",
97
99
[
98
100
{|The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.
99
101
@@ -103,32 +105,32 @@ could potentially raise.
103
105
104
106
Hint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!|};
105
107
] );
106
-
( "meth",
108
+
( Local "meth",
107
109
[
108
110
{|The `@meth` decorator is used to call a function on a JavaScript object, andavoid issues with currying.
109
111
110
112
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#meth-decorator).|};
111
113
] );
112
-
( "module",
114
+
( Local "module",
113
115
[
114
116
{|The `@module` decorator is used to bind to a JavaScript module.
115
117
116
118
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#module-decorator).|};
117
119
] );
118
-
( "new",
120
+
( Local "new",
119
121
[
120
122
{|
121
123
The `@new` decorator is used whenever you need to bind to a JavaScript class constructor that requires the new keword for instantiation.|
122
124
123
125
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#new-decorator).|};
124
126
] );
125
-
( "obj",
127
+
( Local "obj",
126
128
[
127
129
{|The `@obj` decorator is used to create functions that return JavaScript objects with properties that match the function's parameter labels.
128
130
129
131
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#obj-decorator).|};
130
132
] );
131
-
( "raises",
133
+
( Local "raises",
132
134
[
133
135
{|The `@raises` decorator is for reanalyze, a static analysis tool for ReScript that can perform exception analysis.
134
136
@@ -138,7 +140,7 @@ Example `@raises(Exn)` or `@raises([E1, E2, E3])` for multiple exceptions.
138
140
[Read more andsee examples in the documentation](https://github.com/rescript-association/reanalyze/blob/master/EXCEPTION.md).
139
141
> Hint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!|};
140
142
] );
141
-
( "react.component",
143
+
( Local "react.component",
142
144
[
143
145
{|The `@react.component` decorator is used to annotate functions that are RescriptReact components.
144
146
@@ -148,76 +150,89 @@ Note: The `@react.component` decorator requires the react-jsx config to be set i
148
150
149
151
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator).|};
150
152
] );
151
-
( "return",
153
+
( Local "return",
152
154
[
153
155
{|The `@return` decorator is used to control how `null` and `undefined` values are converted to option types in ReScript.
154
156
155
157
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#return-decorator).|};
156
158
] );
157
-
( "scope",
159
+
( Local "scope",
158
160
[
159
161
{|The `@scope` decorator is used with other decorators such as `@val` and `@module` to declare a parent scope for the binding.
160
162
161
163
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#scope-decorator).|};
162
164
] );
163
-
( "send",
165
+
( Local "send",
164
166
[
165
167
{|The `@send` decorator is used to bind to a method on an object or array.
166
168
167
169
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#send-decorator).|};
168
170
] );
169
-
( "set",
171
+
( Local "set",
170
172
[
171
173
{|The `@set` decorator is used to set a property of an object.
172
174
173
175
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#set-decorator).|};
174
176
] );
175
-
( "set_index",
177
+
( Local "set_index",
176
178
[
177
179
{|The `@set_index` decorator is used to set a dynamic property on an object, or an index of an array.
178
180
179
181
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#set-index-decorator).|};
180
182
] );
181
-
( "string",
183
+
( Local "string",
182
184
[
183
185
{|The `@string` decorator can be used with polymorphic variants andthe `@as` decorator on externals to modify the string values used for the variants in the compiled JavaScript.
184
186
185
187
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#string-decorator).|};
186
188
] );
187
-
( "this",
189
+
( Local "this",
188
190
[
189
191
{|The `@this` decorator may be used to bind to an external callback function that require access to a this context.
190
192
191
193
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#this-decorator).|};
192
194
] );
193
-
( "unboxed",
195
+
( Local "unboxed",
194
196
[
195
197
{|The `@unboxed` decorator provides a way to unwrap variant constructors that have a single argument, or record objects that have a single field.
196
198
197
199
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#unboxed-decorator).|};
198
200
] );
199
-
( "uncurry",
201
+
( Local "uncurry",
200
202
[
201
203
{|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 (`(.) => { ... }`).
202
204
203
205
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#uncurry-decorator).|};
204
206
] );
205
-
( "unwrap",
207
+
( Local "unwrap",
206
208
[
207
209
{|The `@unwrap` decorator may be used when binding to external functions that accept multiple types for an argument.
208
210
209
211
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#unwrap-decorator).|};
210
212
] );
211
-
( "val",
213
+
( Local "val",
212
214
[
213
215
{|The `@val` decorator allows you to bind to JavaScript values that are on the global scope.
214
216
215
217
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#val-decorator).|};
216
218
] );
217
-
( "variadic",
219
+
( Local "variadic",
218
220
[
219
221
{|The `@variadic` decorator is used to model JavaScript functions that take a variable number of arguments, where all arguments are of the same type.
220
222
221
223
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#variadic-decorator).|};
222
224
] );
225
+
( TopLevel "directive",
226
+
[
227
+
{|The `@@directive` will output that string verbatim at the very top of the generated JavaScript file, before any imports.
228
+
229
+
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#directive-decorator).|};
230
+
] );
231
+
( TopLevel "warning",
232
+
[
233
+
{|The @@warning decorator is used to modify the enabled compiler warnings for the current module. See here for all available warning numbers.
234
+
235
+
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#module-warning-decorator).
0 commit comments