import { Observable } from 'rxjs/Observable'; import { ContentfulService } from 'ng2-contentful'; import 'rxjs/add/operator/map'; import { ContentfulNodePage, ContentfulTagPage, ContentfulProfilePage, ContentfulContributionPage, ContentfulImage, ContentfulFooterHeader } from './aliases.structures'; /** * ContentfulContent works as a replacement for the original ng2-contentful library. * It adds next abstraction layer for contenful requests, * and any type of custom request and request transformation used in gapminder-org * should be implemented here. * * !! Still in developing !! */ export declare class ContenfulContent { private contentfulService; private contentfulTypeIds; constructor(contentfulService: ContentfulService, contentfulTypeIds: any); /** * * @param slug - slug of the current about content */ getAboutPage(slug: string): Observable<{ submenuItems: any[]; content: ContentfulNodePage; }>; getOverviewPages(): Observable; getLatestArticlesByTag(tagSysId: string, limit: number): Observable; /** * * @param slug * @returns {any} */ getNodePage(slug: string): Observable; /** * * @param tagId * @param slug * @returns {ContentfulNodePage} */ getArticleByTagAndSlug(tagId: string, slug: string): Observable; getTagsBySlug(slug: string): Observable; getImagesByTitle(title: string): Observable; getProfilesByUsername(username: string): Observable; getProfilesByArticleIdAndProjectTag(id: string, projectTag: string): Observable; getProfilesByTag(tagSysId: string): Observable; getProfilesByTags(tagSysIds: string[]): Observable; getChildrenOfArticle(articleSysId: string): Observable; getChildrenOfArticleByTag(articleSysId: string, projectTag: string): Observable; getArticlesByTag(tagSysId: string): Observable; getArticlesByTags(tagSysIds: string[], limit?: number): Observable; getLatestArticlesByTags(tagSysIds: string[], limit?: number): Observable; getArticleBySysId(sysId: string): Observable; getContributionsByArticle(articleSysId: string): Observable; getProfilesByContributions(contributionSysIds: string[]): Observable; getMenuByTag(menuType: string, tagSysId: string): Observable; getArticleParentSlug(id: string, onSlugFound: (path: string) => void): void; getArticleWithFullUrlPopulated(articles: ContentfulNodePage[]): Observable; private getArticleWithFullUrl(article, onSlugFound); private getRawNodePageBySlug(slug); private getProfileByUsername(userName); /** * * @param searchItems * @returns {ContentfulRequest} */ private getRawNodePagesByParams(...searchItems); private getSubmenuItemsFromResponse(response); } export interface ArticleWithFullUrl { url: string; article: ContentfulNodePage; }