utility-types#$PropertyType TypeScript Examples
The following examples show how to use
utility-types#$PropertyType.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 6 votes |
pickMultipleDayPartialOption = (
partialOption: $PropertyType<
PickMultipleDayPartialOptionAction,
'partialOption'
>,
): PickMultipleDayPartialOptionAction => ({
type: PICK_MULTIPLE_DAY_PARTIAL_OPTION,
partialOption,
})
Example #2
Source File: drawer.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 6 votes |
getDrawerItems = (
drawerNavigationState: DrawerNavigationState,
drawerDescriptors: DrawerDescriptorMap,
enabledModules?: EnabledModules,
) => {
const items: DrawerItem[] = [];
const subheaders: {[key: string]: undefined} = {};
if (enabledModules !== undefined) {
drawerNavigationState.routes.forEach((route) => {
const moduleName = SUBHEADER_MODULE_MAP[
route.params?.subheader
] as keyof $PropertyType<EnabledModules, 'modules'>;
if (enabledModules.modules[moduleName]) {
const item: DrawerItem = {
name: route.name,
key: route.key,
label: drawerDescriptors[route.key].options.drawerLabel,
subheader: undefined,
subheaderIcon: undefined,
};
if (!subheaders.hasOwnProperty(route.params.subheader)) {
item.subheader = route.params.subheader;
item.subheaderIcon = SUBHEADER_ICONS[route.params.subheader];
subheaders[route.params.subheader] = undefined;
}
items.push(item);
}
});
}
return items;
}
Example #3
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 6 votes |
fetchSubordinateLeaveEntitlementsFinished = (
payload?: $PropertyType<
FetchSubordinateLeaveEntitlementFinishedAction,
'payload'
>,
error: boolean = false,
): FetchSubordinateLeaveEntitlementFinishedAction => ({
type: FETCH_SUBORDINATE_LEAVE_ENTITLEMENT_FINISHED,
payload,
error,
})
Example #4
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 6 votes |
pickAssignLeaveMultipleDayPartialOption = (
partialOption: $PropertyType<
PickMultipleDayPartialOptionAction,
'partialOption'
>,
): PickMultipleDayPartialOptionAction => ({
type: PICK_MULTIPLE_DAY_PARTIAL_OPTION,
partialOption,
})
Example #5
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 6 votes |
pickApplyLeaveMultipleDayPartialOption = (
partialOption: $PropertyType<
PickMultipleDayPartialOptionAction,
'partialOption'
>,
): PickMultipleDayPartialOptionAction => ({
type: PICK_MULTIPLE_DAY_PARTIAL_OPTION,
partialOption,
})
Example #6
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchMyLeaveDetailsFinished = (
payload?: $PropertyType<FetchMyLeaveRequestDetailsFinishedAction, 'payload'>,
error: boolean = false,
): FetchMyLeaveRequestDetailsFinishedAction => ({
type: FETCH_MY_LEAVE_DETAILS_FINISHED,
payload,
error,
})
Example #7
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
setCommonLeaveScreensState = (
state: $PropertyType<SetCommonLeaveScreensStateAction, 'state'>,
): SetCommonLeaveScreensStateAction => ({
type: SET_COMMON_LEAVE_SCREENS_STATE,
state,
})
Example #8
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
setPickedState = (
key: Exclude<$PropertyType<SetPickedStateAction, 'key'>, undefined>,
state: boolean = false,
): SetPickedStateAction => ({
type: SET_PICKED_STATE,
key,
state,
})
Example #9
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchHolidaysFinished = (
holidays: $PropertyType<FetchHolidaysFinishedAction, 'holidays'>,
): FetchHolidaysFinishedAction => ({
type: FETCH_HOLIDAYS_FINISHED,
holidays,
})
Example #10
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchWorkWeekFinished = (
workWeek: $PropertyType<FetchWorkWeekFinishedAction, 'workWeek'>,
): FetchWorkWeekFinishedAction => ({
type: FETCH_WORK_WEEK_FINISHED,
workWeek,
})
Example #11
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchLeaveListFinished = (
payload?: $PropertyType<FetchLeaveListFinishedAction, 'payload'>,
error: boolean = false,
): FetchLeaveListFinishedAction => ({
type: FETCH_LEAVE_LIST_FINISHED,
payload,
error,
})
Example #12
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchEmployeeLeaveRequestFinished = (
payload?: $PropertyType<FetchEmployeeLeaveRequestFinishedAction, 'payload'>,
error: boolean = false,
): FetchEmployeeLeaveRequestFinishedAction => ({
type: FETCH_EMPLOYEE_LEAVE_REQUEST_FINISHED,
payload,
error,
})
Example #13
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
changeEmployeeLeaveRequestStatus = (
leaveRequestId: string,
action: $PropertyType<ChangeEmployeeLeaveRequestStatusAction, 'action'>,
): ChangeEmployeeLeaveRequestStatusAction => ({
type: CHANGE_EMPLOYEE_LEAVE_REQUEST_STATUS,
leaveRequestId,
action,
})
Example #14
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
changeMyLeaveRequestStatus = (
leaveRequestId: string,
action: $PropertyType<ChangeMyLeaveRequestStatusAction, 'action'>,
): ChangeMyLeaveRequestStatusAction => ({
type: CHANGE_MY_LEAVE_REQUEST_STATUS,
leaveRequestId,
action,
})
Example #15
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchLeaveTypesFinished = (
leaveTypes: $PropertyType<FetchLeaveTypesFinishedAction, 'leaveTypes'>,
): FetchLeaveTypesFinishedAction => ({
type: FETCH_LEAVE_TYPES_FINISHED,
leaveTypes,
})
Example #16
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchAttendanceRecordsFinished = (
payload?: $PropertyType<FetchAttendanceRecordsFinishedAction, 'payload'>,
error: boolean = false,
): FetchAttendanceRecordsFinishedAction => ({
type: FETCH_ATTENDANCE_RECORDS_FINISHED,
payload,
error,
})
Example #17
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchLeaveRecords = (
payload: $PropertyType<FetchLeaveRecordsAction, 'payload'>,
): FetchLeaveRecordsAction => ({
type: FETCH_LEAVE_RECORDS,
payload,
})
Example #18
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchAttendanceGraphRecords = (
payload: $PropertyType<FetchAttendanceGraphRecordsAction, 'payload'>,
): FetchAttendanceGraphRecordsAction => ({
type: FETCH_ATTENDANCE_GRAPH_RECORDS,
payload,
})
Example #19
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchHolidays = (
payload: $PropertyType<FetchHolidaysAction, 'payload'>,
): FetchHolidaysAction => ({
type: FETCH_HOLIDAYS,
payload,
})
Example #20
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchEmployeeAttendanceList = (
payload: $PropertyType<FetchEmployeeAttendanceListAction, 'payload'>,
): FetchEmployeeAttendanceListAction => ({
type: FETCH_EMPLOYEE_ATTENDANCE_LIST,
payload,
})
Example #21
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchSubordinatesFinished = (
payload?: $PropertyType<FetchSubordinatesFinishedAction, 'payload'>,
error: boolean = false,
): FetchSubordinatesFinishedAction => ({
type: FETCH_SUBORDINATES_FINISHED,
payload,
error,
})
Example #22
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
pickSubordinate = (
subordinate?: $PropertyType<PickSubordinateAction, 'subordinate'>,
): PickSubordinateAction => ({
type: PICK_SUBORDINATE,
subordinate,
})
Example #23
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
savePunchInRequest = (
payload: $PropertyType<PunchInRequestAction, 'payload'>,
): PunchInRequestAction => ({
type: PUNCH_IN_REQUEST,
payload,
})
Example #24
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
savePunchOutRequest = (
payload: $PropertyType<PunchOutRequestAction, 'payload'>,
): PunchOutRequestAction => ({
type: PUNCH_OUT_REQUEST,
payload,
})
Example #25
Source File: Globals.tsx From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
Globals = () => {
const [toastShow, setToastShow] = useState(false);
const {loader, snackMessage, closeSnackMessage} = useGlobals();
const theme = useTheme();
useEffect(() => {
if (!toastShow) {
if (snackMessage.open) {
setTimeout(() => {
closeSnackMessage();
setToastShow(false);
}, 5000);
setToastShow(true);
}
}
}, [toastShow, snackMessage, closeSnackMessage]);
return (
<>
<Overlay modalProps={{visible: loader.open}}>{loader.content}</Overlay>
<SnackDialog
isVisible={snackMessage.open}
closeSnackMessage={closeSnackMessage}
viewProps={{
style: snackMessage.type
? {backgroundColor: theme.palette[snackMessage.type]}
: undefined,
}}>
<TouchableOpacity
activeOpacity={0.7}
onPress={() => {
closeSnackMessage();
setToastShow(false);
}}>
<View style={[styles.snackView, {padding: theme.spacing * 4}]}>
{snackMessage.type ? (
<View style={styles.iconView}>
<Icon
name={ICON_MAP[snackMessage.type].name}
type={
ICON_MAP[snackMessage.type].type as $PropertyType<
IconProps,
'type'
>
}
style={{color: theme.typography.lightColor}}
/>
</View>
) : null}
<View
style={{
paddingLeft: theme.spacing * 3,
paddingRight: theme.spacing * 5,
paddingTop: theme.spacing * 0.5,
}}>
<Text
style={{
color: theme.typography.lightColor,
}}>
{snackMessage.message}
</Text>
</View>
</View>
</TouchableOpacity>
</SnackDialog>
</>
);
}
Example #26
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
myInfoFailed = (
state: $PropertyType<MyInfoFailedAction, 'state'>,
error?: $PropertyType<MyInfoFailedAction, 'error'>,
): MyInfoFailedAction => ({
type: MY_INFO_FAILED,
state,
error,
})
Example #27
Source File: selectors.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
selectMyInfoFailed = createSelector<
RootState,
AuthState,
$PropertyType<AuthState, 'myInfoFailed'>
>([selectAuth], (auth) => auth.myInfoFailed)
Example #28
Source File: selectors.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
selectMyInfoError = createSelector<
RootState,
AuthState,
$PropertyType<AuthState, 'myInfoError'>
>([selectAuth], (auth) => auth.myInfoError)
Example #29
Source File: actions.ts From orangehrm-os-mobile with GNU General Public License v3.0 | 5 votes |
fetchConfigHelp = (
payload: $PropertyType<FetchHelpConfigAction, 'payload'>,
): FetchHelpConfigAction => ({
type: FETCH_HELP_CONFIG,
payload,
})