rbs 0.3.1 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddacdf6b9e8b5297a7a5845aa715ffc9202fa42a6a81b492e40cbeeabbc4c311
4
- data.tar.gz: f79a70c89b49abc949dfb9d168bac9684d90036b4ef496c839ec24c20be4d972
3
+ metadata.gz: 77a83be097e5de26f4541a25fb744a31574d0f0b94d94848e11cae49d095693a
4
+ data.tar.gz: 4619e6ae9f31e32ac6d2da902b11980644df037b9d254b5919fe2eff1f43bdc7
5
5
  SHA512:
6
- metadata.gz: e6beaa6a9cb76ff862057a2bc8be4260e804c3b2737ccf0d1811b0c2d5aa5aa35b3832c01d936de76ee5f2ef6d64b2182b9830dc2ae178d54971332360e190b4
7
- data.tar.gz: ce16ec8b1174d15f5f0acf6fc9285abede6554bb036252f5ad4efab162e8a1976b9eefa37f1136a2e6b6d18e5f11505204f7fe15edf4f3c9d64a72329c9db63a
6
+ metadata.gz: '095abed7b0453d72a545760d8a165bb2a3415e3f741b004926b600b8e1e1260dc752e91d86d33e0c770d3011885bea1fa728708707687c59d3a1ad9707b672c7'
7
+ data.tar.gz: 94b3f4fc317d701c327b7519068ec590409ceff1208660c44f83440c9d3ed419c83ca29adf7137c10a1fb7c3d7ed7b0808e0a8a5fc5dedd66ca900981674ae90
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.4.0 (2020-06-15)
6
+
7
+ * Signature update for `Fiber`, `Encoding`, and `Enumerator`.
8
+ * Fix syntax error for underscore and `!` `?` [#304](https://github.com/ruby/rbs/pull/304)
9
+ * Improved return type inference in `rbs prototype rb` [#303](https://github.com/ruby/rbs/pull/303)
10
+ * Skip anonymous modules/classes in `rbs prototype runtime` [#302](https://github.com/ruby/rbs/pull/302)
11
+ * Fix `--require-relative` option in `rbs prototype runtime` [#299](https://github.com/ruby/rbs/pull/299)
12
+ * Add JSON schema for `rbs ast` [#295](https://github.com/ruby/rbs/pull/295)
13
+
5
14
  ## 0.3.1 (2020-05-22)
6
15
 
7
16
  * Fix constant resolution again [#289](https://github.com/ruby/rbs/pull/289)
data/COPYING CHANGED
@@ -1,4 +1,4 @@
1
- ruby-signature is copyrighted free software by Soutaro Matsumoto <matsumoto@soutaro.com>.
1
+ rbs is copyrighted free software by Soutaro Matsumoto <matsumoto@soutaro.com>.
2
2
  You can redistribute it and/or modify it under either the terms of the
3
3
  2-clause BSDL (see the file BSDL), or the conditions below:
4
4
 
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in ruby-signature.gemspec
3
+ # Specify your gem's dependencies in rbs.gemspec
4
4
  gemspec
5
5
 
6
- gem "ruby-signature-amber", path: "test/assets/test-gem"
6
+ gem "rbs-amber", path: "test/assets/test-gem"
data/README.md CHANGED
@@ -22,7 +22,7 @@ $ rbs methods ::Object
22
22
  $ rbs method ::Object tap
23
23
  ```
24
24
 
25
- ### rbs [--class|--module|interface] list
25
+ ### rbs list [--class|--module|--interface]
26
26
 
27
27
  ```
28
28
  $ rbs list
@@ -90,4 +90,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
90
90
 
91
91
  ## Contributing
92
92
 
93
- Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/ruby-signature.
93
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/rbs.
data/Rakefile CHANGED
@@ -45,7 +45,7 @@ namespace :generate do
45
45
  raise "#{path} already exists!" if path.exist?
46
46
 
47
47
  require "erb"
48
- require "ruby/signature"
48
+ require "rbs"
49
49
 
50
50
  class TestTemplateBuilder
51
51
  attr_reader :klass, :env
@@ -9,8 +9,6 @@ unless RUBY_27
9
9
  exit
10
10
  end
11
11
 
12
- require "pathname"
13
-
14
12
  ARGV.each do |arg|
15
13
  load arg
16
14
  end
@@ -16,7 +16,7 @@ See [syntax guide](syntax.md).
16
16
  ## Testing signatures
17
17
 
18
18
  When you finish writing signature, you may want to test the signature.
19
- ruby-signature provides a feature to test your signature.
19
+ rbs provides a feature to test your signature.
20
20
 
21
21
  ```
22
22
  $ RBS_TEST_TARGET='Foo::*' bundle exec ruby -r rbs/test/setup test/foo_test.rb
@@ -68,7 +68,7 @@ ERROR -- : [Kaigi::Conference#speakers] UnexpectedBlockError: unexpected block i
68
68
  ### UnresolvedOverloadingError
69
69
 
70
70
  The error means there is a type error on overloaded methods.
71
- The `ruby-signature` test framework tries to the best error message for overloaded methods too, but it reports the `UnresolvedOverloadingError` when it fails.
71
+ The `rbs` test framework tries to the best error message for overloaded methods too, but it reports the `UnresolvedOverloadingError` when it fails.
72
72
 
73
73
  ## Setting up the test
74
74
 
@@ -84,13 +84,13 @@ You can do it using `-r` option through command line argument or the `RUBYOPT` e
84
84
 
85
85
  ```
86
86
  $ ruby -r rbs/test/setup run_tests.rb
87
- $ RUBYOPT='-rruby/signature/test/setup' rake test
87
+ $ RUBYOPT='-rrbs/test/setup' rake test
88
88
  ```
89
89
 
90
90
  When you are using Bundler, you may need to require `bundler/setup` explicitly.
91
91
 
92
92
  ```
93
- $ RUBYOPT='-rbundler/setup -rruby/signature/test/setup' bundle exec rake test
93
+ $ RUBYOPT='-rbundler/setup -rrbs/test/setup' bundle exec rake test
94
94
  ```
95
95
 
96
96
  ### Environment variables
@@ -109,7 +109,7 @@ You need to specify `RBS_TEST_TARGET` to run the test, and you can customize the
109
109
 
110
110
  `RBS_TEST_SKIP` is to skip some of the classes which matches with `RBS_TEST_TARGET`.
111
111
 
112
- `RBS_TEST_OPT` is to pass the options for ruby signature handling.
112
+ `RBS_TEST_OPT` is to pass the options for rbs handling.
113
113
  You may need to specify `-r` or `-I` to load signatures.
114
114
  The default is `-I sig`.
115
115
 
@@ -131,7 +131,7 @@ $ RBS_TEST_LOGLEVEL=error \
131
131
  RBS_TEST_SKIP='Kaigi::MonkeyPatch' \
132
132
  RBS_TEST_OPT='-rset -rpathname -Isig -Iprivate' \
133
133
  RBS_TEST_RAISE=true \
134
- RUBYOPT='-rbundler/setup -rruby/signature/test/setup' \
134
+ RUBYOPT='-rbundler/setup -rrbs/test/setup' \
135
135
  bundle exec rake test
136
136
  ```
137
137
 
@@ -1,6 +1,6 @@
1
1
  # Stdlib Signatures Guide
2
2
 
3
- This is a guide for contributing to `ruby-signature` by writing/revising stdlib signatures.
3
+ This is a guide for contributing to `rbs` by writing/revising stdlib signatures.
4
4
 
5
5
  The typical steps of writing signatures will be like the following:
6
6
 
@@ -17,7 +17,7 @@ To write signatures see [syntax guide](syntax.md).
17
17
 
18
18
  ## Generating prototypes
19
19
 
20
- `ruby-signature` provides a tool to generate a prototype of signatures, `rbs prototype`.
20
+ `rbs` provides a tool to generate a prototype of signatures, `rbs prototype`.
21
21
  It provides several options, `rbi` from Sorbet RBI files, `rb` from Ruby code, and `runtime` from runtime API.
22
22
  `runtime` should be the best option for standard libraries because they may be implemented in C, no Ruby source code.
23
23
 
@@ -147,6 +147,6 @@ If the execution of the program escape from the class definition, the instrument
147
147
  You can run the test with:
148
148
 
149
149
  ```
150
- $ bundle exec ruby bin/test_runner.rb # Run all tests
150
+ $ bundle exec rake stdlib_test # Run all tests
151
151
  $ bundle exec ruby test/stdlib/String_test.rb # Run specific tests
152
152
  ```
@@ -4,7 +4,15 @@ module RBS
4
4
  class ModuleTypeParams
5
5
  attr_reader :params
6
6
 
7
- TypeParam = Struct.new(:name, :variance, :skip_validation, keyword_init: true)
7
+ TypeParam = Struct.new(:name, :variance, :skip_validation, keyword_init: true) do
8
+ def to_json(*a)
9
+ {
10
+ name: name,
11
+ variance: variance,
12
+ skip_validation: skip_validation,
13
+ }.to_json(*a)
14
+ end
15
+ end
8
16
 
9
17
  def initialize()
10
18
  @params = []
@@ -372,7 +372,7 @@ module RBS
372
372
  end
373
373
 
374
374
  def run_version(args, options)
375
- stdout.puts "ruby-signature #{VERSION}"
375
+ stdout.puts "rbs #{VERSION}"
376
376
  end
377
377
 
378
378
  def run_paths(args, options)
@@ -449,7 +449,7 @@ module RBS
449
449
  end
450
450
 
451
451
  relative_libs.each do |lib|
452
- require(lib)
452
+ eval("require_relative(lib)", binding, "rbs")
453
453
  end
454
454
 
455
455
  decls = Prototype::Runtime.new(patterns: args, env: env, merge: merge, owners_included: owners_included).decls
@@ -500,13 +500,13 @@ rule
500
500
  | tQUOTEDIDENT
501
501
  | tWRITE_ATTR
502
502
 
503
- method_name0: tUIDENT | tLIDENT | identifier_keywords
503
+ method_name0: tUIDENT | tLIDENT | tINTERFACEIDENT | identifier_keywords
504
504
 
505
505
  identifier_keywords:
506
506
  kCLASS | kVOID | kNIL | kTRUE | kFALSE | kANY | kUNTYPED | kTOP | kBOT | kINSTANCE | kBOOL | kSINGLETON
507
507
  | kTYPE | kMODULE | kPRIVATE | kPUBLIC | kEND | kINCLUDE | kEXTEND | kPREPEND
508
508
  | kATTRREADER | kATTRACCESSOR | kATTRWRITER | kDEF | kEXTENSION | kSELF | kINCOMPATIBLE
509
- | kUNCHECKED
509
+ | kUNCHECKED | kINTERFACE | kSUPER | kALIAS | kOUT | kIN
510
510
 
511
511
  module_type_params:
512
512
  { result = nil }
@@ -328,7 +328,19 @@ module RBS
328
328
  body = node.children[2]
329
329
  return Types::Bases::Nil.new(location: nil) unless body
330
330
 
331
- literal_to_type(body)
331
+ if body.type == :BLOCK
332
+ return_stmts = any_node?(body) do |n|
333
+ n.type == :RETURN
334
+ end&.map do |return_node|
335
+ returned_value = return_node.children[0]
336
+ returned_value ? literal_to_type(returned_value) : Types::Bases::Nil.new(location: nil)
337
+ end || []
338
+ last_node = body.children.last
339
+ last_evaluated = last_node ? literal_to_type(last_node) : Types::Bases::Nil.new(location: nil)
340
+ types_to_union_type([*return_stmts, last_evaluated])
341
+ else
342
+ literal_to_type(body)
343
+ end
332
344
  end
333
345
 
334
346
  def literal_to_type(node)
@@ -393,7 +405,7 @@ module RBS
393
405
  value_types << literal_to_type(v)
394
406
  end
395
407
 
396
- if key_types.all? { |t| t.is_a?(Types::Literal) }
408
+ if !key_types.empty? && key_types.all? { |t| t.is_a?(Types::Literal) }
397
409
  fields = key_types.map { |t| t.literal }.zip(value_types).to_h
398
410
  Types::Record.new(fields: fields, location: nil)
399
411
  else
@@ -408,9 +420,11 @@ module RBS
408
420
 
409
421
  def types_to_union_type(types)
410
422
  return untyped if types.empty?
411
- return untyped if types.include?(untyped)
412
423
 
413
- Types::Union.new(types: types.uniq, location: nil)
424
+ uniq = types.uniq
425
+ return uniq.first if uniq.size == 1
426
+
427
+ Types::Union.new(types: uniq, location: nil)
414
428
  end
415
429
 
416
430
  def range_element_type(types)
@@ -281,6 +281,11 @@ module RBS
281
281
  value = mod.const_get(name)
282
282
 
283
283
  next if value.is_a?(Class) || value.is_a?(Module)
284
+ unless value.class.name
285
+ RBS.logger.warn("Skipping constant #{name} #{value} of #{mod} as an instance of anonymous class")
286
+ next
287
+ end
288
+
284
289
  type = case value
285
290
  when true, false
286
291
  Types::Bases::Bool.new(location: nil)
@@ -306,6 +311,9 @@ module RBS
306
311
  type_name = to_type_name(mod.name)
307
312
  super_class = if mod.superclass == ::Object
308
313
  nil
314
+ elsif mod.superclass.name.nil?
315
+ RBS.logger.warn("Skipping anonymous superclass #{mod.superclass} of #{mod}")
316
+ nil
309
317
  else
310
318
  AST::Declarations::Class::Super.new(name: to_type_name(mod.superclass.name), args: [])
311
319
  end
@@ -321,6 +329,11 @@ module RBS
321
329
  )
322
330
 
323
331
  each_mixin(mod.included_modules, *mod.superclass.included_modules, *mod.included_modules.flat_map(&:included_modules)) do |included_module|
332
+ unless included_module.name
333
+ RBS.logger.warn("Skipping anonymous module #{included_module} included in #{mod}")
334
+ next
335
+ end
336
+
324
337
  module_name = to_type_name(included_module.name)
325
338
  if module_name.namespace == type_name.namespace
326
339
  module_name = TypeName.new(name: module_name.name, namespace: Namespace.empty)
@@ -343,6 +356,11 @@ module RBS
343
356
  end
344
357
 
345
358
  def generate_module(mod)
359
+ unless mod.name
360
+ RBS.logger.warn("Skipping anonymous module #{mod}")
361
+ return
362
+ end
363
+
346
364
  type_name = to_type_name(mod.name)
347
365
 
348
366
  decl = AST::Declarations::Module.new(
@@ -356,6 +374,11 @@ module RBS
356
374
  )
357
375
 
358
376
  each_mixin(mod.included_modules, *mod.included_modules.flat_map(&:included_modules), namespace: type_name.namespace) do |included_module|
377
+ unless included_module.name
378
+ RBS.logger.warn("Skipping anonymous module #{included_module} included in #{mod}")
379
+ next
380
+ end
381
+
359
382
  module_name = to_type_name(included_module.name)
360
383
  if module_name.namespace == type_name.namespace
361
384
  module_name = TypeName.new(name: module_name.name, namespace: Namespace.empty)
@@ -1,3 +1,3 @@
1
1
  module RBS
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -43,4 +43,5 @@ Gem::Specification.new do |spec|
43
43
  spec.add_development_dependency "rubocop-rubycw"
44
44
  spec.add_development_dependency "minitest-reporters", "~> 1.3.6"
45
45
  spec.add_development_dependency "json", "~> 2.3.0"
46
+ spec.add_development_dependency "json-schema", "~> 2.8"
46
47
  end
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "title": "Annotation associated to a declaration or a member: `%a{rbs:test}`, `%a{steep:deprecated}`, ...",
4
+ "type": "object",
5
+ "properties": {
6
+ "string": {
7
+ "type": "string"
8
+ },
9
+ "location": {
10
+ "$ref": "location.json"
11
+ }
12
+ },
13
+ "required": ["string", "location"]
14
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "definitions": {
4
+ "comment": {
5
+ "type": "object",
6
+ "properties": {
7
+ "string": {
8
+ "type": "string"
9
+ },
10
+ "location": {
11
+ "$ref": "location.json"
12
+ }
13
+ },
14
+ "required": ["string", "location"]
15
+ }
16
+ },
17
+ "title": "Comment associated with a declaration or a member",
18
+ "oneOf": [
19
+ {
20
+ "$ref": "#/definitions/comment"
21
+ },
22
+ {
23
+ "type": "null"
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,327 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "definitions": {
4
+ "alias": {
5
+ "title": "Type alias declaration: `type foo = Integer`, ...",
6
+ "type": "object",
7
+ "properties": {
8
+ "declaration": {
9
+ "type": "string",
10
+ "enum": ["alias"]
11
+ },
12
+ "name": {
13
+ "type": "string"
14
+ },
15
+ "type": {
16
+ "$ref": "types.json"
17
+ },
18
+ "annotations": {
19
+ "type": "array",
20
+ "items": {
21
+ "$ref": "annotation.json"
22
+ }
23
+ },
24
+ "location": {
25
+ "$ref": "location.json"
26
+ },
27
+ "comment": {
28
+ "$ref": "comment.json"
29
+ }
30
+ },
31
+ "required": ["declaration", "name", "type", "annotations", "location", "comment"]
32
+ },
33
+ "constant": {
34
+ "title": "Constant declaration: `VERSION: String`, ...",
35
+ "type": "object",
36
+ "properties": {
37
+ "declaration": {
38
+ "type": "string",
39
+ "enum": ["constant"]
40
+ },
41
+ "name": {
42
+ "type": "string"
43
+ },
44
+ "type": {
45
+ "$ref": "types.json"
46
+ },
47
+ "location": {
48
+ "$ref": "location.json"
49
+ },
50
+ "comment": {
51
+ "$ref": "comment.json"
52
+ }
53
+ },
54
+ "required": ["declaration", "name", "type", "comment", "location"]
55
+ },
56
+ "global": {
57
+ "title": "Global declaration: `$DEBUG: bool`, ...",
58
+ "type": "object",
59
+ "properties": {
60
+ "declaration": {
61
+ "type": "string",
62
+ "enum": ["global"]
63
+ },
64
+ "name": {
65
+ "type": "string"
66
+ },
67
+ "type": {
68
+ "$ref": "types.json"
69
+ },
70
+ "location": {
71
+ "$ref": "location.json"
72
+ },
73
+ "comment": {
74
+ "$ref": "comment.json"
75
+ }
76
+ },
77
+ "required": ["declaration", "name", "type", "comment", "location"]
78
+ },
79
+ "moduleTypeParam": {
80
+ "type": "object",
81
+ "properties": {
82
+ "name": {
83
+ "type": "string"
84
+ },
85
+ "variance": {
86
+ "enum": ["covariant", "contravariant", "invariant"]
87
+ },
88
+ "skip_validation": {
89
+ "type": "boolean"
90
+ }
91
+ },
92
+ "required": ["name", "variance", "skip_validation"]
93
+ },
94
+ "classMember": {
95
+ "oneOf": [
96
+ {
97
+ "$ref": "members.json#/definitions/methodDefinition"
98
+ },
99
+ {
100
+ "$ref": "members.json#/definitions/variable"
101
+ },
102
+ {
103
+ "$ref": "members.json#/definitions/include"
104
+ },
105
+ {
106
+ "$ref": "members.json#/definitions/extend"
107
+ },
108
+ {
109
+ "$ref": "members.json#/definitions/prepend"
110
+ },
111
+ {
112
+ "$ref": "members.json#/definitions/attribute"
113
+ },
114
+ {
115
+ "$ref": "members.json#/definitions/visibility"
116
+ },
117
+ {
118
+ "$ref": "members.json#/definitions/alias"
119
+ }
120
+ ]
121
+ },
122
+ "class": {
123
+ "title": "Class declaration",
124
+ "type": "object",
125
+ "properties": {
126
+ "declaration": {
127
+ "enum": ["class"]
128
+ },
129
+ "name": {
130
+ "type": "string"
131
+ },
132
+ "type_params": {
133
+ "type": "object",
134
+ "properties": {
135
+ "params": {
136
+ "type": "array",
137
+ "items": {
138
+ "$ref": "#/definitions/moduleTypeParam"
139
+ }
140
+ }
141
+ },
142
+ "required": ["params"]
143
+ },
144
+ "members": {
145
+ "type": "array",
146
+ "items": {
147
+ "$ref": "#/definitions/classMember"
148
+ }
149
+ },
150
+ "super_class": {
151
+ "oneOf": [
152
+ {
153
+ "type": "null"
154
+ },
155
+ {
156
+ "type": "object",
157
+ "properties": {
158
+ "name": {
159
+ "type": "string"
160
+ },
161
+ "args": {
162
+ "type": "array",
163
+ "items": {
164
+ "$ref": "types.json"
165
+ }
166
+ }
167
+ },
168
+ "required": ["name", "args"]
169
+ }
170
+ ]
171
+ },
172
+ "annotations": {
173
+ "type": "array",
174
+ "items": {
175
+ "$ref": "annotation.json"
176
+ }
177
+ },
178
+ "comment": {
179
+ "$ref": "comment.json"
180
+ },
181
+ "location": {
182
+ "$ref": "location.json"
183
+ }
184
+ },
185
+ "required": ["declaration", "name", "type_params", "members", "super_class", "annotations", "comment", "location"]
186
+ },
187
+ "module": {
188
+ "type": "object",
189
+ "properties": {
190
+ "declaration": {
191
+ "enum": ["module"]
192
+ },
193
+ "name": {
194
+ "type": "string"
195
+ },
196
+ "type_params": {
197
+ "type": "object",
198
+ "properties": {
199
+ "params": {
200
+ "type": "array",
201
+ "items": {
202
+ "$ref": "#/definitions/moduleTypeParam"
203
+ }
204
+ }
205
+ },
206
+ "required": ["params"]
207
+ },
208
+ "members": {
209
+ "type": "array",
210
+ "items": {
211
+ "$ref": "#/definitions/classMember"
212
+ }
213
+ },
214
+ "self_type": {
215
+ "oneOf": [
216
+ {
217
+ "$ref": "types.json"
218
+ },
219
+ {
220
+ "type": "null"
221
+ }
222
+ ]
223
+ },
224
+ "annotations": {
225
+ "type": "array",
226
+ "items": {
227
+ "$ref": "annotation.json"
228
+ }
229
+ },
230
+ "comment": {
231
+ "$ref": "comment.json"
232
+ },
233
+ "location": {
234
+ "$ref": "location.json"
235
+ }
236
+ },
237
+ "required": ["declaration", "name", "type_params", "members", "self_type", "annotations", "location", "comment"]
238
+ },
239
+ "interfaceMember": {
240
+ "oneOf": [
241
+ {
242
+ "allOf": [
243
+ {
244
+ "$ref": "members.json#/definitions/methodDefinition"
245
+ },
246
+ {
247
+ "type": "object",
248
+ "properties": {
249
+ "kind": {
250
+ "enum": ["instance"]
251
+ }
252
+ }
253
+ }
254
+ ]
255
+ },
256
+ {
257
+ "$ref": "members.json#/definitions/include"
258
+ },
259
+ {
260
+ "$ref": "members.json#/definitions/alias"
261
+ }
262
+ ]
263
+ },
264
+ "interface": {
265
+ "type": "object",
266
+ "properties": {
267
+ "declaration": {
268
+ "enum": ["interface"]
269
+ },
270
+ "name": {
271
+ "type": "string"
272
+ },
273
+ "type_params": {
274
+ "type": "object",
275
+ "properties": {
276
+ "params": {
277
+ "type": "array",
278
+ "items": {
279
+ "$ref": "#/definitions/moduleTypeParam"
280
+ }
281
+ }
282
+ },
283
+ "required": ["params"]
284
+ },
285
+ "members": {
286
+ "type": "array",
287
+ "items": {
288
+ "$ref": "#/definitions/interfaceMember"
289
+ }
290
+ },
291
+ "annotations": {
292
+ "type": "array",
293
+ "items": {
294
+ "$ref": "annotation.json"
295
+ }
296
+ },
297
+ "comment": {
298
+ "$ref": "comment.json"
299
+ },
300
+ "location": {
301
+ "$ref": "location.json"
302
+ }
303
+ },
304
+ "required": ["declaration", "name", "type_params", "members", "annotations", "comment", "location"]
305
+ }
306
+ },
307
+ "oneOf": [
308
+ {
309
+ "$ref": "#/definitions/alias"
310
+ },
311
+ {
312
+ "$ref": "#/definitions/constant"
313
+ },
314
+ {
315
+ "$ref": "#/definitions/global"
316
+ },
317
+ {
318
+ "$ref": "#/definitions/class"
319
+ },
320
+ {
321
+ "$ref": "#/definitions/module"
322
+ },
323
+ {
324
+ "$ref": "#/definitions/interface"
325
+ }
326
+ ]
327
+ }