2022-02-23 13:52:06 +00:00
|
|
|
import {html} from 'htm/preact';
|
|
|
|
import browser from 'webextension-polyfill';
|
2020-10-10 23:32:27 +00:00
|
|
|
|
|
|
|
declare global {
|
|
|
|
interface Window {
|
2022-02-23 13:52:06 +00:00
|
|
|
TildesReExtended: {
|
|
|
|
debug: boolean;
|
|
|
|
};
|
2020-10-10 23:32:27 +00:00
|
|
|
}
|
2022-02-23 13:52:06 +00:00
|
|
|
|
|
|
|
interface ImportMetaEnv {
|
|
|
|
readonly DEV: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ImportMeta {
|
|
|
|
readonly env: ImportMetaEnv;
|
|
|
|
}
|
|
|
|
|
|
|
|
type TRXComponent = ReturnType<typeof html>;
|
|
|
|
|
|
|
|
type TRXManifest = browser.Manifest.ManifestBase;
|
|
|
|
|
|
|
|
type UserLabel = {
|
|
|
|
color: string;
|
|
|
|
id: number;
|
|
|
|
priority: number;
|
|
|
|
text: string;
|
|
|
|
username: string;
|
|
|
|
};
|
2022-02-25 00:06:24 +00:00
|
|
|
|
|
|
|
type UsernameColor = {
|
|
|
|
color: string;
|
|
|
|
id: number;
|
|
|
|
username: string;
|
|
|
|
};
|
2022-02-25 00:34:11 +00:00
|
|
|
|
|
|
|
// Removes an index signature from a type, useful for getting all defined keys
|
|
|
|
// from an object that also has an index signature, like Settings.features.
|
|
|
|
// https://stackoverflow.com/a/66252656
|
|
|
|
type RemoveIndexSignature<T> = {
|
|
|
|
[K in keyof T as string extends K
|
|
|
|
? never
|
|
|
|
: number extends K
|
|
|
|
? never
|
|
|
|
: K]: T[K];
|
|
|
|
};
|
2020-10-10 23:32:27 +00:00
|
|
|
}
|