@web-core/web-sdk
    Preparing search index...

    Interface INewsRepo

    interface INewsRepo {
        getNews(
            source: NewsSources,
            last: number,
            locale: NewsLocale,
            tags?: string[] | NewsTags[],
            lt?: string,
            gt?: string,
        ): Promise<NewsResponse[]>;
        getNewsById(
            source: NewsSources,
            last: number,
            locale: NewsLocale,
            id: string,
        ): Promise<NewsResponse>;
        getNewsDetail(contentUrl: string): Promise<string>;
        searchNews(
            source: string,
            last: number,
            locale: string,
            match: string,
            header: boolean,
        ): Promise<NewsResponse[]>;
    }
    Index

    Methods

    • Parameters

      • source: NewsSources

        The news source.

      • last: number

        The number of news items to be returned.

      • locale: NewsLocale

        The language of the news.

      • Optionaltags: string[] | NewsTags[]

        News tags (optional).

      • Optionallt: string

        News before the specified ID or date (optional).

      • Optionalgt: string

        News after the specified ID or date (optional).

      Returns Promise<NewsResponse[]>

      List of news.

      Fetches news from the cloud.

    • Parameters

      • source: NewsSources

        The news source.

      • last: number

        The number of news items to be returned.

      • locale: NewsLocale

        The language of the news.

      • id: string

        The news ID.

      Returns Promise<NewsResponse>

      News data.

      Fetches news by the given ID.

    • Parameters

      • contentUrl: string

        The URL of the news content.

      Returns Promise<string>

      The news content.

      Fetches the details of the news content.

    • Parameters

      • source: string

        The news source.

      • last: number

        The number of news items to be returned.

      • locale: string

        The language of the news.

      • match: string

        The search key.

      • header: boolean

        The search key is in header or not.

      Returns Promise<NewsResponse[]>

      Search into News by given key