|
2 | 2 | // for details. All rights reserved. Use of this source code is governed by a |
3 | 3 | // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
|
| 5 | +import 'dart:typed_data'; |
| 6 | + |
5 | 7 | import 'package:dwds/src/debugging/metadata/provider.dart'; |
6 | 8 | import 'package:dwds/src/readers/asset_reader.dart'; |
7 | 9 | import 'package:dwds/src/services/expression_compiler.dart'; |
@@ -41,6 +43,10 @@ abstract class LoadStrategy { |
41 | 43 | /// argument which is the module name to load. |
42 | 44 | String get loadModuleSnippet; |
43 | 45 |
|
| 46 | + /// The relative root path for library paths. The current directory will be |
| 47 | + /// used if this is not overridden. |
| 48 | + String? get libraryRoot => null; |
| 49 | + |
44 | 50 | /// The reload configuration for this strategy, e.g. liveReload. |
45 | 51 | ReloadConfiguration get reloadConfiguration; |
46 | 52 |
|
@@ -107,6 +113,15 @@ abstract class LoadStrategy { |
107 | 113 | /// Returns `null` if not a google3 app. |
108 | 114 | String? g3RelativePath(String absolutePath); |
109 | 115 |
|
| 116 | + /// Returns a loader to read the content of the package configuration. |
| 117 | + /// |
| 118 | + /// The package configuration URIs will be resolved relative to |
| 119 | + /// [packageConfigPath], but the loader can read the config from a different |
| 120 | + /// location. |
| 121 | + /// |
| 122 | + /// If null, the default loader will read from [packageConfigPath]. |
| 123 | + Future<Uint8List?> Function(Uri uri)? get packageConfigLoader => null; |
| 124 | + |
110 | 125 | /// The absolute path to the app's package configuration. |
111 | 126 | String get packageConfigPath { |
112 | 127 | return _packageConfigPath ?? _defaultPackageConfigPath; |
|
0 commit comments