mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00

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;
|