File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright 2017 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' ;
8
8
import 'package:js/js_util.dart' ;
9
9
10
- @JS ()
11
- external Object _requireWorkerThreads (String path);
10
+ typedef _WorkerThreads = void Function () Function (
11
+ String Function (String ), String Function (String ));
12
+
13
+ @JS ('require' )
14
+ external Object _requireWorkerThreads (String name);
12
15
13
- final workers = _requireWorkerThreads ("worker_threads" );
16
+ final _worker = _requireWorkerThreads ("worker_threads" );
14
17
15
18
@JS ()
16
19
external Object get workerData;
@@ -46,7 +49,9 @@ class PortOptions {
46
49
@JS ()
47
50
external ParentPort get parentPort;
48
51
49
- @JS ()
50
- class ParentPort {
51
- external static void postMessage (Object message, PortOptions options);
52
+ @JS ("parentPort" )
53
+ @anonymous
54
+ abstract class ParentPort {
55
+ external factory ParentPort ({Function postMessage});
56
+ external void postMessage (Object message, PortOptions options);
52
57
}
You can’t perform that action at this time.
0 commit comments