16 lines
683 B
Dart
16 lines
683 B
Dart
import '../domain/artifact_url.dart';
|
|
import 'artifact_external_open_stub.dart'
|
|
if (dart.library.js_interop) 'artifact_external_open_web.dart'
|
|
if (dart.library.io) 'artifact_external_open_io.dart'
|
|
as impl;
|
|
|
|
/// Opens an already validated artifact url with the host's external handler.
|
|
///
|
|
/// The url must come from [resolveArtifactUrl]; this capability never resolves,
|
|
/// rewrites, fetches or previews it. Returns whether the host accepted the
|
|
/// request, so a refusal is reported instead of being silently swallowed.
|
|
typedef ArtifactExternalOpen = Future<bool> Function(Uri uri);
|
|
|
|
Future<bool> openArtifactExternally(Uri uri) =>
|
|
impl.openArtifactExternally(uri);
|