Skip to content

Commit

Permalink
Make tweaks to parent class def
Browse files Browse the repository at this point in the history
  • Loading branch information
hegelocampus committed Apr 7, 2020
1 parent 5f9e09c commit 4d6caaa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/src/node/worker_threads.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020 Google Inc. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
@JS()
@JS("worker_threads")
library worker_threads;

import 'package:js/js.dart';
Expand Down Expand Up @@ -36,9 +36,16 @@ class Worker {
external const factory Worker(String fileName, WorkerOptions options);
}

@JS("parentPort")
@anonymous
class PortOptions {
external List get transferList;
external factory PortOptions({List<Object> transferList = const []});
}

@JS("parentPort")
@anonymous
abstract class ParentPort {
external factory ParentPort();
external void postMessage(Object message);
external factory ParentPort({Function postMessage});
external void postMessage(Object message, PortOptions options);
}

0 comments on commit 4d6caaa

Please sign in to comment.