@goteborgco/open-api-js-client
Version:
Official JavaScript client for the Göteborg & Co GraphQL API
44 lines (43 loc) • 1.5 kB
TypeScript
import { Client } from '../client/Client';
import type { PlaceFilter } from '../interfaces/common';
import { WpEntity as WpEntityClass } from '../entities/WpEntity';
import { Related as RelatedClass } from '../entities/Related';
import { Markers as MarkersClass } from '../entities/Markers';
export interface SinglePlaceResponse {
place: WpEntityClass;
events: WpEntityClass[];
related?: RelatedClass;
markers?: MarkersClass;
}
/**
* Places API for accessing place content
*
* This class provides type-safe methods for querying and retrieving place content
* from the GraphQL API.
*/
export declare class Places {
private client;
private readonly defaultPlaceFields;
private readonly defaultMarkersFields;
constructor(client: Client);
/**
* List places with optional filtering
*
* @param filter Optional filtering options
* @param fields Optional GraphQL fields to return
* @returns Array of place entities and optional markers
*/
list(filter: PlaceFilter, fields?: string): Promise<{
places: WpEntityClass[];
markers?: MarkersClass;
}>;
/**
* Get a specific place by ID
*
* @param id The place ID
* @param lang Language code ('en' or 'sv')
* @param fields Optional GraphQL fields to return
* @returns Place entity with associated events, related content, and markers
*/
getById(id: number, lang: 'en' | 'sv', fields?: string): Promise<SinglePlaceResponse>;
}