node_interop.util library

Utility functions for Dart <> JS interoperability.

Classes

Util

Properties

util Util
read-only

Functions

callbackToCompleter<T>(Completer<T> completer) → void Function(Object, T)
Returns a function that can be passed to a Node.js-style asynchronous callback that will complete completer with that callback's error or success result.
callConstructor(Object constr, List<Object> arguments) → dynamic
callMethod(Object o, String method, List<Object> args) → dynamic
dartify<T>(Object jsObject) → T
Returns Dart representation from JS Object. [...]
futureToPromise<T>(Future<T> future) Promise
Creates JS Promise which is resolved when future completes. [...]
getProperty(Object o, Object name) → dynamic
hasProperty(Object o, Object name) bool
instanceof(Object o, Object type) bool
Check whether o is an instance of type. [...]
invokeAsync0<T>(void function(void (Object, T))) Future<T>
Invokes a zero-argument Node.js-style asynchronous function and encapsulates the result in a Future.
invokeAsync1<S, T>(void function(S, void (Object, T)), S arg1) Future<T>
Invokes a single-argument Node.js-style asynchronous function and encapsulates the result in a Future.
jsify(Object dartObject) → dynamic
Returns the JS representation from Dart Object. [...]
newObject() → dynamic
promiseToFuture<T>(Promise promise) Future<T>
Creates Dart Future which completes when promise is resolved or rejected. [...]
setProperty(Object o, Object name, Object value) → dynamic