@nnc-digital/nnc-design-system
Version:
Design system for West & North Northamptonshire Councils, two unitary councils encompassing Wellingborough, Corby, Daventry, East Northants, Kettering, Northampton, Northamptonshire County and South Northants.
58 lines (57 loc) • 2.34 kB
TypeScript
import { EventProps } from '../Event/Event.types';
/**
* Filters out events that have already ended based on their end date/time
* @param events Array of events to filter
* @param hideOldEvents Whether to hide old events (defaults to true)
* @returns Filtered array of events
*/
export declare const filterOldEvents: (events: EventProps[], hideOldEvents?: boolean) => EventProps[];
/**
* Filters events by month and year
* @param events Array of events to filter
* @param selectedMonth Month (1-12) or undefined for all months
* @param selectedYear Year or undefined for all years
* @returns Filtered array of events
*/
export declare const filterEventsByDate: (events: EventProps[], selectedMonth?: number, selectedYear?: number) => EventProps[];
/**
* Filters events by event type
* @param events Array of events to filter
* @param selectedEventTypes Array of selected event type IDs
* @returns Filtered array of events
*/
export declare const filterEventsByType: (events: EventProps[], selectedEventTypes: string[]) => EventProps[];
/**
* Filters events by audience
* @param events Array of events to filter
* @param selectedAudiences Array of selected audience IDs
* @returns Filtered array of events
*/
export declare const filterEventsByAudience: (events: EventProps[], selectedAudiences: string[]) => EventProps[];
/**
* Filters events by search term (searches in name and description)
* @param events Array of events to filter
* @param searchTerm Search term to look for
* @returns Filtered array of events
*/
export declare const filterEventsBySearch: (events: EventProps[], searchTerm: string) => EventProps[];
/**
* Sorts events by date (earliest first)
* @param events Array of events to sort
* @returns Sorted array of events
*/
export declare const sortEventsByDate: (events: EventProps[]) => EventProps[];
/**
* Comprehensive filter function that applies all filters
* @param events Array of events to filter
* @param filters Object containing all filter criteria
* @returns Filtered and sorted array of events
*/
export declare const applyAllEventFilters: (events: EventProps[], filters: {
hideOldEvents?: boolean;
selectedMonth?: number;
selectedYear?: number;
selectedEventTypes?: string[];
selectedAudiences?: string[];
searchTerm?: string;
}) => EventProps[];