Skip to content

Commit c0137eb

Browse files
committed
Setup initial import of 'worker_threads' node library
1 parent bf35513 commit c0137eb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/src/node/worker_threads.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2017 Google Inc. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
import 'package:js/js.dart';
6+
7+
class WorkerOptions extends Object {
8+
}
9+
10+
@JS("worker_threads")
11+
class Worker {
12+
external Worker on(String message, Function callback);
13+
14+
external factory Worker(String filename, WorkerOptions options);
15+
}
16+
17+
@JS("worker_threads")
18+
class ParentPort {
19+
external ParentPort postMessage(Object value,
20+
{List transferList = const []});
21+
}
22+

0 commit comments

Comments
 (0)