mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
9a46a824bd
Adds `buffers` to the `Deno.jupyter.broadcast` API to send binary data via comms. This affords the ability to send binary data via websockets to the jupyter widget frontend.
18 lines
491 B
JavaScript
18 lines
491 B
JavaScript
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
|
|
|
const core = globalThis.Deno.core;
|
|
const internals = globalThis.__bootstrap.internals;
|
|
|
|
function enableJupyter() {
|
|
const {
|
|
op_jupyter_broadcast,
|
|
} = core.ensureFastOps();
|
|
|
|
globalThis.Deno.jupyter = {
|
|
async broadcast(msgType, content, { metadata = {}, buffers = [] } = {}) {
|
|
await op_jupyter_broadcast(msgType, content, metadata, buffers);
|
|
},
|
|
};
|
|
}
|
|
|
|
internals.enableJupyter = enableJupyter;
|