-
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.
🛠 Refactor: Move to Deprecated Event Types
* `TODO:2023-03-30-15-52-53` - Move deprecated native modal event types from `RNIModalViewEvents` to `RNIModalViewDeprecatedEvents`, and update library imports/exports. * `TODO:2023-03-30-15-52-42` - WIP - Update typescript types for modal event objects to match native event object. Summary: * Deprecate modal events. * Extract deprecated modal event types in `rc/native_components/RNIModalView/RNIModalViewEvents` to `RNIModalViewDeprecatedEvents`. * Add placeholder modal event type for new modal event objects, i.e.: `RNIModalData`, `RNIModalBaseEvent`, `RNIModalBaseEvent`. * Update types in `RNIModalViewEvents` to use placeholder placeholder event types. * Update `RNIModalView` exports.
- Loading branch information
1 parent
7608eee
commit fa66d8c
Showing
3 changed files
with
98 additions
and
66 deletions.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
src/native_components/RNIModalView/RNIModalViewDeprecatedEvents.ts
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,75 @@ | ||
import type { NativeSyntheticEvent } from 'react-native'; | ||
|
||
// Event Object Types | ||
// ------------------ | ||
|
||
/** @deprecated */ | ||
export type RNIModalDeprecatedBaseEvent = { | ||
modalUUID: string; | ||
isInFocus: boolean; | ||
isPresented: boolean; | ||
modalLevel: number; | ||
modalLevelPrev: number; | ||
reactTag?: number; | ||
modalID?: string; | ||
}; | ||
|
||
// Native Event Object | ||
// ------------------- | ||
|
||
/** @deprecated */ | ||
export type OnModalShowEventObject = NativeSyntheticEvent< | ||
RNIModalDeprecatedBaseEvent & {} | ||
>; | ||
|
||
/** @deprecated */ | ||
export type OnModalDismissEventObject = NativeSyntheticEvent< | ||
RNIModalDeprecatedBaseEvent & {} | ||
>; | ||
|
||
/** @deprecated */ | ||
export type OnModalBlurEventObject = NativeSyntheticEvent< | ||
RNIModalDeprecatedBaseEvent & {} | ||
>; | ||
|
||
/** @deprecated */ | ||
export type OnModalFocusEventObject = NativeSyntheticEvent< | ||
RNIModalDeprecatedBaseEvent & {} | ||
>; | ||
|
||
/** @deprecated */ | ||
export type OnModalAttemptDismissEventObject = NativeSyntheticEvent< | ||
RNIModalDeprecatedBaseEvent & {} | ||
>; | ||
|
||
// Event Handler Types | ||
// ------------------- | ||
|
||
// prettier-ignore | ||
/** @deprecated */ | ||
export type OnModalShowEvent = ( | ||
event: OnModalShowEventObject | ||
) => void; | ||
|
||
// prettier-ignore | ||
/** @deprecated */ | ||
export type OnModalDismissEvent = ( | ||
event: OnModalDismissEventObject | ||
) => void; | ||
|
||
// prettier-ignore | ||
/** @deprecated */ | ||
export type OnModalBlurEvent = ( | ||
event: OnModalBlurEventObject | ||
) => void; | ||
|
||
// prettier-ignore | ||
/** @deprecated */ | ||
export type OnModalFocusEvent = ( | ||
event: OnModalFocusEventObject | ||
) => void; | ||
|
||
/** @deprecated */ | ||
export type OnModalAttemptDismissEvent = ( | ||
event: OnModalAttemptDismissEventObject | ||
) => void; |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
|
||
export * from './RNIModalView'; | ||
export * from './RNIModalViewEvents'; | ||
export * from './RNIModalViewDeprecatedEvents'; | ||
export * from './RNIModalViewTypes'; |