File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 11// Copyright 2020 Google Inc. Use of this source code is governed by an
22// MIT-style license that can be found in the LICENSE file or at
33// https://opensource.org/licenses/MIT.
4- @JS ()
4+ @JS ("worker_threads" )
55library worker_threads;
66
77import 'package:js/js.dart' ;
@@ -36,9 +36,16 @@ class Worker {
3636 external const factory Worker (String fileName, WorkerOptions options);
3737}
3838
39+ @JS ("parentPort" )
40+ @anonymous
41+ class PortOptions {
42+ external List get transferList;
43+ external factory PortOptions ({List <Object > transferList = const []});
44+ }
45+
3946@JS ("parentPort" )
4047@anonymous
4148abstract class ParentPort {
42- external factory ParentPort ();
43- external void postMessage (Object message);
49+ external factory ParentPort ({ Function postMessage} );
50+ external void postMessage (Object message, PortOptions options );
4451}
You can’t perform that action at this time.
0 commit comments