summaryrefslogtreecommitdiff
path: root/runtime/ops/tty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ops/tty.rs')
-rw-r--r--runtime/ops/tty.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs
index d577a6755..60144e408 100644
--- a/runtime/ops/tty.rs
+++ b/runtime/ops/tty.rs
@@ -2,7 +2,6 @@
use deno_core::error::AnyError;
use deno_core::op;
-use deno_core::Extension;
use deno_core::OpState;
use deno_io::StdFileResource;
use std::io::Error;
@@ -33,15 +32,10 @@ fn get_windows_handle(
Ok(handle)
}
-pub fn init() -> Extension {
- Extension::builder("deno_tty")
- .ops(vec![
- op_stdin_set_raw::decl(),
- op_isatty::decl(),
- op_console_size::decl(),
- ])
- .build()
-}
+deno_core::extension!(
+ deno_tty,
+ ops = [op_stdin_set_raw, op_isatty, op_console_size]
+);
// ref: <https://learn.microsoft.com/en-us/windows/console/setconsolemode>
#[cfg(windows)]