2021-09-01 10:46:29 +00:00
|
|
|
import {html} from 'htm/preact';
|
|
|
|
import browser from 'webextension-polyfill';
|
|
|
|
|
2020-11-26 17:31:13 +00:00
|
|
|
// TypeScript fix to make it see this file as a module.
|
|
|
|
export {};
|
|
|
|
|
|
|
|
type HollloQueue = {
|
|
|
|
dumpBackup: () => Promise<void>;
|
|
|
|
dumpSettings: () => Promise<void>;
|
|
|
|
};
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
interface Window {
|
|
|
|
HollloQueue: HollloQueue;
|
|
|
|
}
|
|
|
|
}
|
2021-09-01 10:46:29 +00:00
|
|
|
|
|
|
|
export namespace Queue {
|
|
|
|
type Component = ReturnType<typeof html>;
|
|
|
|
|
|
|
|
type Item = {
|
|
|
|
added: Date;
|
|
|
|
id: number;
|
|
|
|
text?: string;
|
|
|
|
url: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
type Manifest = {nodeEnv?: string} & browser.Manifest.ManifestBase;
|
|
|
|
|
|
|
|
type Message<T> = {
|
|
|
|
action: MessageAction;
|
|
|
|
data: T;
|
|
|
|
};
|
|
|
|
|
|
|
|
type MessageAction = 'queue open url' | 'queue update badge';
|
|
|
|
|
|
|
|
type Migration = {
|
|
|
|
date: Date;
|
|
|
|
upgrade: (previous: Record<string, any>) => Record<string, any>;
|
|
|
|
version: string;
|
|
|
|
};
|
|
|
|
}
|