konfig-axios-fetch-adapter
Version:
Fetch adapter for axios written in TypeScript
284 lines (283 loc) • 8.55 kB
TypeScript
declare var kindOf: (thing: any) => any;
declare function kindOfTest(type: any): (thing: any) => boolean;
/**
* Determine if a value is an Array
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Array, otherwise false
*/
declare function isArray(val: any): boolean;
/**
* Determine if a value is undefined
*
* @param {Object} val The value to test
* @returns {boolean} True if the value is undefined, otherwise false
*/
declare function isUndefined(val: any): boolean;
/**
* Determine if a value is a Buffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Buffer, otherwise false
*/
declare function isBuffer(val: any): any;
/**
* Determine if a value is an ArrayBuffer
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
*/
declare var isArrayBuffer: (thing: any) => boolean;
/**
* Determine if a value is a view on an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
*/
declare function isArrayBufferView(val: any): any;
/**
* Determine if a value is a String
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a String, otherwise false
*/
declare function isString(val: any): boolean;
/**
* Determine if a value is a Number
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Number, otherwise false
*/
declare function isNumber(val: any): boolean;
/**
* Determine if a value is an Object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Object, otherwise false
*/
declare function isObject(val: any): boolean;
/**
* Determine if a value is a plain Object
*
* @param {Object} val The value to test
* @return {boolean} True if value is a plain Object, otherwise false
*/
declare function isPlainObject(val: any): boolean;
/**
* Determine if a value is a Date
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a Date, otherwise false
*/
declare var isDate: (thing: any) => boolean;
/**
* Determine if a value is a File
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a File, otherwise false
*/
declare var isFile: (thing: any) => boolean;
/**
* Determine if a value is a Blob
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a Blob, otherwise false
*/
declare var isBlob: (thing: any) => boolean;
/**
* Determine if a value is a FileList
*
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a File, otherwise false
*/
declare var isFileList: (thing: any) => boolean;
/**
* Determine if a value is a Function
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Function, otherwise false
*/
declare function isFunction(val: any): boolean;
/**
* Determine if a value is a Stream
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Stream, otherwise false
*/
declare function isStream(val: any): boolean;
/**
* Determine if a value is a FormData
*
* @param {Object} thing The value to test
* @returns {boolean} True if value is an FormData, otherwise false
*/
declare function isFormData(thing: any): boolean;
/**
* Determine if a value is a URLSearchParams object
* @function
* @param {Object} val The value to test
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
*/
declare var isURLSearchParams: (thing: any) => boolean;
/**
* Trim excess whitespace off the beginning and end of a string
*
* @param {String} str The String to trim
* @returns {String} The String freed of excess whitespace
*/
declare function trim(str: any): any;
/**
* Determine if we're running in a standard browser environment
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
*
* web workers:
* typeof window -> undefined
* typeof document -> undefined
*
* react-native:
* navigator.product -> 'ReactNative'
* nativescript
* navigator.product -> 'NativeScript' or 'NS'
*/
declare function isStandardBrowserEnv(): boolean;
/**
* Iterate over an Array or an Object invoking a function for each item.
*
* If `obj` is an Array callback will be called passing
* the value, index, and complete array for each item.
*
* If 'obj' is an Object callback will be called passing
* the value, key, and complete object for each property.
*
* @param {Object|Array} obj The object to iterate
* @param {Function} fn The callback to invoke for each item
*/
declare function forEach(obj: any, fn: any): void;
/**
* Accepts varargs expecting each argument to be an object, then
* immutably merges the properties of each object and returns result.
*
* When multiple objects contain the same key the later object in
* the arguments list will take precedence.
*
* Example:
*
* ```js
* var result = merge({foo: 123}, {foo: 456});
* console.log(result.foo); // outputs 456
* ```
*
* @param {Object} obj1 Object to merge
* @returns {Object} Result of all merge properties
*/
declare function merge(): {};
/**
* Extends object a by mutably adding to it the properties of object b.
*
* @param {Object} a The object to be extended
* @param {Object} b The object to copy properties from
* @param {Object} thisArg The object to bind function to
* @return {Object} The resulting value of object a
*/
declare function extend(a: any, b: any, thisArg: any): any;
/**
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
*
* @param {string} content with BOM
* @return {string} content value without BOM
*/
declare function stripBOM(content: any): any;
/**
* Inherit the prototype methods from one constructor into another
* @param {function} constructor
* @param {function} superConstructor
* @param {object} [props]
* @param {object} [descriptors]
*/
declare function inherits(constructor: any, superConstructor: any, props: any, descriptors: any): void;
/**
* Resolve object with deep prototype chain to a flat object
* @param {Object} sourceObj source object
* @param {Object} [destObj]
* @param {Function} [filter]
* @returns {Object}
*/
declare function toFlatObject(sourceObj: any, destObj: any, filter: any): any;
declare function endsWith(str: any, searchString: any, position: any): boolean;
/**
* Returns new array from array like object
* @param {*} [thing]
* @returns {Array}
*/
declare function toArray(thing: any): any[];
declare var isTypedArray: (thing: any) => boolean;
export { isArray };
export { isArrayBuffer };
export { isBuffer };
export { isFormData };
export { isArrayBufferView };
export { isString };
export { isNumber };
export { isObject };
export { isPlainObject };
export { isUndefined };
export { isDate };
export { isFile };
export { isBlob };
export { isFunction };
export { isStream };
export { isURLSearchParams };
export { isStandardBrowserEnv };
export { forEach };
export { merge };
export { extend };
export { trim };
export { stripBOM };
export { inherits };
export { toFlatObject };
export { kindOf };
export { kindOfTest };
export { endsWith };
export { toArray };
export { isTypedArray };
export { isFileList };
declare const _default: {
isArray: typeof isArray;
isArrayBuffer: (thing: any) => boolean;
isBuffer: typeof isBuffer;
isFormData: typeof isFormData;
isArrayBufferView: typeof isArrayBufferView;
isString: typeof isString;
isNumber: typeof isNumber;
isObject: typeof isObject;
isPlainObject: typeof isPlainObject;
isUndefined: typeof isUndefined;
isDate: (thing: any) => boolean;
isFile: (thing: any) => boolean;
isBlob: (thing: any) => boolean;
isFunction: typeof isFunction;
isStream: typeof isStream;
isURLSearchParams: (thing: any) => boolean;
isStandardBrowserEnv: typeof isStandardBrowserEnv;
forEach: typeof forEach;
merge: typeof merge;
extend: typeof extend;
trim: typeof trim;
stripBOM: typeof stripBOM;
inherits: typeof inherits;
toFlatObject: typeof toFlatObject;
kindOf: (thing: any) => any;
kindOfTest: typeof kindOfTest;
endsWith: typeof endsWith;
toArray: typeof toArray;
isTypedArray: (thing: any) => boolean;
isFileList: (thing: any) => boolean;
};
export default _default;