@vuex-orm/plugin-axios
Version:
Vuex ORM plugin for adding smooth integration with axios.
73 lines • 1.98 kB
TypeScript
import { AxiosInstance } from 'axios';
import { Model } from '@vuex-orm/core';
import { Config } from '../contracts/Config';
import { Response } from './Response';
export declare class Request {
/**
* The model class.
*/
model: typeof Model;
/**
* The default config.
*/
config: Config;
/**
* Create a new api instance.
*/
constructor(model: typeof Model);
/**
* Index key for the user defined actions.
*/
[action: string]: any;
/**
* Get the axios client.
*/
get axios(): AxiosInstance;
/**
* Register actions from the model config.
*/
private registerActions;
/**
* Register the given object action.
*/
private registerObjectAction;
/**
* Register the given function action.
*/
private registerFunctionAction;
/**
* Perform a get request.
*/
get(url: string, config?: Config): Promise<Response>;
/**
* Perform a post request.
*/
post(url: string, data?: any, config?: Config): Promise<Response>;
/**
* Perform a put request.
*/
put(url: string, data?: any, config?: Config): Promise<Response>;
/**
* Perform a patch request.
*/
patch(url: string, data?: any, config?: Config): Promise<Response>;
/**
* Perform a delete request.
*/
delete(url: string, config?: Config): Promise<Response>;
/**
* Perform an api request.
*/
request(config: Config): Promise<Response>;
/**
* Create a new config by merging the global config, the model config,
* and the given config.
*/
private createConfig;
/**
* Create a new response instance by applying a few initialization processes.
* For example, it saves response data if `save` option id set to `true`.
*/
private createResponse;
}
//# sourceMappingURL=Request.d.ts.map