File
Blob: src/node/readline.ts
| 1 | // Copyright (c) 2017-2022 Cloudflare, Inc. |
| 2 | // Licensed under the Apache 2.0 license found in the LICENSE file or at: |
| 3 | // https://opensource.org/licenses/Apache-2.0 |
| 4 | // |
| 5 | // Copyright Joyent, Inc. and other Node contributors. |
| 6 | // |
| 7 | // Permission is hereby granted, free of charge, to any person obtaining a |
| 8 | // copy of this software and associated documentation files (the |
| 9 | // "Software"), to deal in the Software without restriction, including |
| 10 | // without limitation the rights to use, copy, modify, merge, publish, |
| 11 | // distribute, sublicense, and/or sell copies of the Software, and to permit |
| 12 | // persons to whom the Software is furnished to do so, subject to the |
| 13 | // following conditions: |
| 14 | // |
| 15 | // The above copyright notice and this permission notice shall be included |
| 16 | // in all copies or substantial portions of the Software. |
| 17 | // |
| 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 19 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN |
| 21 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 22 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 23 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
| 24 | // USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | |
| 26 | import * as promises from 'node-internal:internal_readline_promises'; |
| 27 | import { Interface } from 'node-internal:internal_readline'; |
| 28 | import type Readline from 'node:readline'; |
| 29 | |
| 30 | export { promises, Interface }; |
| 31 | |
| 32 | export function clearLine(): boolean { |
| 33 | return false; |
| 34 | } |
| 35 | |
| 36 | export function clearScreenDown(): boolean { |
| 37 | return false; |
| 38 | } |
| 39 | |
| 40 | export function createInterface(): Readline.Interface { |
| 41 | return new Interface(); |
| 42 | } |
| 43 | |
| 44 | export function cursorTo(): boolean { |
| 45 | return false; |
| 46 | } |
| 47 | |
| 48 | export function emitKeypressEvents(): void { |
| 49 | // Acts as a no-op. |
| 50 | } |
| 51 | export function moveCursor(): boolean { |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | export default { |
| 56 | clearLine, |
| 57 | clearScreenDown, |
| 58 | createInterface, |
| 59 | cursorTo, |
| 60 | emitKeypressEvents, |
| 61 | moveCursor, |
| 62 | Interface, |
| 63 | promises, |
| 64 | }; |