1
0
silverbullet/syscall/silverbullet-syscall/syscall.ts

17 lines
394 B
TypeScript
Raw Normal View History

2022-03-07 09:21:02 +00:00
declare global {
2022-03-24 09:48:56 +00:00
function syscall(name: string, ...args: any[]): Promise<any>;
2022-03-14 09:07:38 +00:00
}
2022-07-04 07:34:11 +00:00
// This is the case when running tests only, so giving it a dummy syscall function
if (typeof self === "undefined") {
// @ts-ignore: test
// deno-lint-ignore no-global-assign
2022-07-04 07:34:11 +00:00
self = {
syscall: () => {
2022-07-04 07:34:11 +00:00
throw new Error("Not implemented here");
},
};
}
2022-03-24 09:48:56 +00:00
export const syscall = self.syscall;