@cpanel/api
Version:
cPanel API JavaScript and TypeScript interface libraries. This library provides a set of classes for calling cPanel WHM API 1 and UAPI calls. The classes hide much of the complexity of these APIs behind classes the abstract the underlying variances betwee
50 lines (49 loc) • 1.33 kB
TypeScript
import { HttpVerb } from "./http/verb";
export type Nullable<T> = {
[P in keyof T]: T[P] | null;
};
/**
* Abstract argument serialization rule
*/
export interface ArgumentSerializationRule {
/**
* Name of the verb or DEFAULT
*/
verb: string;
/**
* Flag to indicate if the data is in the body. If false, its in the url.
*/
dataInBody: boolean;
}
/**
* Collection of argument serialize rules
*/
export type ArgumentSerializationRules = {
[key: string]: ArgumentSerializationRule;
};
/**
* Default argument serialization rules for each well known HTTP verb.
*/
export declare class DefaultArgumentSerializationRules {
map: ArgumentSerializationRules;
/**
* Construct the lookup table for well know verbs.
*/
constructor();
/**
* Get a rule for serialization of arguments. This tells the generators where
* argument data is packaged in a request. Arguments can be located in one of
* the following:
*
* Body,
* Url
*
* @param verb verb to lookup.
*/
getRule(verb: HttpVerb | string): ArgumentSerializationRule;
}
/**
* Singleton with the default argument serialization rules in it.
*/
declare const argumentSerializationRules: DefaultArgumentSerializationRules;
export { argumentSerializationRules };