diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-09-27 02:21:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-27 02:21:06 +0200 |
commit | 46a4bd5178f5aed22041422c431b5ab6f697865d (patch) | |
tree | bb72699b0c18ace70b7dd8c7434a211703edba14 /cli/tsc | |
parent | d39659332c224dfee51a43499c2d2d5da12a0da8 (diff) |
feat(unstable): add `Deno.jupyter.broadcast` API (#20656)
Closes https://github.com/denoland/deno/issues/20591
---------
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
Diffstat (limited to 'cli/tsc')
-rw-r--r-- | cli/tsc/dts/lib.deno.unstable.d.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index c8b857dc6..9f9a4914b 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -1947,6 +1947,39 @@ declare namespace Deno { */ shutdown(): Promise<void>; } + + /** + * A namespace containing runtime APIs available in Jupyter notebooks. + * + * When accessed outside of Jupyter notebook context an error will be thrown. + * + * @category Jupyter */ + export namespace jupyter { + /** + * Broadcast a message on IO pub channel. + * + * ``` + * await Deno.jupyter.broadcast("display_data", { + * data: { "text/html": "<b>Processing.</b>" }, + * metadata: {}, + * transient: { display_id: "progress" } + * }); + * + * await new Promise((resolve) => setTimeout(resolve, 500)); + * + * await Deno.jupyter.broadcast("update_display_data", { + * data: { "text/html": "<b>Processing..</b>" }, + * metadata: {}, + * transient: { display_id: "progress" } + * }); + * ``` + * + * @category Jupyter */ + export function broadcast( + msgType: string, + content: Record<string, unknown>, + ): Promise<void>; + } } /** **UNSTABLE**: New API, yet to be vetted. |