diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-04-20 10:27:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-20 10:27:15 -0400 |
commit | 6e5f3453f806d6007b8f724837b5dd7d9eb17be9 (patch) | |
tree | 12d683562ae59856c81aca683541b0239290c41a /cli/js/lib.deno.ns.d.ts | |
parent | 437e35ca52227337588148a6896040d3fc3f2d54 (diff) |
Remove core/plugin.rs (#4824)
This simplifies the plugin interface in order to deliver op crates with a similar API
Diffstat (limited to 'cli/js/lib.deno.ns.d.ts')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 06baf3aa2..119ba781e 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -1796,35 +1796,23 @@ declare namespace Deno { * Requires `allow-write` permission. */ export function truncate(name: string, len?: number): Promise<void>; - export interface AsyncHandler { - (msg: Uint8Array): void; - } - - export interface PluginOp { - dispatch( - control: Uint8Array, - zeroCopy?: ArrayBufferView | null - ): Uint8Array | null; - setAsyncHandler(handler: AsyncHandler): void; - } - - export interface Plugin { - ops: { - [name: string]: PluginOp; - }; - } - /** **UNSTABLE**: new API, yet to be vetted. * * Open and initalize a plugin. * - * const plugin = Deno.openPlugin("./path/to/some/plugin.so"); - * const some_op = plugin.ops.some_op; - * const response = some_op.dispatch(new Uint8Array([1,2,3,4])); + * const rid = Deno.openPlugin("./path/to/some/plugin.so"); + * const opId = Deno.core.ops()["some_op"]; + * const response = Deno.core.dispatch(opId, new Uint8Array([1,2,3,4])); * console.log(`Response from plugin ${response}`); * - * Requires `allow-plugin` permission. */ - export function openPlugin(filename: string): Plugin; + * Requires `allow-plugin` permission. + * + * The plugin system is not stable and will change in the future, hence the + * lack of docs. For now take a look at the example + * https://github.com/denoland/deno/tree/master/test_plugin + */ + export function openPlugin(filename: string): number; + export interface NetAddr { transport: "tcp" | "udp"; hostname: string; |