queue/source/types.d.ts

43 lines
818 B
TypeScript

import {html} from 'htm/preact';
import browser from 'webextension-polyfill';
// 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;
}
}
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;
};
}