OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library barback.package_provider; | 5 library barback.package_provider; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'asset/asset.dart'; | 9 import 'asset.dart'; |
10 import 'asset/asset_id.dart'; | 10 import 'asset_id.dart'; |
11 | 11 |
12 /// API for locating and accessing packages on disk. | 12 /// API for locating and accessing packages on disk. |
13 /// | 13 /// |
14 /// Implemented by pub and provided to barback so that it isn't coupled | 14 /// Implemented by pub and provided to barback so that it isn't coupled |
15 /// directly to pub. | 15 /// directly to pub. |
16 abstract class PackageProvider { | 16 abstract class PackageProvider { |
17 /// The names of all packages that can be provided by this provider. | 17 /// The names of all packages that can be provided by this provider. |
18 /// | 18 /// |
19 /// This is equal to the transitive closure of the entrypoint package | 19 /// This is equal to the transitive closure of the entrypoint package |
20 /// dependencies. | 20 /// dependencies. |
21 Iterable<String> get packages; | 21 Iterable<String> get packages; |
22 | 22 |
23 /// Loads an asset from disk. | 23 /// Loads an asset from disk. |
24 /// | 24 /// |
25 /// This should be re-entrant; it may be called multiple times with the same | 25 /// This should be re-entrant; it may be called multiple times with the same |
26 /// id before the previously returned future has completed. | 26 /// id before the previously returned future has completed. |
27 Future<Asset> getAsset(AssetId id); | 27 Future<Asset> getAsset(AssetId id); |
28 } | 28 } |
OLD | NEW |