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 1
1
// Copyright 2020 Google Inc. Use of this source code is governed by an
2
2
// MIT-style license that can be found in the LICENSE file or at
3
3
// https://opensource.org/licenses/MIT.
4
- @JS ()
4
+ @JS ("worker_threads" )
5
5
library worker_threads;
6
6
7
7
import 'package:js/js.dart' ;
@@ -36,9 +36,16 @@ class Worker {
36
36
external const factory Worker (String fileName, WorkerOptions options);
37
37
}
38
38
39
+ @JS ("parentPort" )
40
+ @anonymous
41
+ class PortOptions {
42
+ external List get transferList;
43
+ external factory PortOptions ({List <Object > transferList = const []});
44
+ }
45
+
39
46
@JS ("parentPort" )
40
47
@anonymous
41
48
abstract 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 );
44
51
}
You can’t perform that action at this time.
0 commit comments