// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import 'dart:async'; import 'config.dart'; import 'encoded_asset.dart'; import 'validation.dart'; /// A list of error messages from validation. typedef ValidationErrors = List; /// An extension to the [ProtocolBase] for `hook/build.dart` and /// `hook/link.dart`. /// /// The extension contains callbacks to /// 1. setup the input, and /// 2. validate syntactic and semantic constraints. abstract interface class ProtocolExtension { /// The [HookConfig.buildAssetTypes] this extension adds. // List get buildAssetTypes; /// Setup the [BuildConfig] for this extension. void setupBuildInput(BuildInputBuilder input); /// Setup the [HookConfig] for this extension. void setupLinkInput(LinkInputBuilder input); /// Reports errors from this extension on the [BuildInput]. Future validateBuildInput(BuildInput input); /// Reports errors from this extension on the [LinkInput]. Future validateBuildOutput( BuildInput input, BuildOutput output, ); /// Reports errors from this extension on the [LinkInput]. Future validateLinkInput(LinkInput input); /// Reports errors from this extension on the [LinkOutput]. Future validateLinkOutput( LinkInput input, LinkOutput output, ); /// Reports errors on the complete set of assets after all hooks are run. /// /// Can be used to validate that there are no asset-id or shared library name /// collisions. Future validateApplicationAssets(List assets); }