-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⭐️ Impl: Add
ModalViewEmitterDeprecated
Related: * `TODO:2023-03-04-13-15-11` - Refactor: Update Modal Events * `TODO:2023-03-30-15-53-01` - Add `deprecated` suffix to deprecated events. Summary: Move deprecated events in `ModalViewEmitter ` to `ModalViewEmitterDeprecated`, and update exports.
- Loading branch information
1 parent
f5483ff
commit 7fa4a18
Showing
3 changed files
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import type { LayoutChangeEvent } from 'react-native'; | ||
import type { TSEventEmitter } from '@dominicstop/ts-event-emitter'; | ||
|
||
import type { | ||
OnModalBlurEventObject, | ||
OnModalFocusEventObject, | ||
OnModalShowEventObject, | ||
OnModalDismissEventObject, | ||
OnModalDidDismissEventObject, | ||
OnModalWillDismissEventObject, | ||
OnModalAttemptDismissEventObject, | ||
} from 'src/native_components/RNIModalView'; | ||
|
||
import type { KeyMapType } from '../../types/UtilityTypes'; | ||
|
||
export enum ModalViewEmitterEventsDeprecated { | ||
// `RNIModalView` Events | ||
onModalBlur = 'onModalBlur', | ||
onModalFocus = 'onModalFocus', | ||
onModalShow = 'onModalShow', | ||
onModalDismiss = 'onModalDismiss', | ||
onModalDidDismiss = 'onModalDidDismiss', | ||
onModalWillDismiss = 'onModalWillDismiss', | ||
onModalAttemptDismiss = 'onModalAttemptDismiss', | ||
|
||
onLayoutModalContentContainer = 'onLayoutModalContentContainer', | ||
} | ||
|
||
// TODO: See TODO:20230-03-04-12-58-40 - Refactor: Types - | ||
// Remove KeyMapType Usage | ||
// | ||
export type ModalViewEmitterEventMapDeprecated = | ||
// prettier-ignore | ||
KeyMapType<ModalViewEmitterEventsDeprecated, { | ||
// `RNIModalView` Events | ||
onModalBlur: OnModalBlurEventObject['nativeEvent']; | ||
onModalFocus: OnModalFocusEventObject['nativeEvent']; | ||
onModalShow: OnModalShowEventObject['nativeEvent']; | ||
onModalDismiss: OnModalDismissEventObject['nativeEvent']; | ||
onModalDidDismiss: OnModalDidDismissEventObject['nativeEvent']; | ||
onModalWillDismiss: OnModalWillDismissEventObject['nativeEvent']; | ||
onModalAttemptDismiss: OnModalAttemptDismissEventObject['nativeEvent']; | ||
|
||
onLayoutModalContentContainer: LayoutChangeEvent['nativeEvent']; | ||
} | ||
>; | ||
|
||
export type ModalViewEventEmitterDeprecated = TSEventEmitter< | ||
ModalViewEmitterEventsDeprecated, | ||
ModalViewEmitterEventMapDeprecated | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './ModalView'; | ||
export * from './ModalViewTypes'; | ||
export * from './ModalViewEmitter'; | ||
export * from './ModalViewEmitterDeprecated'; |