From c9b8e960086587b171270856b3fd38cb278a7a9c Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sat, 3 Sep 2022 00:23:35 +0200 Subject: [PATCH] Avoid using private types in public APIs --- lib/src/callable.dart | 4 ++-- lib/src/callable/async_built_in.dart | 6 +++--- lib/src/callable/built_in.dart | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/src/callable.dart b/lib/src/callable.dart index 644877d50..7f8b0c383 100644 --- a/lib/src/callable.dart +++ b/lib/src/callable.dart @@ -10,8 +10,8 @@ import 'exception.dart'; import 'value.dart'; export 'callable/async.dart'; -export 'callable/async_built_in.dart'; -export 'callable/built_in.dart'; +export 'callable/async_built_in.dart' show AsyncBuiltInCallable; +export 'callable/built_in.dart' show BuiltInCallable; export 'callable/plain_css.dart'; export 'callable/user_defined.dart'; diff --git a/lib/src/callable/async_built_in.dart b/lib/src/callable/async_built_in.dart index 6751c0889..ff4513f25 100644 --- a/lib/src/callable/async_built_in.dart +++ b/lib/src/callable/async_built_in.dart @@ -11,7 +11,7 @@ import '../value.dart'; import 'async.dart'; /// An [AsyncBuiltInCallable]'s callback. -typedef _Callback = FutureOr Function(List arguments); +typedef Callback = FutureOr Function(List arguments); /// A callable defined in Dart code. /// @@ -26,7 +26,7 @@ class AsyncBuiltInCallable implements AsyncCallable { final ArgumentDeclaration _arguments; /// The callback to run when executing this callable. - final _Callback _callback; + final Callback _callback; /// Creates a function with a single [arguments] declaration and a single /// [callback]. @@ -76,7 +76,7 @@ class AsyncBuiltInCallable implements AsyncCallable { /// If no exact match is found, finds the closest approximation. Note that this /// doesn't guarantee that [positional] and [names] are valid for the returned /// [ArgumentDeclaration]. - Tuple2 callbackFor( + Tuple2 callbackFor( int positional, Set names) => Tuple2(_arguments, _callback); } diff --git a/lib/src/callable/built_in.dart b/lib/src/callable/built_in.dart index 1b4a2aeb9..8576c5c0c 100644 --- a/lib/src/callable/built_in.dart +++ b/lib/src/callable/built_in.dart @@ -8,7 +8,7 @@ import '../ast/sass.dart'; import '../callable.dart'; import '../value.dart'; -typedef _Callback = Value Function(List arguments); +typedef Callback = Value Function(List arguments); /// A callable defined in Dart code. /// @@ -20,7 +20,7 @@ class BuiltInCallable implements Callable, AsyncBuiltInCallable { final String name; /// The overloads declared for this callable. - final List> _overloads; + final List> _overloads; /// Creates a function with a single [arguments] declaration and a single /// [callback]. @@ -73,7 +73,7 @@ class BuiltInCallable implements Callable, AsyncBuiltInCallable { /// If passed, [url] is the URL of the module in which the function is /// defined. BuiltInCallable.overloadedFunction( - this.name, Map overloads, + this.name, Map overloads, {Object? url}) : _overloads = [ for (var entry in overloads.entries) @@ -91,9 +91,9 @@ class BuiltInCallable implements Callable, AsyncBuiltInCallable { /// If no exact match is found, finds the closest approximation. Note that this /// doesn't guarantee that [positional] and [names] are valid for the returned /// [ArgumentDeclaration]. - Tuple2 callbackFor( + Tuple2 callbackFor( int positional, Set names) { - Tuple2? fuzzyMatch; + Tuple2? fuzzyMatch; int? minMismatchDistance; for (var overload in _overloads) {