mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 18:07:02 -04:00
Pr Stuff
Co-Authored-By: sadan4 <117494111+sadan4@users.noreply.github.com>
This commit is contained in:
parent
8c2bfea5c0
commit
4f72832ba1
7 changed files with 50 additions and 7 deletions
24
src/webpack/common/types/utils.d.ts
vendored
24
src/webpack/common/types/utils.d.ts
vendored
|
@ -158,6 +158,30 @@ export interface Clipboard {
|
|||
SUPPORTS_COPY: boolean;
|
||||
}
|
||||
|
||||
export interface ApplicationAssets {
|
||||
lastUpdated: number;
|
||||
assets: Record<string, { id: string; name: string; type: number; } & Record<string, any>>;
|
||||
}
|
||||
|
||||
export interface ApplicationAssetUtils {
|
||||
fetchAssetIds(applicationId: string, e: string[]): Promise<string[]>;
|
||||
/**
|
||||
* mp === media proxy
|
||||
*/
|
||||
getAssetFromImageURL(type: "mp" | "youtube" | "spotify" | "twitch", url: string): string;
|
||||
/**
|
||||
* converts an asset string into an image url
|
||||
* @param applicationId the application id if fetching an application asset
|
||||
* @param asset asset id if fetching an application asset, otherwise something like what {@link getAssetFromImageURL} returns
|
||||
* @param size if width and height are not needed, the largest is used. If omitted, no size is used
|
||||
*/
|
||||
getAssetImage(applicationId: string | undefined, assetId: string, size?: number | [width: number, height: number]): undefined | string;
|
||||
/**
|
||||
* @returns assets or undefined
|
||||
*/
|
||||
getAssets(applicationId: string): Promise<undefined | ApplicationAssets>;
|
||||
}
|
||||
|
||||
export interface NavigationRouter {
|
||||
back(): void;
|
||||
forward(): void;
|
||||
|
|
|
@ -144,9 +144,12 @@ export const UploadHandler = {
|
|||
promptToUpload: findByCodeLazy("#{intl::ATTACHMENT_TOO_MANY_ERROR_TITLE}") as (files: File[], channel: Channel, draftType: Number) => void
|
||||
};
|
||||
|
||||
export const ApplicationAssetUtils = findByPropsLazy("fetchAssetIds", "getAssetImage") as {
|
||||
fetchAssetIds: (applicationId: string, e: string[]) => Promise<string[]>;
|
||||
};
|
||||
export const ApplicationAssetUtils: t.ApplicationAssetUtils = mapMangledModuleLazy("getAssetImage: size must === [", {
|
||||
fetchAssetIds: filters.byCode('.startsWith("http:")', ".dispatch({"),
|
||||
getAssetFromImageURL: filters.byCode("].serialize(", ',":"'),
|
||||
getAssetImage: filters.byCode("getAssetImage: size must === ["),
|
||||
getAssets: filters.byCode(".assets")
|
||||
});
|
||||
|
||||
export const Clipboard: t.Clipboard = mapMangledModuleLazy('queryCommandEnabled("copy")', {
|
||||
copy: filters.byCode(".copy("),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue