taro-hooks
Version:
为 Taro 而设计的 Hooks Library
37 lines (36 loc) • 1.41 kB
TypeScript
import type { RecordData, ExcludeSuccess } from '../type';
export declare const isProd: boolean;
export declare const noop: () => void;
export declare const promiseNoop: () => Promise<void>;
export declare const typeOf: (target: any, type: string | string[]) => boolean;
export declare const isPlainObject: (payload: RecordData) => boolean;
export declare const isUndefined: (target: unknown) => target is undefined;
/**
* general common error message resp
* @param {T = string} method 调用方法
* @param {string} message 自定义错误信息
* @returns {TaroGeneral.CallbackResult} 错误信息
*/
export declare function generateGeneralFail<T = string>(method: T, message?: string): TaroGeneral.CallbackResult;
/**
* combine init and custom options
* @param generalOption init options
* @param option custom options
* @returns options
*/
export declare function combineOptions<T>(generalOption?: {}, option?: {}): T;
/**
* make queryString URI
* @param url origin URI
* @param options unparse payload
* @returns {string} URIWithQS
*/
export declare function stringfiyUrl<R extends RecordData = RecordData>(url: string, options?: R): string;
/**
* filter orgin successCallbackResult errMsg Fields
* @param successResultArray
* @returns WithoutErrMsgArray
*/
export declare function filterErrMsgField<R extends {
errMsg: string;
}>(successResultArray: R[]): ExcludeSuccess<R>[];