createJSInteropWrapper<T extends Object> function

JSObject createJSInteropWrapper<T extends Object>(
  1. T dartObject, [
  2. JSObject? proto = null
])

Given a instance of a Dart class that contains an @JSExport annotation, creates a JavaScript object that wraps the given Dart object.

The object literal will be a map of properties, which are either the written instance member names or their renames, to callbacks that call the corresponding Dart instance members.

If proto is provided, it will be used as the prototype for the created object.

See https://dart.dev/interop/js-interop/mock for more details on how to declare classes that can be used in this method.

Implementation

external JSObject createJSInteropWrapper<T extends Object>(
  T dartObject, [
  JSObject? proto = null,
]);