import { BBox, Point, Position } from '@turf/helpers'; declare type APIResponse> = { message: string; result?: T; }; declare type PagifiedAPIRequest = { pageSize?: number; pageIndex?: number; }; declare type PagifiedAPIResponse> = APIResponse & { meta?: { currentPage: number; from: number; lastPage: number; perPage: number; to: number; total: number; }; }; declare type Experience = 'Beginner' | 'Intermediate' | 'Experienced' | 'Professional'; declare type Terrain = 'Road' | 'Gravel' | 'Mountain' | 'Mixed'; declare type UserConnection = 'following' | 'none' | 'requested' | 'myself'; declare type ClubConnection = 'member' | 'notRequested' | 'requested'; declare type Gender = 'Male' | 'Female' | 'Other'; declare type Ride = { id: string; /** * ride creation date, excluding creator's timezone offset */ createDate: Date; title: string; description: string; region: Region; /** * A [LineString geometry object](https://tools.ietf.org/html/rfc7946#section-3.1.4) * encoded with Google Maps's [Polyline Encoding Algrorithm * ](https://developers.google.com/maps/documentation/utilities/polylinealgorithm). */ path: string; difficulty: Experience; terrain: Terrain; /** * start date / time of a ride (excluding timezone offset) */ startDateTime: Date; /** * the current timezone in display format. (e.g. "America/Los_Angeles") */ timezone: string; distance: Distance; elevationGain: Distance; duration: string; /** * organiser can be either a club or a user. For leaving flexibility * to post MVP releases, an array is used, so that in the future, * multiple users / clubs can be organisers. */ organisers: Organiser[]; /** * a ride can be private, public or stealth. */ privacy: Privacy; attendeeAvatars: string[]; attendeeCount: number; likeCount: number; commentCount: number; joined: boolean; liked: boolean; womenOnly?: boolean; backgroundImageKey?: BackgroundImageKey; cancelled?: boolean; cancellationReason?: string; inviteeCount?: number; }; declare type BackgroundImageKey = 'all_for_the_cafe' | 'big_day_in_the_saddle' | 'big_group' | 'bumpy_ride' | 'cake_day' | 'cancel_work_lets_ride' | 'carb_loaded' | 'chain_gang' | 'club_run' | 'flat_ride' | 'hilly_ride' | 'its_going_to_be_cold' | 'its_going_to_be_hot' | 'its_going_to_be_wet' | 'new_bike_day' | 'new_kit_day' | 'no_dropping_allowed' | 'old_guys_rule' | 'short_spin' | 'super_fast' | 'training_day' | 'women_only'; declare const isClub: (organiser: Organiser) => organiser is PartialClub; /** * Type guard to distingues a Ride alert from a FollowAlert. * Please make sure to update the implementation when type values are changed by J24. * @param alert * @returns boolean */ declare const isRideAlert: (alert: RideAlert | FollowAlert) => alert is RideAlert; declare const isComment: (commentOrReply: Comment | Reply) => commentOrReply is Comment; declare const isSearchAreaBounds: (searchArea: SearchAreaBounds | SearchAreaWithRadius) => searchArea is SearchAreaBounds; declare const isRide: (pinEntity: PinEntity) => pinEntity is Ride; declare const isClusterPoint: (pinEntity: PinEntity) => pinEntity is ClusterPoint; declare type PointProperties = ClusterPointProperties | NonClusterPointProperties; declare type ClusterPointProperties = { type: Extract; entity: ClusterPoint; }; declare type NonClusterPointProperties = { type: Extract; entity: Exclude; }; declare type Club = { id: string; avatarUri: string; clubname: string; title: string; location: string; bio?: string; memberCount: number; connection: ClubConnection; }; declare type PartialClub = Pick; declare type PartialUser = Pick; declare type NearbyUser = PartialUser & { proximity: Distance; }; declare type RequestRideInvite = { rideId: string; users: string[]; }; declare type ResponseRideInvite = APIResponse; declare type RequestListUsersToInvite = PagifiedAPIRequest & { rideId: string; queryString?: string; }; declare type ResponseListNearbyUsersToInvite = PagifiedAPIResponse<{ users: (NearbyUser & { invited: boolean; })[]; }>; declare type ResponseListFollowedUsersToInvite = PagifiedAPIResponse<{ users: (PartialUser & { invited: boolean; })[]; }>; declare type Organiser = Omit | PartialClub; declare type Commenter = Omit | PartialClub; declare type User = { id: string; email?: string; username: string; firstName: string; lastName: string; experience: Experience; gender: Gender; avatarUri?: string; location?: string; bio?: string; stats: { following: number; followers: number; totalRides: number; clubs: number; }; connection: UserConnection; privacy: Exclude; preferences?: { showLocationOnExplore: boolean; showLocationOnProfile: boolean; notifications: { rideReminders: boolean; rideUpdates: boolean; followAlertsAndRequests: boolean; }; }; }; declare type Post = { id: string; author: Organiser; date: Date; text: string; imageUri?: string; likeCount: number; commentCount: number; liked: boolean; }; declare type RequestGenerateMagicLink = { email: string; }; declare type ResponseGenerateMagicLink = APIResponse; declare type RequestCreateUser = { email: string; username: string; firstName: string; lastName: string; experience: Experience; gender: Gender; notificationsEnabled: boolean; locationSharingEnabled: boolean; termsAccepted: boolean; }; declare type ResponseCreateUser = APIResponse<{ user: User; }>; declare type RequestGeocodingData = { queryString: string; }; declare type GeocodingFeature = { placeName: string; placeType: string; featureKey: string; center: Position; placeNameAlternatives?: string[]; bbox?: BBox; }; declare type ResponseGeocodingData = APIResponse<{ locations: GeocodingFeature[]; }>; declare type RequestGetFeed = PagifiedAPIRequest; declare type RequestGetUpcomingRides = PagifiedAPIRequest & { filter: { startDate?: DateRange; timezone: string; }; }; declare type RequestGetUpcomingCalendar = { filter: { date: { from: Date; to: Date; }; timezone: string; }; }; declare type RequestGetUpcomingCalendarSerialized = { dateFrom: string; dateTo: string; timezone: string; }; declare type ResponseGetUpcomingCalendar = APIResponse<{ dates: Date[]; }>; declare type ResponseGetUpcomingRides = PagifiedAPIResponse<{ rides: Ride[]; }>; declare type RequestGetUsersRides = PagifiedAPIRequest & { userId: string; }; declare type RequestGetClubRides = PagifiedAPIRequest & { clubId: string; }; declare type RequestCreateRide = { ride: Pick & { rideDataId: string; }; }; declare type RequestUpdateRide = Pick; declare type ResponseCreateRide = APIResponse<{ ride: Ride; }>; declare type RequestCancelRide = { id: string; message: string; }; declare type ResponseCancelRide = APIResponse; declare type ResponseUpdateRide = APIResponse<{ ride: Ride; }>; declare type RequestSearchRidesSerialized = { dateFrom?: string; dateTo?: string; }; declare type ResponseGetRides = PagifiedAPIResponse<{ rides: Ride[]; }>; declare type ResponseGetClubRides = PagifiedAPIResponse<{ rides: (Ride & { organisers: PartialClub[]; })[]; }>; declare type ResponseGetPosts = PagifiedAPIResponse<{ posts: Post[]; }>; declare type RequestValidateMagicLink = { email: string; magiclink: string; magiclinkUuid: string; }; declare type ResponseValidateMagicLink = APIResponse<{ access_token: string; }>; declare type RequestValidateUsername = { username: string; }; declare type ResponseValidateUsername = APIResponse; declare type RequestGetFollowing = { id: string; pageSize?: number; pageIndex?: number; }; declare type RequestGetFollowers = PagifiedAPIRequest & { id: string; }; declare type RequestGetClubs = PagifiedAPIRequest & { id: string; }; declare type RequestGetRideLikes = PagifiedAPIRequest & { rideId: string; }; declare type RequestGetRide = { id: string; }; declare type ResponseGetRide = APIResponse<{ ride: Ride; }>; declare type RequestGetRideComments = PagifiedAPIRequest & { id: string; }; declare type RequestGetPostComments = PagifiedAPIRequest & { clubId: string; postId: string; }; declare type RequestSendClubPostComment = { clubId: string; postId: string; comment: string; replyToCommentId?: string; }; declare type ResponseSendClubPostComment = APIResponse; declare type RequestSendRideComment = { rideId: string; comment: string; replyToCommentId?: string; }; declare type ResponseSendRideComment = APIResponse; declare type RequestToggleClubPostLike = { clubId: string; postId: string; }; declare type ResponseToggleClubPostLike = APIResponse<{ like: LikeResponse; }>; declare type RequestToggleRideLike = { rideId: string; }; declare type ResponseToggleRideLike = APIResponse<{ like: LikeResponse; }>; declare type LikeResponse = 'LikeAdded' | 'LikeRemoved'; declare type JoinRideResponse = 'Joined' | 'NoLongerJoined'; declare type RequestGetRideCommentReplies = PagifiedAPIRequest & { rideId: string; commentId: string; }; declare type ResponseGetRideCommentReplies = PagifiedAPIResponse<{ comments: Reply[]; }>; declare type RequestGetPostCommentReplies = PagifiedAPIRequest & { clubId: string; postId: string; commentId: string; }; declare type ResponseGetPostCommentReplies = PagifiedAPIResponse<{ comments: Reply[]; }>; declare type ResponseGetRideComments = PagifiedAPIResponse<{ comments: Comment[]; }>; declare type ResponseGetPostComments = PagifiedAPIResponse<{ comments: Comment[]; }>; declare type RequestGetRideAttendees = PagifiedAPIRequest & { rideId: string; }; declare type RequestGetRideInvitees = PagifiedAPIRequest & { rideId: string; }; declare type RequestGetMembers = PagifiedAPIRequest & { clubId: string; queryString?: string; }; declare type ResponseGetRideLikes = PagifiedAPIResponse<{ users: PartialUser[]; }>; declare type ResponseGetRideAttendees = PagifiedAPIResponse<{ users: (PartialUser & { invited?: boolean; })[]; }>; declare type ResponseGetRideInvitees = PagifiedAPIResponse<{ users: (PartialUser & { declined?: boolean; })[]; }>; declare type ResponseGetMembers = PagifiedAPIResponse<{ users: PartialUser[]; }>; declare type ResponseGetFollowing = PagifiedAPIResponse<{ users: PartialUser[]; }>; declare type ResponseGetFollowers = PagifiedAPIResponse<{ users: PartialUser[]; }>; declare type ResponseGetClubs = PagifiedAPIResponse<{ clubs: Club[]; }>; declare type RequestGetClubPosts = PagifiedAPIRequest & { id: string; }; declare type ResponseGetClubPosts = PagifiedAPIResponse<{ posts: Post[]; }>; declare type RequestGetClubPost = PagifiedAPIRequest & { clubId: string; postId: string; }; declare type ResponseGetClubPost = PagifiedAPIResponse<{ post: Post; }>; declare type RequestDownloadRideData = { id: string; }; declare type PinCategory = 'all' | 'rider' | 'ride' | 'club' | 'riderCluster' | 'rideCluster' | 'clubCluster'; declare type SearchAreaBounds = { ne: GeoJSON.Position; sw: GeoJSON.Position; }; declare type SearchAreaWithRadius = { center: Region['center']; searchRadius: Distance; }; declare type RequestGetPins = { searchAreaBounds: SearchAreaBounds; searchAreaWithRadius?: SearchAreaWithRadius; zoomLevel: number; category?: Extract; queryString?: string; maxDistance?: Distance; terrain?: Terrain; riderExperience?: Experience; rideDifficulty?: Experience; startDateTimeFrom?: Date; startDateTimeTo?: Date; timezone?: string; womenOnly?: boolean; }; declare type ResponseGetPins = APIResponse>; declare type ClusterPoint = { clusterId: string; count: number; }; declare type PinEntity = PartialUser | Club | Ride | ClusterPoint; declare type RequestGetUser = { id: string; }; declare type RequestFollowUser = { id: string; }; declare type RequestUnfollowUser = { id: string; }; declare type RequestJoinClub = { id: string; }; declare type RequestLeaveClub = { id: string; }; declare type RequestAnswerFollower = { response: 'accept' | 'reject'; id: string; }; declare type RequestAnswerRideInvitation = { response: 'accept' | 'reject'; id: string; }; declare type ResponseAnswerFollower = APIResponse; declare type ResponseAnswerRideInvitation = APIResponse; declare type RequestChangeEmail = { newEmail: string; originalEmail: string; }; declare type RequestVerifyChangedEmail = { verification: string; verificationUuid: string; newEmail: string; originalEmail: string; }; declare type ResponseChangeEmail = APIResponse; declare type ResponseVerifyChangedEmail = APIResponse; declare type ResponseFollowUser = APIResponse; declare type ResponseUnfollowUser = APIResponse; declare type ResponseJoinClub = APIResponse; declare type ResponseLeaveClub = APIResponse; declare type ResponseGetUser = APIResponse<{ user: User; }>; declare type RequestGetClub = { id: string; }; declare type ResponseGetClub = APIResponse<{ club: Club; }>; declare type DateRange = { from?: Date; to?: Date; }; declare type Region = { placeName: string; center: GeoJSON.Position; }; declare type MeasurementUnit = 'miles' | 'kilometers' | 'degrees' | 'radians'; declare type Distance = { value: number; unit: Exclude; }; declare type Privacy = 'Public' | 'Private' | 'Stealth'; declare type RequestUpdateProfile = { firstName: string; lastName: string; location: string; showLocationOnProfile: boolean; bio: string; experience: Experience; }; declare type ResponseUpdateProfile = APIResponse; declare type RequestUpdatePrivacySettings = { privacyLevel: Exclude; showLocationOnExplore: boolean; }; declare type ResponseUpdatePrivacySettings = APIResponse; declare type RideAlertType = 'rideInvitation' | 'rideDateTimeChanged' | 'rideCancelled' | 'rideRouteChanged' | 'rideAttending' | 'rideComment' | 'rideCreated' | 'rideStartingInHour'; declare type FollowAlertType = 'followRequest' | 'followed' | 'joinedClub'; declare type RequestGetRideAlerts = PagifiedAPIRequest & { alerts: RideAlertType[]; }; declare type RequestGetFollowAlerts = PagifiedAPIRequest & { alerts: FollowAlertType[]; }; declare type BaseAlert = { id: string; dateTime: Date; }; declare type RideAlert = BaseAlert & { type: RideAlertType; payload: RideInvitationAlert | RideDateTimeChangedAlert | RideCancelledAlert | RideRouteChangedAlert | RideAttendingAlert | RideCommentAlert | RideCreatedAlert | RideStartsInHourAlert; }; declare type FollowAlert = BaseAlert & { type: FollowAlertType; payload: FollowRequestAlert | FollowedAlert | ClubJoined; }; declare type ResponseGetRideAlerts = PagifiedAPIResponse<{ alerts: RideAlert[]; }>; declare type ResponseGetFollowAlerts = PagifiedAPIResponse<{ alerts: FollowAlert[]; }>; declare type RideInvitationAlert = { organisers: Organiser[]; rideId: string; }; declare type RideDateTimeChangedAlert = { rideId: string; rideTitle: string; organisers: Organiser[]; newStartDateTime: Date; }; declare type RideCancelledAlert = { rideId: string; rideTitle: string; organisers: Organiser[]; reason: string; }; declare type RideRouteChangedAlert = { rideId: string; rideTitle: string; organisers: Organiser[]; }; declare type RideAttendingAlert = { userId: string; firstName: string; lastName: string; experience: Experience; avatarUri?: string; rideId: string; rideTitle: string; }; declare type RideCommentAlert = { rideId: string; rideTitle: string; organisers: Organiser[]; comment: string; }; declare type RideCreatedAlert = { rideId: string; }; declare type RideStartsInHourAlert = { rideId: string; }; declare type FollowRequestAlert = { userId: string; experience: Experience; firstName: string; lastName: string; avatarUri?: string; }; declare type FollowedAlert = { userId: string; experience: Experience; firstName: string; lastName: string; avatarUri?: string; }; declare type ClubJoined = { clubId: string; clubTitle: string; avatarUri?: string; }; declare type Comment = { id: string; commenter: Commenter; comment: string; dateTime: Date; repliesCount: number; }; declare type Reply = { id: string; commenter: Commenter; comment: string; dateTime: Date; replyToCommentId: string; }; declare type RequestUpdateLocation = { latitude: number; longitude: number; }; declare type ResponseUpdateLocation = APIResponse; declare type ResponseUpdateAvatar = APIResponse<{ avatarUri: string; }>; declare type ResponseUploadGPX = APIResponse & { rideDataId: string; }>; declare type RequestToggleRideAttendance = { id: string; }; declare type ResponseToggleRideAttendance = APIResponse<{ joined: JoinRideResponse; }>; declare type RequestChangeNotificationPreferences = { rideReminders: boolean; rideUpdates: boolean; followAlertsAndRequests: boolean; }; declare type ResponseChangeNotificationPreferences = APIResponse; export { isClub, isComment, isRideAlert, APIResponse, User, Ride, Club, Post, UserConnection, Experience, RequestGenerateMagicLink, RequestGetClubs, RequestGetFollowers, RequestGetFollowing, RequestValidateMagicLink, RequestValidateUsername, ResponseValidateUsername, ResponseGenerateMagicLink, ResponseCreateUser, ResponseGetClubs, ResponseGetFollowers, ResponseGetFollowing, RequestCreateUser, ResponseValidateMagicLink, ResponseGetPosts, PointProperties, RequestGetPins, ResponseGetPins, PinCategory, PinEntity, ClubConnection, RequestGetUser, ResponseGetUser, RequestFollowUser, ResponseFollowUser, RequestAnswerFollower, ResponseAnswerFollower, RequestUnfollowUser, ResponseUnfollowUser, Region, Privacy, RequestGetFeed, RequestCreateRide, ResponseCreateRide, RequestSearchRidesSerialized, RequestJoinClub, RequestLeaveClub, ResponseJoinClub, ResponseLeaveClub, Terrain, RequestGetClub, ResponseGetClub, RequestGetMembers, ResponseGetMembers, RequestGetClubPosts, ResponseGetClubPosts, SearchAreaBounds, SearchAreaWithRadius, Gender, ResponseGetRideLikes, RequestGetRideLikes, RequestGetRide, ResponseGetRide, RequestGetRideAttendees, ResponseGetRideAttendees, RequestUpdateProfile, ResponseUpdateProfile, RequestUpdatePrivacySettings, ResponseUpdatePrivacySettings, RequestGetRideAlerts, ResponseGetRideAlerts, RideAlert, RequestGetUpcomingRides, RequestGetUsersRides, RequestGetClubRides, ResponseGetUpcomingRides, ResponseGetClubRides, ResponseGetRides, Comment, Reply, RequestGetRideComments, ResponseGetRideComments, RequestGetRideCommentReplies, ResponseGetRideCommentReplies, RequestUpdateLocation, ResponseUpdateLocation, ResponseUpdateAvatar, ResponseUploadGPX, Distance, BackgroundImageKey, RequestToggleClubPostLike, ResponseToggleClubPostLike, LikeResponse, RequestGetPostComments, ResponseGetPostComments, RequestGetPostCommentReplies, ResponseGetPostCommentReplies, RequestSendClubPostComment, ResponseSendClubPostComment, RequestSendRideComment, ResponseSendRideComment, PartialClub, PartialUser, Organiser, Commenter, RequestAnswerRideInvitation, ResponseAnswerRideInvitation, PagifiedAPIResponse, ClusterPoint, ClusterPointProperties, NonClusterPointProperties, isRide, isClusterPoint, isSearchAreaBounds, RequestUpdateRide, ResponseUpdateRide, RequestGetUpcomingCalendar, ResponseGetUpcomingCalendar, RequestGetUpcomingCalendarSerialized, RequestToggleRideLike, ResponseToggleRideLike, ResponseToggleRideAttendance, RequestToggleRideAttendance, JoinRideResponse, RequestCancelRide, ResponseCancelRide, RequestGeocodingData, ResponseGeocodingData, RequestChangeNotificationPreferences, ResponseChangeNotificationPreferences, RequestChangeEmail, ResponseChangeEmail, RequestVerifyChangedEmail, ResponseVerifyChangedEmail, RequestGetClubPost, ResponseGetClubPost, RequestDownloadRideData, RequestRideInvite, ResponseRideInvite, RequestListUsersToInvite, ResponseListNearbyUsersToInvite, ResponseListFollowedUsersToInvite, RequestGetFollowAlerts, ResponseGetFollowAlerts, FollowAlert, RideInvitationAlert, RideDateTimeChangedAlert, RideCancelledAlert, RideRouteChangedAlert, RideAttendingAlert, RideCommentAlert, RideCreatedAlert, RideStartsInHourAlert, FollowRequestAlert, FollowedAlert, ClubJoined, GeocodingFeature, RideAlertType, FollowAlertType, RequestGetRideInvitees, ResponseGetRideInvitees, NearbyUser, MeasurementUnit };