import { Channel } from '../content/Channel'; import { DropdownOption } from '../content/DropdownOption'; import { FetchArticlesOptions } from './FetchArticlesOptions'; import { Post } from './Post'; /** * The bound news service returned by createNewsApi. Every method already carries * the injected configuration, so widgets call them with domain arguments only. */ export interface NewsApi { /** * Lists article channels as selector options (id, title, spaceId), paginated. * @returns {Promise} The channel options. */ fetchChannels: () => Promise; /** * Fetches a single channel by id. * @param {string} channelId - The channel id. * @returns {Promise} The channel. */ fetchChannel: (channelId: string) => Promise; /** * Resolves and caches a space's display name by id. * @param {string} spaceId - The space id. * @returns {Promise} The space name (empty string when unknown). */ fetchSpaceName: (spaceId: string) => Promise; /** * Fetches a channel's posts, paginated and (by default) filtered to the * currently-published window. * @template TArticle The post shape returned (defaults to Post). * @param {string} channelId - The channel id. * @param {FetchArticlesOptions} [options] - Endpoint and filtering options. * @returns {Promise} The posts. */ fetchArticles: = Post>(channelId: string, options?: FetchArticlesOptions) => Promise; /** * Fetches a single post by id. * @template TArticle The post shape returned (defaults to Post). * @param {string} articleId - The post id. * @returns {Promise} The post. */ fetchArticleById: (articleId: string) => Promise; /** * Acknowledges a post. Fails fast (and reports via onError) when the CSRF * token is unavailable, and throws an ApiError on a non-OK response. * @param {string} id - The post id. * @returns {Promise} Resolves when acknowledged. */ acknowledgeArticle: (id: string) => Promise; } //# sourceMappingURL=NewsApi.d.ts.map