| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Data structures representing an API definition, and visitor base classes | 6 * Data structures representing an API definition, and visitor base classes |
| 7 * for visiting those data structures. | 7 * for visiting those data structures. |
| 8 */ | 8 */ |
| 9 library api; | 9 library api; |
| 10 | 10 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 fields.add(new TypeObjectField('params', params, null)); | 277 fields.add(new TypeObjectField('params', params, null)); |
| 278 } | 278 } |
| 279 return new TypeObject(fields, null); | 279 return new TypeObject(fields, null); |
| 280 } | 280 } |
| 281 | 281 |
| 282 /** | 282 /** |
| 283 * Get the full type of the response object, including the common "id" and | 283 * Get the full type of the response object, including the common "id" and |
| 284 * "error" fields. | 284 * "error" fields. |
| 285 */ | 285 */ |
| 286 TypeDecl get responseType { | 286 TypeDecl get responseType { |
| 287 List<TypeObjectField> fields = [new TypeObjectField('id', new TypeReference( | 287 List<TypeObjectField> fields = [ |
| 288 'String', null), null), new TypeObjectField('error', new TypeReference('
Error', | 288 new TypeObjectField('id', new TypeReference('String', null), null), |
| 289 null), null, optional: true)]; | 289 new TypeObjectField( |
| 290 'error', |
| 291 new TypeReference('RequestError', null), |
| 292 null, |
| 293 optional: true)]; |
| 290 if (result != null) { | 294 if (result != null) { |
| 291 fields.add(new TypeObjectField('result', result, null)); | 295 fields.add(new TypeObjectField('result', result, null)); |
| 292 } | 296 } |
| 293 return new TypeObject(fields, null); | 297 return new TypeObject(fields, null); |
| 294 } | 298 } |
| 295 } | 299 } |
| 296 | 300 |
| 297 /** | 301 /** |
| 298 * Description of a request method. | 302 * Description of a request method. |
| 299 */ | 303 */ |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 } | 476 } |
| 473 | 477 |
| 474 /** | 478 /** |
| 475 * Description of a single allowed value for an enum. | 479 * Description of a single allowed value for an enum. |
| 476 */ | 480 */ |
| 477 class TypeEnumValue extends ApiNode { | 481 class TypeEnumValue extends ApiNode { |
| 478 final String value; | 482 final String value; |
| 479 | 483 |
| 480 TypeEnumValue(this.value, dom.Element html) : super(html); | 484 TypeEnumValue(this.value, dom.Element html) : super(html); |
| 481 } | 485 } |
| OLD | NEW |