From 6f50a92c7187d06e9605d3a104af2081e4c2dc54 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Thu, 13 Aug 2026 01:42:43 +0700 Subject: [PATCH 1/2] fix(lib/plugins): don't add own IDs to dependency map of reserved dependencies --- lib/plugins/src/_internal/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/plugins/src/_internal/index.ts b/lib/plugins/src/_internal/index.ts index aa8a54a..68218e0 100644 --- a/lib/plugins/src/_internal/index.ts +++ b/lib/plugins/src/_internal/index.ts @@ -21,6 +21,7 @@ import { ApiDependencyId, computePendingNodes, DiscordDependencyId, + isReservedDependency, pLeafOrSingleNodes, pListOrdered, pPending, @@ -347,9 +348,12 @@ export function registerInternalPlugin( manifest.version ??= InternalPluginVersion // TODO: This has to be shared from native somehow. manifest.format ??= 1 - manifest.dependencies ??= {} - manifest.dependencies[ApiDependencyId] ??= { version: '*' } - manifest.dependencies[DiscordDependencyId] ??= { version: '*' } + + if (!isReservedDependency(manifest.id)) { + manifest.dependencies ??= {} + manifest.dependencies[ApiDependencyId] ??= { version: '*' } + manifest.dependencies[DiscordDependencyId] ??= { version: '*' } + } return register(manifest as PluginManifest, options, defflags, iflags) } From 4247a755676019547bacf0b46fc401c26bd4034d Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Thu, 13 Aug 2026 01:43:43 +0700 Subject: [PATCH 2/2] feat(lib/discord/types): type ActionSheet related exports more accurately --- lib/discord/src/types/index.ts | 60 +++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/lib/discord/src/types/index.ts b/lib/discord/src/types/index.ts index f87f343..5aa566d 100644 --- a/lib/discord/src/types/index.ts +++ b/lib/discord/src/types/index.ts @@ -1,10 +1,11 @@ import type { StackScreenProps } from '@react-navigation/stack' import type { ReactNavigationParamList } from '@revenge-mod/externals/react-navigation' -import type { AnyFunction } from '@revenge-mod/utils/types' +import type { AnyFunction, AnyObject } from '@revenge-mod/utils/types' import type { ComponentProps, ComponentType, FC, + ForwardRefExoticComponent, MemoExoticComponent, ReactElement, ReactNode, @@ -180,9 +181,20 @@ export namespace DiscordModules { openLazy>( sheet: Promise<{ default: T }>, key: string, - props: ComponentProps, + props: { + impressionName?: string + impressionProperties?: AnyObject + backdropKind?: string + disableHapticOnOpen?: boolean + appEntryKey?: string + } & ComponentProps, + // See ActionSheetStore reducer + stackingBehavior?: 'replaceTopSheet' | 'replaceAll' | 'stack', ): void hideActionSheet(key?: string): void + hideAllActionSheets(): void + setActionSheetZIndex(zIndex: number): void + resetActionSheetsForAppEntryKey(appEntryKey: string): void } // export namespace ActionSheetActionCreators { @@ -397,10 +409,50 @@ export namespace DiscordModules { // export type FormCheckbox = FC export interface ActionSheetProps { - children: ReactNode + scrollable?: boolean + startExpanded?: boolean + /** Whether the bottom sheet handle is disabled. */ + handleDisabled?: boolean + showGradient?: boolean + + startHeight?: number + maxHeight?: number + containerHeight?: number + contentHeight?: number + backdropOpacity?: number + + children?: ReactNode + header?: ReactNode + footer?: ReactNode + extraContent?: ReactNode + backdropChildren?: ReactNode + + handleComponent?: ComponentType | null + backgroundComponent?: ComponentType + + bodyStyles?: StyleProp + contentStyles?: StyleProp + backgroundStyles?: StyleProp + borderGradient?: string[] | Record + + onExpand?: () => void + onDismiss?: () => void + animatedIndex?: unknown + + keyboardShouldPersistTaps?: 'always' | 'never' | 'handled' | boolean + dismissAccessibilityLabel?: string } - export type ActionSheet = FC + export type ActionSheet = ForwardRefExoticComponent< + ActionSheetProps & + // See useBottomSheetImperativeHandle + RefAttributes<{ + expandActionSheet(): void + closeActionSheet(force?: boolean): void + collapseActionSheet(): void + snapToIndex(index: number): void + }> + > export interface ActionSheetCloseButtonProps extends Pick, 'variant' | 'onPress'> {}