@contentstack/cli-variants
Version:
Variants plugin
31 lines (30 loc) • 1.64 kB
TypeScript
import { HttpClientOptions } from '@contentstack/cli-utilities';
import messages, { $t } from '../messages';
import { APIConfig, AdapterHelperInterface } from '../types';
export declare class AdapterHelper<C, ApiClient> implements AdapterHelperInterface<C, ApiClient> {
readonly adapterConfig: APIConfig;
readonly config: C;
readonly $t: typeof $t;
readonly apiClient: ApiClient;
readonly cmaAPIClient?: ApiClient;
readonly messages: typeof messages;
constructor(adapterConfig: APIConfig, options?: HttpClientOptions);
/**
* The function constructs a query string from a given object by encoding its key-value pairs.
* @param query - It looks like you have a function `constructQuery` that takes a query object as a
* parameter. The function loops through the keys in the query object and constructs a query string
* based on the key-value pairs.
* @returns The `constructQuery` function returns a string that represents the query parameters
* constructed from the input `query` object. If the `query` object is empty (has no keys), the
* function does not return anything (void).
*/
constructQuery(query: Record<string, any>): string | void;
/**
* The `delay` function in TypeScript returns a Promise that resolves after a specified number of
* milliseconds.
* @param {number} ms - The `ms` parameter represents the number of milliseconds for which the delay
* should occur before the `Promise` is resolved.
* @returns A Promise that resolves after the specified delay in milliseconds.
*/
delay(ms: number): Promise<void>;
}