UNPKG

@goteborgco/open-api-js-client

Version:

Official JavaScript client for the Göteborg & Co GraphQL API

82 lines (81 loc) 2.85 kB
import { Translations } from './Translations'; import { Media } from './Media'; import { Location } from './Location'; import { Contact } from './Contact'; import { EventDate } from './EventDate'; import { CurrentInTime } from './CurrentInTime'; export declare class WpEntity { readonly id: number; readonly title: string; readonly excerpt: string; readonly content?: string; readonly date: string; readonly modified?: string; readonly link?: string; readonly categories: number[]; readonly areas: number[]; readonly tags: number[]; readonly category_heading?: string; private featuredmedia?; readonly gallery?: Media[]; readonly location?: Location; readonly dates?: EventDate[]; readonly contact?: Contact; readonly current_in_time?: CurrentInTime; readonly translations?: Translations; readonly place_id?: number; readonly is_free?: boolean; readonly lang: 'en' | 'sv' | 'de'; constructor(data: any); /** * Get the featured media * @returns The first featured media item or undefined if no media exists */ getFeaturedMedia(): Media | undefined; /** * Get the main image URL * @param size The desired image size ('full', 'large', 'medium', 'thumbnail') * @returns The URL for the requested size or undefined */ getImageUrl(size?: 'full' | 'large' | 'medium' | 'thumbnail'): string | undefined; /** * Get all gallery image URLs * @param size The desired image size ('full', 'large', 'medium', 'thumbnail') * @returns Array of gallery image URLs */ getGalleryUrls(size?: 'full' | 'large' | 'medium' | 'thumbnail'): string[]; /** * Check if the entity is currently active based on its dates * @returns boolean indicating if the entity is currently active */ isActive(): boolean; /** * Get the location coordinates * @returns Object containing lat and lng, or undefined if no location exists */ getCoordinates(): { lat: number; lng: number; } | undefined; /** * Get a formatted address string * @returns Formatted address string or undefined if no location exists */ getFormattedAddress(): string | undefined; /** * Get contact information * @returns Contact information or undefined if no contact exists */ getContact(): Contact | undefined; /** * Get translation for a specific language * @param lang Language code ('en' or 'sv') * @returns Translation ID or undefined if no translation exists */ getTranslation(lang: 'en' | 'sv' | 'de'): number | undefined; /** * Get current in time information * @returns CurrentInTime information or undefined if not available */ getCurrentInTime(): CurrentInTime | undefined; }