2017-09-25 04:44:56 +01:00
|
|
|
// 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.
|
|
|
|
|
2017-10-02 00:59:51 +01:00
|
|
|
interface Number {
|
|
|
|
mod(n: number): number
|
2017-10-06 19:22:19 -07:00
|
|
|
clamp(lo: number, hi: number): number
|
2017-10-02 00:59:51 +01:00
|
|
|
}
|
|
|
|
|
2017-09-28 22:39:26 +01:00
|
|
|
// For content.ts
|
2017-09-25 04:44:56 +01:00
|
|
|
interface Message {
|
2017-10-06 03:28:14 +01:00
|
|
|
type:
|
|
|
|
"excmd_contentcommand" |
|
|
|
|
"keydown" |
|
|
|
|
"keydown_suppress" |
|
2017-10-06 04:16:02 +01:00
|
|
|
"commandline" |
|
|
|
|
"commandline_frame"
|
2017-10-06 03:28:14 +01:00
|
|
|
// And other unknown attributes...
|
|
|
|
[key: string]: any
|
2017-09-25 04:44:56 +01:00
|
|
|
}
|
|
|
|
|
2017-10-06 19:22:19 -07:00
|
|
|
declare var content: any
|
|
|
|
|
2017-09-28 22:39:26 +01:00
|
|
|
// Firefox-specific dom properties
|
2017-09-27 21:10:52 -07:00
|
|
|
interface Window {
|
|
|
|
scrollByLines(n: number): void
|
|
|
|
scrollByPages(n: number): void
|
|
|
|
}
|
2017-10-15 23:05:41 +01:00
|
|
|
|
2017-10-16 14:42:12 +01:00
|
|
|
// Web extension types not in web-ext-types yet
|
2017-10-15 23:05:41 +01:00
|
|
|
declare namespace browser.find {
|
|
|
|
function find(query, object): any
|
|
|
|
}
|
2017-10-16 14:42:12 +01:00
|
|
|
|
|
|
|
declare namespace browser.sessions{
|
|
|
|
function getRecentlyClosed(filter: any): any
|
|
|
|
function restore(sessionId: number): any
|
|
|
|
}
|