Skip to content

Commit

Permalink
feat(libraries/modules/common): export filePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmDevs committed Dec 5, 2024
1 parent f68fb91 commit 57a84c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions libraries/modules/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const toasts = findByFilePath<DiscordModules.ToastActionCreators, true>(
'modules/toast/native/ToastActionCreators.tsx',
true,
)!
export const filePicker = findByProps<DiscordModules.FilePickerUtils>('handleDocumentSelection')!
export const messages = findByProps<DiscordModules.MessageUtils>('sendBotMessage')!

export const NavigationStack = findByProps<typeof import('@react-navigation/stack')>('createStackNavigator')!
Expand Down
12 changes: 12 additions & 0 deletions libraries/modules/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ export type LazyModule<T> = T extends unknown | undefined
/// COMMON

export namespace DiscordModules {
export interface FilePickerFile {
fileCopyUri: string | null
size: number
name: string
type: string
uri: string
}

export interface FilePickerUtils {
handleDocumentSelection(options?: { pickMultiple?: boolean }): Promise<FilePickerFile[]>
}

export interface ToastActionCreators {
open(options: {
key: string
Expand Down

0 comments on commit 57a84c9

Please sign in to comment.