[Assets] Move to use Indexable type
This commit is contained in:
parent
4104d637f1
commit
de3d422754
2 changed files with 3 additions and 7 deletions
6
src/def.d.ts
vendored
6
src/def.d.ts
vendored
|
@ -33,10 +33,6 @@ interface Asset {
|
||||||
id: number;
|
id: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Assets {
|
|
||||||
[id: string]: Asset;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PluginAuthor {
|
interface PluginAuthor {
|
||||||
name: string;
|
name: string;
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -109,7 +105,7 @@ interface VendettaObject {
|
||||||
showToast: (content: string, asset: number) => void;
|
showToast: (content: string, asset: number) => void;
|
||||||
};
|
};
|
||||||
assets: {
|
assets: {
|
||||||
all: Assets;
|
all: Indexable<Asset>;
|
||||||
find: (filter: (a: any) => void) => Asset | null | undefined;
|
find: (filter: (a: any) => void) => Asset | null | undefined;
|
||||||
getAssetByName: (name: string) => Asset;
|
getAssetByName: (name: string) => Asset;
|
||||||
getAssetByID: (id: number) => Asset;
|
getAssetByID: (id: number) => Asset;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Asset, Assets } from "@types";
|
import { Asset, Indexable, } from "@types";
|
||||||
import { after } from "@lib/patcher";
|
import { after } from "@lib/patcher";
|
||||||
import { assets } from "@metro/common";
|
import { assets } from "@metro/common";
|
||||||
|
|
||||||
export const all: Assets = {};
|
export const all: Indexable<Asset> = {};
|
||||||
|
|
||||||
export default function patchAssets() {
|
export default function patchAssets() {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue