@kontent-ai/delivery-sdk
Version:
Official Kontent.AI Delivery API SDK
65 lines (64 loc) • 3.5 kB
TypeScript
import { Contracts } from '../../contracts';
import { IDeliveryClientConfig } from '../../config';
import { IContentItem, IItemQueryConfig, IDeliveryNetworkResponse, Responses, ClientTypes } from '../../models';
import { QueryService } from '../../services';
import { BaseItemListingQuery } from '../common/base-item-listing-query.class';
export declare class MultipleItemsQuery<TClientTypes extends ClientTypes, TContentItem extends IContentItem = IContentItem> extends BaseItemListingQuery<TClientTypes, Responses.IListContentItemsResponse<TContentItem, TClientTypes['contentItemType']>, Responses.IListContentItemsAllResponse<TContentItem, TClientTypes['contentItemType']>, IItemQueryConfig, Contracts.IListContentItemsContract> {
protected config: IDeliveryClientConfig;
protected queryService: QueryService<TClientTypes>;
protected _queryConfig: IItemQueryConfig;
constructor(config: IDeliveryClientConfig, queryService: QueryService<TClientTypes>);
/**
* Adds information about the total number of content items matching your query.
* When set to true, the pagination object returned in the API response contains
* an additional total_count property.
*/
includeTotalCountParameter(): this;
/**
* 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;
/**
* Indicates depth of query that affects loading of nested linked items.
* @param depth Depth of the query (> 0)
*/
depthParameter(depth: number): 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.IListContentItemsResponse<TContentItem, TClientTypes['contentItemType']>, Contracts.IListContentItemsContract>>;
getUrl(): string;
map(json: any): Responses.IListContentItemsResponse<TContentItem, TClientTypes['contentItemType']>;
protected allResponseFactory(items: any[], responses: IDeliveryNetworkResponse<Responses.IListContentItemsResponse<TContentItem, TClientTypes['contentItemType']>, Contracts.IListContentItemsContract>[]): Responses.IListContentItemsAllResponse<TContentItem, TClientTypes['contentItemType']>;
private linkItems;
}