Skip to content

Commit

Permalink
Avoid using private types in public APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Sep 2, 2022
1 parent ad121f9 commit c9b8e96
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/src/callable.dart
Expand Up @@ -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';

Expand Down
6 changes: 3 additions & 3 deletions lib/src/callable/async_built_in.dart
Expand Up @@ -11,7 +11,7 @@ import '../value.dart';
import 'async.dart';

/// An [AsyncBuiltInCallable]'s callback.
typedef _Callback = FutureOr<Value> Function(List<Value> arguments);
typedef Callback = FutureOr<Value> Function(List<Value> arguments);

/// A callable defined in Dart code.
///
Expand All @@ -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].
Expand Down Expand Up @@ -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<ArgumentDeclaration, _Callback> callbackFor(
Tuple2<ArgumentDeclaration, Callback> callbackFor(
int positional, Set<String> names) =>
Tuple2(_arguments, _callback);
}
10 changes: 5 additions & 5 deletions lib/src/callable/built_in.dart
Expand Up @@ -8,7 +8,7 @@ import '../ast/sass.dart';
import '../callable.dart';
import '../value.dart';

typedef _Callback = Value Function(List<Value> arguments);
typedef Callback = Value Function(List<Value> arguments);

/// A callable defined in Dart code.
///
Expand All @@ -20,7 +20,7 @@ class BuiltInCallable implements Callable, AsyncBuiltInCallable {
final String name;

/// The overloads declared for this callable.
final List<Tuple2<ArgumentDeclaration, _Callback>> _overloads;
final List<Tuple2<ArgumentDeclaration, Callback>> _overloads;

/// Creates a function with a single [arguments] declaration and a single
/// [callback].
Expand Down Expand Up @@ -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<String, _Callback> overloads,
this.name, Map<String, Callback> overloads,
{Object? url})
: _overloads = [
for (var entry in overloads.entries)
Expand All @@ -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<ArgumentDeclaration, _Callback> callbackFor(
Tuple2<ArgumentDeclaration, Callback> callbackFor(
int positional, Set<String> names) {
Tuple2<ArgumentDeclaration, _Callback>? fuzzyMatch;
Tuple2<ArgumentDeclaration, Callback>? fuzzyMatch;
int? minMismatchDistance;

for (var overload in _overloads) {
Expand Down

0 comments on commit c9b8e96

Please sign in to comment.