/** * all type that should be sent as parameter to Ovh calls */ export type OvhParamType = { [key: string]: any; }; /** * Public interface of a silot * you can have one silot per Ovh API call */ export interface ICacheSilot { options: ICacheOptions; flush(): Promise; store(path: string, value: any, size: number): Promise; get(path: string): Promise; discard(path: string): Promise; } /** * constructor for a silot cache */ export type SlotConstructor = new (template: string, options: ICacheOptions) => ICacheSilot; /** * params to configure cache */ export interface ICacheOptions { /** * Time to live in second */ ttl?: number; /** * max memmory used to store your cache */ size?: number; /** * max number of entry in your cache */ count?: number; /** * explicite silot construtor used to overwrite in memory default silotCache */ silotClass?: SlotConstructor; } /** * 'flush' and 'disable' are the main action, other can be add later */ export type CacheAction = 'flush' | 'disable' | string; /** * common interface used to call ovh engine */ export interface OvhRequestable { /** * Execute a request on the API with promise * * @param httpMethod: The HTTP method GET POST PUT DELETE * @param path: The request final path * @param pathTemplate: The request path with {pathParams} * @param params: The request parameters (passed as query string or body params) */ doRequest(httpMethod: string, path: string, pathTemplate: string, params?: any): Promise; /** * Execute a request on the API with promise * * @param httpMethod: The HTTP method GET POST PUT DELETE * @param path: The request path with {pathParams} * @param params: The request parameters (passed as query string or body params) * @deprecated */ /** * cache controle */ cache(template: string, param: ICacheOptions | CacheAction): Promise; } /** * Build Ovh API 2.0 Proxy * * @param ovhEngine * @param path */ export declare function buildOvhProxy(ovhEngine: OvhRequestable, path: string): any;