event-app-api
Version:
Package for easy access to Event App API
130 lines (129 loc) • 3.52 kB
TypeScript
import { Attendee } from "../attendee/types";
import { Exhibition } from "../event/types";
export type Pagination = {
total: number;
count: number;
per_page: number;
current_page: number;
total_pages: number;
links: {
previous?: string;
next?: string;
};
};
export type ResponsePaginationType<T> = {
data: T[];
meta: {
pagination: Pagination;
};
};
export type PublicEventsProviderState = {
isInitialized: boolean;
isLoading: boolean;
isError: boolean;
errorMessage: string;
allEvents: ResponsePaginationType<PublicEventItem>;
eventMenu: any[];
selectedPublicEvent: PublicEventItem;
exhibitions: ResponsePaginationType<Exhibition>;
speakers: ResponsePaginationType<Attendee>;
agenda: any;
};
export type PublicEventItem = {
about: string;
account: string;
address: {
city: string;
state: string;
street: string;
country: string;
postalCode: string;
};
advertisement: {
menuUrl: string;
wallUrl: string;
lobbyUrl: string;
centerUrl: string;
menuEnabled: boolean;
centerEnabled: boolean;
centerImageBig: string;
centerImageMedium: string;
centerImageSmall: string;
centerUrlEnabled: boolean;
centerUrlType: string;
lobbyEnabled: boolean;
lobbyImageBig: string;
lobbyImageMedium: string;
lobbyImageSmall: string;
lobbyUrlEnabled: boolean;
lobbyUrlType: string;
menuImageBig: string;
menuImageMedium: string;
menuImageSmall: string;
menuUrlEnabled: boolean;
menuUrlType: string;
wallEnabled: boolean;
wallImageBig: string;
wallImageMedium: string;
wallImageSmall: string;
wallUrlEnabled: boolean;
wallUrlType: string;
};
contact: {
xing: string;
email: string;
phone: string;
mobile: string;
twitter: string;
facebook: string;
instagram: string;
linkedin: string;
website1: string;
website2: string;
};
description: string;
design: {
themeColor: string;
headerColor: string;
expoLobbyImage: string;
backgroundColor: string;
headerFontColor: string;
agendaLobbyImage: string;
backgroundDesktopImage: string;
backgroundMobileImage: string;
backgroundTabletImage: string;
speakerLobbyImage: string;
startScreenMobileImage: string;
};
end_date: string;
id: string;
images: {
logo: string;
picture: string;
thumbnail: string;
logoTransparent: string;
};
language: string;
menu: any[];
name: string;
open_date: string;
slug: string;
start_date: string;
tags: string[];
timezone: string;
translation: string;
type: string;
updated_at: string;
location: any;
video: {
reference: string;
type: string;
};
};
export type PublicEventsContextType = {
init: () => Promise<void>;
fetchAllEvents: (nbPage?: number, params?: string) => Promise<any>;
fetchExhibitions: (eventId: string, nbPage?: number, params?: string) => Promise<any>;
fetchAgenda: (eventId: string, nbPage?: number, params?: string) => Promise<any>;
selectPublicEvent: (selectedPublicEvent: PublicEventItem) => void;
} & PublicEventsProviderState;