mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00

exmode.parser now converts strings to the types given in excmd signatures. Messaging now works in both directions (but I haven't made excmds.ts use the new system yet. Exercise for the reader (see keydown_* state() for a simple example)). keys are now being suppressed, but in a pretty stupid way. I got fed up of not having proper itertools, or str conversions, so I wrote some. Others have written them in JS, but they were fun to make. Only the ones I'm using are tested.
36 lines
812 B
TypeScript
36 lines
812 B
TypeScript
// Interfaces common to the tridactyl project.
|
|
|
|
// For some obscure reason, tsc doesn't like .d.ts files to share a name with
|
|
// .ts files. So don't do that.
|
|
|
|
interface Number {
|
|
mod(n: number): number
|
|
clamp(lo: number, hi: number): number
|
|
}
|
|
|
|
// For content.ts
|
|
interface Message {
|
|
type:
|
|
"excmd_content" |
|
|
"keydown_content" |
|
|
"keydown_background" |
|
|
"commandline" |
|
|
"commandline_frame"
|
|
// And other unknown attributes...
|
|
[key: string]: any
|
|
}
|
|
|
|
declare var content: any
|
|
|
|
// Firefox-specific dom properties
|
|
interface Window {
|
|
scrollByLines(n: number): void
|
|
scrollByPages(n: number): void
|
|
}
|
|
|
|
// Web extension types not in web-ext-types yet
|
|
declare namespace browser.find {
|
|
function find(query, object): any
|
|
}
|
|
|
|
type ModeType = "NORMAL" | "INSERT"
|