| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library barback.transformer.declaring_aggregate_transformer; | |
| 6 | |
| 7 import 'declaring_aggregate_transform.dart'; | |
| 8 | |
| 9 /// An interface for [Transformer]s that can cheaply figure out which assets | |
| 10 /// they'll emit without doing the work of actually creating those assets. | |
| 11 /// | |
| 12 /// If a transformer implements this interface, that allows barback to perform | |
| 13 /// optimizations to make the asset graph work more smoothly. | |
| 14 abstract class DeclaringAggregateTransformer { | |
| 15 /// Declare which assets would be emitted for the primary input ids specified | |
| 16 /// by [transform]. | |
| 17 /// | |
| 18 /// This works a little like [AggregateTransformer.apply], with two main | |
| 19 /// differences. First, instead of having access to the primary inputs' | |
| 20 /// contents, it only has access to their ids. Second, instead of emitting | |
| 21 /// [Asset]s, it just emits [AssetId]s through [transform.addOutputId]. | |
| 22 /// | |
| 23 /// If this does asynchronous work, it should return a [Future] that completes | |
| 24 /// once it's finished. | |
| 25 /// | |
| 26 /// This may complete before [DeclaringAggregateTransform.primaryIds] stream | |
| 27 /// is closed. For example, it may know that each key will only have two | |
| 28 /// inputs associated with it, and so use `transform.primaryIds.take(2)` to | |
| 29 /// access only those inputs' ids. | |
| 30 declareOutputs(DeclaringAggregateTransform transform); | |
| 31 } | |
| OLD | NEW |