Chromium Code Reviews| Index: pkg/docgen/lib/src/models.dart |
| diff --git a/pkg/docgen/lib/src/models.dart b/pkg/docgen/lib/src/models.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c4cd3842b3e32446a8ddf2705af76aa254be2948 |
| --- /dev/null |
| +++ b/pkg/docgen/lib/src/models.dart |
| @@ -0,0 +1,24 @@ |
| +library docgen.moedls; |
|
Alan Knight
2014/03/12 18:17:56
typo
kevmoo
2014/03/17 02:01:29
Done.
|
| + |
| +import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/source_mirrors.dart'; |
| +import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart' |
| + as dart2js_util; |
| + |
| +/// Docgen representation of an item to be documented, that wraps around a |
| +/// dart2js mirror. |
| +abstract class MirrorBased { |
| + /// The original dart2js mirror around which this object wraps. |
| + DeclarationMirror get mirror; |
| +} |
| + |
| +/// A Docgen wrapper around the dart2js mirror for a generic type. |
| +class Generic extends MirrorBased { |
| + final TypeVariableMirror mirror; |
| + |
| + Generic(this.mirror); |
| + |
| + Map toMap() => { |
| + 'name': dart2js_util.nameOf(mirror), |
| + 'type': dart2js_util.qualifiedNameOf(mirror.upperBound) |
| + }; |
| +} |
|
Emily Fortuna
2014/03/06 22:05:38
what about putting Type and Parameter here, too? T
kevmoo
2014/03/06 22:20:17
I wish, but there is a lot of dependency spaghetti
|