Changeset View
Changeset View
Standalone View
Standalone View
lib/types/filter-types.js
// @flow | // @flow | ||||
import type { ResolvedThreadInfo } from './thread-types'; | import type { ResolvedThreadInfo } from './thread-types'; | ||||
export const calendarThreadFilterTypes = Object.freeze({ | export const calendarThreadFilterTypes = Object.freeze({ | ||||
THREAD_LIST: 'threads', | THREAD_LIST: 'threads', | ||||
NOT_DELETED: 'not_deleted', | NOT_DELETED: 'not_deleted', | ||||
}); | }); | ||||
export type CalendarThreadFilterType = $Values< | export type CalendarThreadFilterType = $Values< | ||||
typeof calendarThreadFilterTypes, | typeof calendarThreadFilterTypes, | ||||
>; | >; | ||||
export type CalendarCommunityFilter = { | |||||
+threadIDs: $ReadOnlyArray<string>, | |||||
}; | |||||
export type CalendarThreadFilter = { | export type CalendarThreadFilter = { | ||||
+type: 'threads', | +type: 'threads', | ||||
+threadIDs: $ReadOnlyArray<string>, | +threadIDs: $ReadOnlyArray<string>, | ||||
}; | }; | ||||
export type CalendarFilter = { +type: 'not_deleted' } | CalendarThreadFilter; | export type CalendarFilter = { +type: 'not_deleted' } | CalendarThreadFilter; | ||||
export const defaultCalendarFilters: $ReadOnlyArray<CalendarFilter> = [ | export const defaultCalendarFilters: $ReadOnlyArray<CalendarFilter> = [ | ||||
{ type: calendarThreadFilterTypes.NOT_DELETED }, | { type: calendarThreadFilterTypes.NOT_DELETED }, | ||||
]; | ]; | ||||
export const updateCalendarThreadFilter = 'UPDATE_CALENDAR_THREAD_FILTER'; | export const updateCalendarThreadFilter = 'UPDATE_CALENDAR_THREAD_FILTER'; | ||||
export const clearCalendarThreadFilter = 'CLEAR_CALENDAR_THREAD_FILTER'; | export const clearCalendarThreadFilter = 'CLEAR_CALENDAR_THREAD_FILTER'; | ||||
export const setCalendarDeletedFilter = 'SET_CALENDAR_DELETED_FILTER'; | export const setCalendarDeletedFilter = 'SET_CALENDAR_DELETED_FILTER'; | ||||
export const updateCalendarCommunityFilter = 'UPDATE_CALENDAR_COMMUNITY_FILTER'; | |||||
export const clearCalendarCommunityFilter = 'CLEAR_CALENDAR_COMMUNITY_FILTER'; | |||||
export type SetCalendarDeletedFilterPayload = { | export type SetCalendarDeletedFilterPayload = { | ||||
+includeDeleted: boolean, | +includeDeleted: boolean, | ||||
}; | }; | ||||
export type FilterThreadInfo = { | export type FilterThreadInfo = { | ||||
+threadInfo: ResolvedThreadInfo, | +threadInfo: ResolvedThreadInfo, | ||||
+numVisibleEntries: number, | +numVisibleEntries: number, | ||||
}; | }; |