/** * The Mappedin Enterprise Extension * * Contains data the Enterprise Apps use, in the format generated by Mappedin CMS. */ import type { FloorId, NodeId, ObstructionId, SpaceId } from '../types/core.js'; import type { Feature, FeatureCollection, Point } from '../types/geojson.js'; /** * A time in the format of HH:MM:SS * * @pattern ^[0-2][0-9]:[0-6][0-9](:[0-6][0-9])?$ */ export type Time = string; export type Day = 'Sunday' | 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday'; export declare const PUBLIC_HOLIDAYS = "PublicHolidays"; export type DayOrPublicHoliday = Day | typeof PUBLIC_HOLIDAYS; /** * 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. * */ export type OperationHours = { /** * The type of operation hours * * @default 'OpeningHoursSpecification' */ '@type'?: 'OpeningHoursSpecification'; /** * The time the operation hours start * */ opens?: Time; /** * The time the operation hours end */ closes?: Time; /** * The days of the week the operation hours apply to */ dayOfWeek?: DayOrPublicHoliday | [DayOrPublicHoliday] | DayOrPublicHoliday[]; /** * The date the operation hours start, in ISO 8601 format * @format date-time */ validFrom?: string; /** * The date the operation hours end, in ISO 8601 format * @format date-time */ validThrough?: string; }; /** * The state of a location. Start and end dates are optional. */ export type LocationState = { /** * The type of the location state. Technically not limited, but should be one of the following: * - closed-temporarily * - new * - pop-up * - coming-soon * - relocated */ type: 'closed-temporarily' | 'new' | 'pop-up' | 'coming-soon' | 'relocated' | string; /** * The start date of the state * @format date */ start?: string; /** * The start date of the state * @format date */ end?: string; }; export type SiblingGroup = { label: string; siblings: EnterpriseLocationId[]; type?: string; subtype?: string; }; export type Language = { name: string; code: string; }; /** * A collection of extra data, with no validation. * All classic x_ properties go here, with the x_ prefix stripped. */ export type Extras = { extra?: Record; }; /** * An ID for an enterprise 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 ^el_[A-Za-z0-9_-]+$ */ export type EnterpriseLocationId = string; /** * An ID for an enterprise category * * **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 ^ec_[A-Za-z0-9_-]+$ */ export type EnterpriseCategoryId = string; /** * An ID for an enterprise location instance * * **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 ^eli_[A-Za-z0-9_-]+$ */ export declare const ENTERPRISE_VENUE_TYPES: readonly ["agriculture", "airport", "casino", "city-district", "convention-center", "entertainment", "event-centre", "first-responder-building", "government-building", "grocery-store", "healthcare", "higher-education", "hotel", "library", "manufacturing", "medical-centre", "mixed-use", "multifamily", "museum", "office-building", "oil-and-energy", "other", "parking-facility", "religious-institution", "resort", "retail-store", "schools-k-12", "shopping-mall", "stadium-or-arena", "storage-facility", "theme-park", "transit", "transportation-hub", "warehousing", "unknown"]; export type EnterpriseVenueType = (typeof ENTERPRISE_VENUE_TYPES)[number]; export type EnterpriseLocationInstanceId = string; export type EnterpriseVenue = { slug: string; name: string; externalId: string; defaultLanguage: Language; languages: Language[]; /** * @deprecated Use `defaultFloor` instead */ defaultMap?: FloorId; /** * The venue's default floor */ defaultFloor?: FloorId; /** * The venue's timezone, from the IANA Time Zone Database. * Should be in the format of `America/New_York` * * @pattern ^[A-Za-z0-9\/_-]+$ */ tzid?: string; /** * The ISO 3166-1 alpha-2 country code of the venue, if known * * Eg. `US` or `GB` */ countrycode?: string; /** * The venue's logo * * @format uri */ logo?: string; /** * The venue's icon * * @format uri */ icon?: string; /** * The venue's cover image * * @format uri */ coverImage?: string; /** * The base URL for Mappedin Web for this venue * * Better name? */ mappedinWebUrl?: string; topLocations?: EnterpriseLocationId[]; /** * When this venue is open. * @type array */ operationHours?: Array; /** * The type of the venue, if known. */ type?: EnterpriseVenueType; /** * An image of the venue property * * @format uri */ propertyImage?: string; } & Extras; /** * @deprecated Use `spaces` instead */ type LocationNodes = { map: FloorId; id: NodeId; }[]; /** * The places that this location is anchored to in the physical world. These are either Polygon * or Point spaces. A location can be attached to many spaces, and a space can be attached to * many locations. * * If there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances} property. */ type LocationSpaces = { floor: FloorId; id: SpaceId; }[]; /** * @deprecated Use `spaces` instead */ type LocationPolygons = { map: FloorId; id: SpaceId; }[]; export type EnterpriseLocation = { id: EnterpriseLocationId; name: string; externalId: string; type: string; sortOrder: number; /** * @deprecated Use `spaces` instead. All of a location's polygons will be in the spaces array. * @type array */ polygons: LocationPolygons; /** * @deprecated Use `spaces` instead. A location's nodes that are not attached to a polygon will be in the spaces array as a point space. Nodes that are attached to one of it's polygons will be destinationNodes on that polygon's space * @type array */ nodes: LocationNodes; /** * The places that this location is anchored to in the physical world. These are either Polygon * or Point spaces. A location can be attached to many spaces, and a space can be attached to * many locations. * * If there are different properties for the location on those spaces, they will show up in the location's {@link EnterpriseLocation.instances instances} property */ spaces: LocationSpaces; description?: string; tags?: Array; shortName?: string; /** * The location's logo * * @format uri */ logo?: string; /** * The picture of the location * * @format uri */ picture?: string; phone?: { number: string; extension?: string; }; /** @type array */ operationHours?: Array; /** * The location's social media links */ social?: { facebook?: string; instagram?: string; twitter?: string; website?: string; }; /** * The location's state. No more than one state should be active at a time, * and all but at most one should have dates set */ states?: Array; /** * Locations that are related to this location in some manner (described by the label) */ siblingGroups?: Array; /** * The location's image gallery */ gallery?: Array<{ caption?: string | null; image: string; /** * The URL to link from the image * @format uri */ embeddedUrl?: string | null; }>; /** * Whether to show the flat label when an image is present */ showFloatingLabelWhenImagePresent?: boolean; /** * The location's amenity type. Only set if the location is an amenity */ amenity?: string; /** * Whether to show the logo of the location */ showLogo?: boolean; /** * Web links for the location * * @type array */ links?: Array<{ label: string; /** * The URL of the link * @format uri */ url: string; }>; /** * Whether to show the location in applications */ hidden?: boolean; /** * The main category of the location. It must be one of the categories in the Location's categories array. */ primaryCategory?: EnterpriseCategoryId; /** * The navigation flags that must be set for this location to be reachable when wayfinding. * For example, if a location is only accessible through a certain entrance, that entrance should get a navigation flag that * matches the filter flags. * * NOTE: This is an array of strings, which are the keys in the Navigation Flags Declarations. */ filterFlags?: string[]; /** * The header image of the location * * @format uri */ headerImage?: string; } & Extras; export type EnterpriseCategory = { id: EnterpriseCategoryId; externalId: string; name: string; color?: string; sortOrder: number; children: EnterpriseCategoryId[]; locations: EnterpriseLocationId[]; /** * The category's icon * * @format uri */ icon?: string; iconFromDefaultList?: string | null; /** * The category's picture * * @format uri */ picture?: string; } & Extras; /** * A locationInstance is a particular instance of an Enterprise Location that has some properties * different from the parent. Eg, it may have different hours, or a slightly different name. * * A LocationInstance: * - MUST have a parent, referring to an Enterprise Location. * - MUST have a unique ID, for localization to work. * - SHOULD have AT LEAST ONE polygon or node to anchor it in space. * - SHOULD have AT LEAST ONE other Enterprise Location property set. * * It is otherwise a Partial * * Usage examples: * - A locationInstance for a location with a different externalId so a customer can identify them individually. * - A locationInstance with different operationHours, that might indicate different hours for that particular entrance. */ export type EnterpriseLocationInstance = Partial> & { id: EnterpriseLocationInstanceId; parent: EnterpriseLocationId; }; /** * The ordered list of category ids that this location belongs to * The order here determines the priority of the categories, with the first category being the highest priority * for determining application logic like icon and color preference. * @type array */ export type EnterpriseCategoryPriority = Record; /** * **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 ^ely_[A-Za-z0-9_-]+$ */ export type EnterpriseLayerId = string; export type EnterpriseLayerSpace = { floorId: FloorId; spaceId: SpaceId; }; export type EnterpriseLayer = { id: EnterpriseLayerId; name: string; /** * @minItems 1 */ spaces: EnterpriseLayerSpace[]; }; export type EnterpriseStyles = Record; export type EnterpriseTextureUV = { u: number; v: number; }; export type EnterpriseTextureFace = 'top' | 'side'; export type EnterpriseTextureGeometryAnchor = { geometryId: SpaceId; floorId: FloorId; }; export type EnterpriseTextureSurface = 'inside' | 'outside' | 'both'; export type EnterpriseTexture = { /** * Controls how many times the texture repeats across the surface. * The u value controls horizontal repetition and v controls vertical repetition. */ repeat: EnterpriseTextureUV; /** * Controls the starting position of the texture on the surface. * The u value shifts the texture horizontally and v shifts vertically. */ offset: EnterpriseTextureUV; /** * Rotation of the texture in degrees clockwise. * * For top textures this is relative to north. North is 0, east is 90. * * For side textures this is relative to the upward direction, with 0 degrees being upright. * * @minimum 0 * @maximum 360 */ rotation: number; /** * Path to the texture image. Must be either a PNG or JPG format. */ path: string; /** * Face of the polygon that the texture will be applied to. * * 'top' means that the texture will be applied to the upward-pointing face of the polygon. * * 'side' means that the texture will be applied to every side face of the polygon. */ face: EnterpriseTextureFace; /** * Surface of the polygon that the texture will be applied to. * * 'inside' means that the texture will only be applied to the interior surface of the polygon. * * 'outside' means that the texture will only be applied to the exterior surface of the polygon. * * 'both' means that the texture will be applied to both interior and exterior surfaces of the polygon. * */ surface: EnterpriseTextureSurface; /** * Coordinates of the texture's bounding box in format: [minLon, minLat, maxLon, maxLat]. */ bounds: [number, number, number, number]; /** * Anchors for the texture on the geometry of the polygon. * * @minItems 1 */ geometryAnchors: EnterpriseTextureGeometryAnchor[]; }; /** * Text and some transformations that may be applied to superimpose the text onto a map, which can * either be anchored to a specific space or floating. */ export type FloorTextCommonProperties = { /** * The text to display. Newline characters are supported. */ text: string; /** * Whether the text is visible. * * @default true */ visible: boolean; /** * The em-height (multiplier of the font's height) at which to render the font, in meters. * The font height is the distance between the ascender (highest point, height of an A) and descender (lowest point, bottom of a g) of the font. * For example, if the font-size is 12, the space for a single character will be 12 meters high. * * @default 12 */ fontSize: number; /** * The font family of the text. * * @default 'Droid Sans' */ fontFamily: string; /** * The color of the text in CSS format (e.g. `#000000`, `rgb(0, 0, 0)`, `black`). * * @default 'black' */ color: string; /** * Rotation in degrees, about the center of the text. North is 0, east is 90. * * @minimum 0 * @maximum 360 */ rotation: number; /** * Horizontal alignment of multi-line text. * * @default 'center' */ align: 'left' | 'center' | 'right'; }; export type AnchoredFloorTextProperties = FloorTextCommonProperties & { /** * The geometry to which this text belongs. It will be displayed on top of it. */ geometryId: SpaceId | ObstructionId; }; export type FloatingFloorTextProperties = FloorTextCommonProperties & { /** * The vertical offset of the text, in meters. */ verticalOffset: number; }; export type FloorTextProperties = AnchoredFloorTextProperties | FloatingFloorTextProperties; export type FloorTextFeature = Feature; export type AnchoredFloorTextFeature = Feature; export type FloatingFloorTextFeature = Feature; /** * A collection of text to be displayed on a map. They are either attached to a space or are floating. */ export type FloorTextFeatureCollection = FeatureCollection; /** * The text to display on a map, split into feature collection per floor. */ export type EnterpriseFloorText = { [floorId: FloorId]: FloorTextFeatureCollection | undefined; }; export type EnterpriseCollection = { locations: EnterpriseLocation[]; categories: EnterpriseCategory[]; venue: EnterpriseVenue; locationInstances: EnterpriseLocationInstance[]; layers: EnterpriseLayer[]; categoryPriorities?: EnterpriseCategoryPriority; textures?: EnterpriseTexture[]; enterpriseStyles?: EnterpriseStyles; floorText?: EnterpriseFloorText; }; export {}; //# sourceMappingURL=enterprise.d.ts.map