@kontent-ai/delivery-sdk
Version:
Official Kontent.AI Delivery API SDK
60 lines (59 loc) • 3.21 kB
TypeScript
import { Contracts } from '../../contracts';
import { IDeliveryClientConfig } from '../../config';
import { IContentItem, IDeliveryNetworkResponse, Responses, IItemFeedQueryConfig, ClientTypes } from '../../models';
import { QueryService } from '../../services';
import { BaseItemListingQuery } from '../common/base-item-listing-query.class';
export declare class ItemsFeedQuery<TClientTypes extends ClientTypes, TContentItem extends IContentItem = IContentItem> extends BaseItemListingQuery<TClientTypes, Responses.IListItemsFeedResponse<TContentItem, TClientTypes['contentItemType']>, Responses.IListItemsFeedAllResponse<TContentItem, TClientTypes['contentItemType']>, IItemFeedQueryConfig, Contracts.IItemsFeedContract> {
protected config: IDeliveryClientConfig;
protected queryService: QueryService<TClientTypes>;
protected _queryConfig: IItemFeedQueryConfig;
constructor(config: IDeliveryClientConfig, queryService: QueryService<TClientTypes>);
/**
* Gets only item of given type
* @param type Codename of type to get
*/
type(type: TClientTypes['contentTypeCodenames']): this;
/**
* Gets items of given types (logical or)
* I.e. get items of either 'Actor' or 'Movie' type
* @param types Types to get
*/
types(types: TClientTypes['contentTypeCodenames'][]): this;
/**
* Gets only item from given collection
* @param collection Codename of collection to get
*/
collection(collection: TClientTypes['collectionCodenames']): this;
/**
* Gets items from given collections (logical or)
* I.e. get items of either 'default' or 'christmas-campaign' collection
* @param collections Collections to get
*/
collections(collections: TClientTypes['collectionCodenames'][]): this;
/**
* Language codename
* @param languageCodename Codename of the language
*/
languageParameter(languageCodename: TClientTypes['languageCodenames']): this;
/**
* Used to limit the number of elements returned by query.
* @param elementCodenames Array of element codenames to fetch
*/
elementsParameter(elementCodenames: TClientTypes['elementCodenames'][]): this;
/**
* Used to exclude elements returned by query.
* @param elementCodenames Array of element codenames to exclude
*/
excludeElementsParameter(elementCodenames: TClientTypes['elementCodenames'][]): this;
toPromise(): Promise<IDeliveryNetworkResponse<Responses.IListItemsFeedResponse<TContentItem, TClientTypes['contentItemType']>, Contracts.IItemsFeedContract>>;
getUrl(): string;
/**
* Used to configure query
* @param queryConfig Query configuration
*/
queryConfig(queryConfig: IItemFeedQueryConfig): this;
map(json: any): Responses.IListItemsFeedResponse<TContentItem, TClientTypes['contentItemType']>;
protected allResponseFactory(items: TContentItem[], responses: IDeliveryNetworkResponse<Responses.IListItemsFeedResponse<TContentItem, TClientTypes['contentItemType']>, Contracts.IItemsFeedContract>[]): Responses.IListItemsFeedAllResponse<TContentItem, TClientTypes['contentItemType']>;
private linkFeedItems;
private canLinkItems;
}