Clipboard!

This commit is contained in:
dylan
2023-05-06 10:54:27 -07:00
parent b02d5155bd
commit 9685568f90
5 changed files with 49 additions and 15 deletions

24
deps.ts
View File

@ -1,17 +1,18 @@
// dwm
export {
createWindow,
getProcAddress,
mainloop,
createWindow,
getProcAddress,
mainloop,
} from "https://deno.land/x/dwm@0.3.3/mod.ts";
export * as gl from "https://deno.land/x/gluten@0.1.6/api/gles23.2.ts";
import { clipboard } from "https://raw.githubusercontent.com/Nisgrak/deno-clipboard/fix-deno-1.0.0/mod.ts";
// jsTokens
import jsTokens from "npm:js-tokens";
export function tokenize(input: string): Iterable<Token> {
// deno-lint-ignore no-explicit-any
return (jsTokens as any)(input);
};
// deno-lint-ignore no-explicit-any
return (jsTokens as any)(input);
}
type Token =
| { type: "StringLiteral"; value: string; closed: boolean }
| { type: "NoSubstitutionTemplate"; value: string; closed: boolean }
@ -27,4 +28,13 @@ type Token =
| { type: "Punctuator"; value: string }
| { type: "WhiteSpace"; value: string }
| { type: "LineTerminatorSequence"; value: string }
| { type: "Invalid"; value: string };
| { type: "Invalid"; value: string };
// clipboard
export { clipboard } from "https://raw.githubusercontent.com/Nisgrak/deno-clipboard/fix-deno-1.0.0/mod.ts";
try {
await clipboard.readText();
} catch (err) {
console.log("If you are running this on linux, please make sure you have 'xsel' installed.");
throw err;
}