[Metro > Common] Add commands module
This commit is contained in:
parent
119060a43b
commit
1891a46eb9
4 changed files with 4 additions and 2 deletions
1
src/def.d.ts
vendored
1
src/def.d.ts
vendored
|
@ -220,6 +220,7 @@ interface VendettaObject {
|
||||||
clipboard: PropIntellisense<"setString" | "getString" | "hasString">;
|
clipboard: PropIntellisense<"setString" | "getString" | "hasString">;
|
||||||
assets: PropIntellisense<"registerAsset">;
|
assets: PropIntellisense<"registerAsset">;
|
||||||
invites: PropIntellisense<"acceptInviteAndTransitionToInviteChannel">;
|
invites: PropIntellisense<"acceptInviteAndTransitionToInviteChannel">;
|
||||||
|
commands: PropIntellisense<"getBuiltInCommands">;
|
||||||
navigation: PropIntellisense<"pushLazy">;
|
navigation: PropIntellisense<"pushLazy">;
|
||||||
navigationStack: PropIntellisense<"createStackNavigator">;
|
navigationStack: PropIntellisense<"createStackNavigator">;
|
||||||
NavigationNative: PropIntellisense<"NavigationContainer">;
|
NavigationNative: PropIntellisense<"NavigationContainer">;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { ApplicationCommand } from "@types";
|
import { ApplicationCommand } from "@types";
|
||||||
import { findByProps } from "@metro/filters";
|
import { commands as commandsModule } from "@metro/common";
|
||||||
import { after } from "@lib/patcher";
|
import { after } from "@lib/patcher";
|
||||||
|
|
||||||
const commandsModule = findByProps("getBuiltInCommands")
|
|
||||||
let commands: ApplicationCommand[] = [];
|
let commands: ApplicationCommand[] = [];
|
||||||
|
|
||||||
export function patchCommands() {
|
export function patchCommands() {
|
||||||
|
|
|
@ -10,6 +10,7 @@ export const stylesheet = findByProps("createThemedStyleSheet");
|
||||||
export const clipboard = findByProps("setString", "getString", "hasString");
|
export const clipboard = findByProps("setString", "getString", "hasString");
|
||||||
export const assets = findByProps("registerAsset");
|
export const assets = findByProps("registerAsset");
|
||||||
export const invites = findByProps("acceptInviteAndTransitionToInviteChannel");
|
export const invites = findByProps("acceptInviteAndTransitionToInviteChannel");
|
||||||
|
export const commands = findByProps("getBuiltInCommands");
|
||||||
export const navigation = findByProps("pushLazy");
|
export const navigation = findByProps("pushLazy");
|
||||||
export const navigationStack = findByProps("createStackNavigator");
|
export const navigationStack = findByProps("createStackNavigator");
|
||||||
export const NavigationNative = findByProps("NavigationContainer");
|
export const NavigationNative = findByProps("NavigationContainer");
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { findByProps, findByStoreName } from "@metro/filters";
|
||||||
import { FluxDispatcher } from "@metro/common";
|
import { FluxDispatcher } from "@metro/common";
|
||||||
import logger from "@lib/logger";
|
import logger from "@lib/logger";
|
||||||
|
|
||||||
|
// TODO: Move these to common modules?
|
||||||
const ThemeManager = findByProps("updateTheme", "overrideTheme");
|
const ThemeManager = findByProps("updateTheme", "overrideTheme");
|
||||||
const AMOLEDThemeManager = findByProps("setAMOLEDThemeEnabled");
|
const AMOLEDThemeManager = findByProps("setAMOLEDThemeEnabled");
|
||||||
const ThemeStore = findByStoreName("ThemeStore");
|
const ThemeStore = findByStoreName("ThemeStore");
|
||||||
|
|
Loading…
Reference in a new issue