react-native-actions-sheet icon indicating copy to clipboard operation
react-native-actions-sheet copied to clipboard

Generic `returnValue` for SheetManager.show

Open ice-cap0 opened this issue 1 year ago • 2 comments

i would like SheetManager.show's return type to be the return type of callback

SheetManager.show('dialog-sheet', {
  payload: {
    callback: createUser,
  },
}).then(user => {
  // user is type any, would like UserType
declare module 'react-native-actions-sheet' {
  interface Sheets<T = any> {
    'dialog-sheet': SheetDefinition<{
      callback: () => T | Promise<T>
      returnValue: T
    }>
  }
}

is this possible?

ice-cap0 avatar Oct 24 '24 15:10 ice-cap0