/** * The Mappedin Location Extension */ import type { ConnectionId, EntranceId, FloorId, ObstructionId, SpaceId } from '../types/core.js'; import type { AnnotationId } from './annotation.js'; import type { AreaId } from './area.js'; import type { CategoryId } from './category.js'; import type { DayOrPublicHoliday, Time } from './index.js'; /** * An ID for a location * * **Important**: While the suffix can be any length, it is strongly recommended to use * suffixes of at least 8 characters to ensure uniqueness and avoid collisions. * * @pattern ^loc_[A-Za-z0-9_-]+$ */ export type LocationId = string; export type LocationSpaceMapping = { floor: FloorId; id: SpaceId; }; export type LocationObstructionMapping = { floor: FloorId; id: ObstructionId; }; export type LocationEntranceMapping = { floor: FloorId; id: EntranceId; }; export type LocationAnnotationMapping = { floor: FloorId; id: AnnotationId; }; export type LocationAreaMapping = { floor: FloorId; id: AreaId; }; export type LocationSocial = { /** * The name of the social media platform. */ name: string; /** * The URL of the social media profile * @format uri */ url: string; }; /** * The location's pictures * Single-field object, because it's plausible we might add captions or comments in the future */ export type LocationPicture = { /** * @format uri */ url?: string; }; export type LocationLink = { label: string; /** * The URL of the link * @format uri */ url: string; }; /** * We (almost) follow this schema (http://schema.org/OpeningHoursSpecification) * The only difference is that we (like Google: https://developers.google.com/search/docs/data-types/local-businesses) * accept dayOfWeek as an array as well as an individual day. * * Behavioral notes: * - if the "opens" property is not present, the location is closed, and the closes * property is ignored (Schema.org style) * - if opens/closes are both set to 00:00, the location is closed (Google style) * - If special hours do not specifiy certain weekdays being open, those weekdays are closed. * - Not specifying dayOfWeek is equivalent to specifying every day of the week. * - we will omit the '@type' property when producing MVFs. But we won't reject 3rd party MVFs * that include it. * */ export type OpeningHoursSpecification = { /** * The type of opening hours * * @default 'OpeningHoursSpecification' */ '@type'?: 'OpeningHoursSpecification'; /** * The time the opening hours start * */ opens?: Time; /** * The time the opening hours end */ closes?: Time; /** * The days of the week the opening hours apply to */ dayOfWeek?: DayOrPublicHoliday | [DayOrPublicHoliday] | DayOrPublicHoliday[]; /** * The date the opening hours start, in ISO 8601 format * @format date-time */ validFrom?: string; /** * The date the opening hours end, in ISO 8601 format * @format date-time */ validThrough?: string; }; export type Location = { id: LocationId; name: string; externalId?: string; categories: CategoryId[]; spaces: LocationSpaceMapping[]; obstructions: LocationObstructionMapping[]; entrances: LocationEntranceMapping[]; connections: ConnectionId[]; annotations: LocationAnnotationMapping[]; areas: LocationAreaMapping[]; description?: string; /** * The location's logo * * @format uri */ logo?: string; phone?: string; /** * The location's social media links. */ social: LocationSocial[]; /** * The location's pictures */ pictures: LocationPicture[]; /** * Web links for the location */ links: LocationLink[]; /** * The location's website */ website?: LocationLink; /** * The location's opening hours */ openingHoursSpecification: OpeningHoursSpecification[]; /** * The location's icon, one of picture/category/logo * * @format uri */ icon?: string; /** * Search tags are used primarily as keywords to match against when searching. * They are typically not used for display. */ searchTags?: string[]; }; //# sourceMappingURL=location.d.ts.map