| 1 | | | import 'dart:async'; |
| 2 | | | |
| 3 | | | import '_impl/xplat/_typedefs.dart' |
| 4 | | | if (dart.library.io) '_impl/native/_typedefs.dart' |
| 5 | | | if (dart.library.html) '_impl/web/_typedefs.dart' |
| 6 | | | if (dart.library.js) '_impl/web/_typedefs.dart' |
| 7 | | | if (dart.library.js_interop) '_impl/web/_typedefs.dart' as impl; |
| 8 | | | import 'worker/worker_request.dart'; |
| 9 | | | import 'worker_service.dart'; |
| 10 | | | |
| 11 | | | typedef EntryPoint = impl.EntryPoint; |
| 12 | | | typedef PlatformChannel = impl.PlatformChannel; |
| 13 | | | typedef PlatformThread = impl.PlatformThread; |
| 14 | | | typedef PlatformThreadHook = impl.PlatformThreadHook; |
| 15 | | | |
| 16 | | | typedef WorkerInitializer = FutureOr<WorkerService> Function( |
| 17 | | | WorkerRequest startRequest); |
| 18 | | | typedef CommandHandler = FutureOr<dynamic> Function(WorkerRequest req); |
| 19 | | | typedef StreamCanceler = void Function(); |
| 20 | | | |
| 21 | | | typedef Cast<T> = T Function(dynamic); |
| 22 | | | |
| 23 | | | extension type OperationsMap(Map<int, CommandHandler> _ops) { |
| 24 | | 20 | CommandHandler? operator [](int key) => _ops[key]; |
| 25 | | | |
| 26 | | 20 | Iterable<int> get keys => _ops.keys; |
| 27 | | | } |