Add TopLiba (#1003)
* test * cleanup deleted unused `fetchFile` import replaced fetch with `fetchApi` * eslint * fix * fix multi * Hmm, what to do next. * test URLSearchParams * fix
This commit is contained in:
+5
-3
@@ -1,6 +1,8 @@
|
||||
/* global Buffer, RequestInit */
|
||||
|
||||
import { parse as parseProto } from 'protobufjs';
|
||||
|
||||
type FetchInit = {
|
||||
interface FetchInit {
|
||||
headers?: Record<string, string | undefined> | Headers;
|
||||
method?: string;
|
||||
body?: FormData | string;
|
||||
@@ -10,10 +12,10 @@ type FetchInit = {
|
||||
| undefined
|
||||
| FormData
|
||||
| Headers;
|
||||
};
|
||||
}
|
||||
|
||||
const makeInit = async (init?: FetchInit) => {
|
||||
let defaultHeaders: Record<string, string> = {
|
||||
const defaultHeaders: Record<string, string> = {
|
||||
'Connection': 'keep-alive',
|
||||
'Accept': '*/*',
|
||||
'Accept-Language': '*',
|
||||
|
||||
+10
-10
@@ -11,36 +11,36 @@ export enum FilterTypes {
|
||||
ExcludableCheckboxGroup = 'XCheckbox',
|
||||
}
|
||||
|
||||
type SwitchFilter = {
|
||||
interface SwitchFilter {
|
||||
type: FilterTypes.Switch;
|
||||
/** Default value */
|
||||
value: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
type TextFilter = {
|
||||
interface TextFilter {
|
||||
type: FilterTypes.TextInput;
|
||||
/** Default value */
|
||||
value: string;
|
||||
};
|
||||
}
|
||||
|
||||
type CheckboxFilter = {
|
||||
interface CheckboxFilter {
|
||||
type: FilterTypes.CheckboxGroup;
|
||||
options: readonly FilterOption[];
|
||||
/** Default value */
|
||||
value: string[];
|
||||
};
|
||||
type PickerFilter = {
|
||||
}
|
||||
interface PickerFilter {
|
||||
type: FilterTypes.Picker;
|
||||
options: readonly FilterOption[];
|
||||
/** Default value */
|
||||
value: string;
|
||||
};
|
||||
}
|
||||
|
||||
type ExcludableCheckboxFilter = {
|
||||
interface ExcludableCheckboxFilter {
|
||||
type: FilterTypes.ExcludableCheckboxGroup;
|
||||
options: readonly FilterOption[];
|
||||
value: { include?: string[]; exclude?: string[] };
|
||||
};
|
||||
}
|
||||
|
||||
export type Filters = Record<
|
||||
string,
|
||||
|
||||
+2
-8
@@ -1,6 +1,3 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
class Storage {
|
||||
private db: Record<string, { created: Date; value: any; expires?: number }>;
|
||||
|
||||
@@ -54,7 +51,6 @@ class Storage {
|
||||
/**
|
||||
* Deletes a key from the storage.
|
||||
*
|
||||
* @param pluginID - The ID of the plugin.
|
||||
* @param key - The key to delete.
|
||||
*/
|
||||
delete(key: string): void {
|
||||
@@ -64,7 +60,7 @@ class Storage {
|
||||
/**
|
||||
* Clears all stored items from storage.
|
||||
*/
|
||||
clearAll(pluginID: string): void {
|
||||
clearAll(): void {
|
||||
this.db = {};
|
||||
}
|
||||
}
|
||||
@@ -84,9 +80,7 @@ https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
|
||||
/**
|
||||
* Represents the structure of a storage object with string keys and values.
|
||||
*/
|
||||
interface StorageObject {
|
||||
[key: string]: any;
|
||||
}
|
||||
type StorageObject = Record<string, any>;
|
||||
|
||||
/**
|
||||
* Represents a simplified version of the browser's localStorage.
|
||||
|
||||
Reference in New Issue
Block a user