feat(plugin): SearchReply (#551)

Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Co-authored-by: Vendicated <vendicated@riseup.net>
This commit is contained in:
Syncx 2023-03-25 13:37:29 +11:00 committed by GitHub
parent b90392576e
commit 0b4ae729a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 141 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -19,6 +19,7 @@
import type { ReactNode } from "react";
import type { FluxEvents } from "./fluxEvents";
import { i18nMessages } from "./i18nMessages";
export { FluxEvents };
@ -82,3 +83,30 @@ export type RestAPI = Record<"delete" | "get" | "patch" | "post" | "put", (data:
V8APIError: Error;
getAPIBaseURL(withVersion?: boolean): string;
};
export interface Locale {
name: string;
value: string;
localizedName: string;
}
export interface LocaleInfo {
code: string;
enabled: boolean;
name: string;
englishName: string;
postgresLang: string;
}
export interface i18n {
getAvailableLocales(): Locale[];
getLanguages(): LocaleInfo[];
getDefaultLocale(): string;
getLocale(): string;
getLocaleInfo(): LocaleInfo;
setLocale(locale: string): void;
loadPromise: Promise<void>;
Messages: Record<i18nMessages, string>;
}

View file

@ -19,7 +19,7 @@
import type { User } from "discord-types/general";
// eslint-disable-next-line path-alias/no-relative
import { _resolveReady,filters, findByCodeLazy, findByPropsLazy, mapMangledModuleLazy, waitFor } from "../webpack";
import { _resolveReady, filters, findByCodeLazy, findByPropsLazy, findLazy, mapMangledModuleLazy, waitFor } from "../webpack";
import type * as t from "./types/utils";
export let FluxDispatcher: t.FluxDispatcher;
@ -29,6 +29,8 @@ export const moment: typeof import("moment") = findByPropsLazy("parseTwoDigitYea
export const hljs: typeof import("highlight.js") = findByPropsLazy("highlight");
export const i18n: t.i18n = findLazy(m => m.Messages?.["en-US"]);
export let SnowflakeUtils: t.SnowflakeUtils;
waitFor(["fromTimestamp", "extractTimestamp"], m => SnowflakeUtils = m);