Refactor to prepare for implementing input and output streams to the terminal

This commit is contained in:
Timothy Warren 2023-11-03 12:26:09 -04:00
parent 2fcfe4328c
commit 19e44261a4
7 changed files with 17 additions and 14 deletions

0
src/bun/terminal_io.ts Normal file
View File

6
src/common/editor.ts Normal file
View File

@ -0,0 +1,6 @@
export class Editor {
constructor() {
}
public processKeyPress(): void {
}
}

View File

@ -1,3 +1,10 @@
import { importForRuntime } from './runtime.ts';
export * from './runtime.ts'; export * from './runtime.ts';
export * from './strings.ts'; export * from './strings.ts';
export type { ITestBase } from './test_base.ts'; export type { ITestBase } from './test_base.ts';
export async function main() {
const { main } = await importForRuntime('./mod.ts');
await main();
}

View File

@ -6,7 +6,7 @@ t.test('chars fn properly splits strings into unicode characters', () => {
t.assertEquals(chars('😺😸😹'), ['😺', '😸', '😹']); t.assertEquals(chars('😺😸😹'), ['😺', '😸', '😹']);
}); });
t.test('is_ascii properly descerns ascii chars', () => { t.test('is_ascii properly discerns ascii chars', () => {
t.assertTrue(is_ascii('asjyverkjhsdf1928374')); t.assertTrue(is_ascii('asjyverkjhsdf1928374'));
t.assertFalse(is_ascii('😺acalskjsdf')); t.assertFalse(is_ascii('😺acalskjsdf'));
}); });

View File

0
src/deno/terminal_io.ts Normal file
View File

View File

@ -1,19 +1,9 @@
/** /**
* The starting point for running scroll * The starting point for running scroll
*/ */
import { main } from './common/mod.ts';
export enum RunTime {
Bun = 'bun',
Deno = 'deno',
Unknown = 'common',
}
import { importForRuntime } from './common/mod.ts';
/** /**
* Determine the runtime strategy, and go! * Start the event loop
*/ */
(async () => {
const { main } = await importForRuntime('./mod.ts');
await main(); await main();
})();