@snail-js/api
Version:
Http Request with Decorators Api, build on axios
39 lines (38 loc) • 1.73 kB
TypeScript
import "reflect-metadata";
import { MethodSendOptions } from "../typings";
export declare const METHOD_KEY: unique symbol;
/**
* 定义装饰的方法为Get请求
* @param path 字符型,请求端点,默认为空
*/
export declare const Get: (path?: string, options?: MethodSendOptions) => (target: any, propertyKey: string | symbol) => void;
/**
* 定义装饰的方法为Post请求
* @param path 字符型,请求端点,默认为空
*/
export declare const Post: (path?: string, options?: MethodSendOptions) => (target: any, propertyKey: string | symbol) => void;
/**
* 定义装饰的方法为Put请求
* @param path 字符型,请求端点,默认为空
*/
export declare const Put: (path?: string, options?: MethodSendOptions) => (target: any, propertyKey: string | symbol) => void;
/**
* 定义装饰的方法为Delete请求
* @param path 字符型,请求端点,默认为空
*/
export declare const Delete: (path?: string, options?: MethodSendOptions) => (target: any, propertyKey: string | symbol) => void;
/**
* 定义装饰的方法为Patch请求
* @param path 字符型,请求端点,默认为空
*/
export declare const Patch: (path?: string, options?: MethodSendOptions) => (target: any, propertyKey: string | symbol) => void;
/**
* 定义装饰的方法为Options请求
* @param path 字符型,请求端点,默认为空
*/
export declare const Options: (path?: string, options?: MethodSendOptions) => (target: any, propertyKey: string | symbol) => void;
/**
* 定义装饰的方法为Head请求
* @param path 字符型,请求端点,默认为空
*/
export declare const Head: (path?: string, options?: MethodSendOptions) => (target: any, propertyKey: string | symbol) => void;