mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
11 lines
278 B
TypeScript
11 lines
278 B
TypeScript
interface Hooks {
|
|
stdout: (value: string) => void;
|
|
stderr: (value: string) => void;
|
|
}
|
|
function write(hooks: Hooks): void {
|
|
hooks.stdout("ok");
|
|
hooks.stderr("err");
|
|
}
|
|
function output(value: string): void { console.log(value); }
|
|
write({ stdout: output, stderr: output });
|