UNPKG

@pivoto/core

Version:

![build](https://img.shields.io/badge/build-passing-success.svg)

335 lines (311 loc) 11.4 kB
declare function is(v: any): boolean; declare function not(v: any): boolean; declare function isDef(v: any): boolean; declare function notDef(v: any): boolean; declare function isTrue(v: any): boolean; declare function isFalse(v: any): boolean; declare function isPrimitive(v: any): boolean; declare function getType(val: any): string; declare function isString(val: any): boolean; declare function isNumber(val: any): boolean; declare function isBoolean(val: any): boolean; declare function isFunction(val: any): boolean; declare function isNull(val: any): boolean; declare function isUndefined(val: any): boolean; declare function isObject(val: any): boolean; declare function isArray(val: any): boolean; declare function isRegExp(val: any): boolean; declare function isDate$1(val: any): boolean; declare function isError(val: any): boolean; declare function isSymbol(val: any): boolean; declare function isSet(val: any): boolean; declare function isMap(val: any): boolean; declare function isPromise(val: any): boolean; declare function isObjectOrArray(value: any): boolean; declare function isNumeric(value: any): boolean; declare const type$1_is: typeof is; declare const type$1_not: typeof not; declare const type$1_isDef: typeof isDef; declare const type$1_notDef: typeof notDef; declare const type$1_isTrue: typeof isTrue; declare const type$1_isFalse: typeof isFalse; declare const type$1_isPrimitive: typeof isPrimitive; declare const type$1_getType: typeof getType; declare const type$1_isString: typeof isString; declare const type$1_isNumber: typeof isNumber; declare const type$1_isBoolean: typeof isBoolean; declare const type$1_isFunction: typeof isFunction; declare const type$1_isNull: typeof isNull; declare const type$1_isUndefined: typeof isUndefined; declare const type$1_isObject: typeof isObject; declare const type$1_isArray: typeof isArray; declare const type$1_isRegExp: typeof isRegExp; declare const type$1_isError: typeof isError; declare const type$1_isSymbol: typeof isSymbol; declare const type$1_isSet: typeof isSet; declare const type$1_isMap: typeof isMap; declare const type$1_isPromise: typeof isPromise; declare const type$1_isObjectOrArray: typeof isObjectOrArray; declare const type$1_isNumeric: typeof isNumeric; declare namespace type$1 { export { type$1_is as is, type$1_not as not, type$1_isDef as isDef, type$1_notDef as notDef, type$1_isTrue as isTrue, type$1_isFalse as isFalse, type$1_isPrimitive as isPrimitive, type$1_getType as getType, type$1_isString as isString, type$1_isNumber as isNumber, type$1_isBoolean as isBoolean, type$1_isFunction as isFunction, type$1_isNull as isNull, type$1_isUndefined as isUndefined, type$1_isObject as isObject, type$1_isArray as isArray, type$1_isRegExp as isRegExp, isDate$1 as isDate, type$1_isError as isError, type$1_isSymbol as isSymbol, type$1_isSet as isSet, type$1_isMap as isMap, type$1_isPromise as isPromise, type$1_isObjectOrArray as isObjectOrArray, type$1_isNumeric as isNumeric, }; } declare function noop(): void; declare function type(obj: any): string; declare function clone(target: any): any; declare function hasProperty(obj: any, key: string | number | symbol): boolean; declare function arrayRemove<T>(arr: Array<T>, val: T): Array<T>; declare function objectRemove(obj: any, key: string | number | symbol): void; declare function uuid(): string; declare type EachIteratorFunction = ((unknown: any, number: any, T: any) => boolean | undefined) | ((unknown: any, string: any, T: any) => boolean | undefined); declare function each<T>(obj: T, iterator: EachIteratorFunction, context?: any): void; declare function extend(...args: any[]): any; declare function keys(obj: any): string[]; declare function values(obj: any): any[]; declare const utils_noop: typeof noop; declare const utils_type: typeof type; declare const utils_clone: typeof clone; declare const utils_hasProperty: typeof hasProperty; declare const utils_arrayRemove: typeof arrayRemove; declare const utils_objectRemove: typeof objectRemove; declare const utils_uuid: typeof uuid; type utils_EachIteratorFunction = EachIteratorFunction; declare const utils_each: typeof each; declare const utils_extend: typeof extend; declare const utils_keys: typeof keys; declare const utils_values: typeof values; declare namespace utils { export { utils_noop as noop, utils_type as type, utils_clone as clone, utils_hasProperty as hasProperty, utils_arrayRemove as arrayRemove, utils_objectRemove as objectRemove, utils_uuid as uuid, utils_EachIteratorFunction as EachIteratorFunction, utils_each as each, utils_extend as extend, utils_keys as keys, utils_values as values, }; } declare function trim(s: string): string; declare const string_trim: typeof trim; declare namespace string { export { string_trim as trim, }; } /** * 格式化日期为指定格式的字符串 * @param d 日期对象 * @param fmt 格式化模式 * @returns {*} 日期字格式化符串 */ declare function formatDate(d: Date, fmt: string): string; /** * 按格式解析文件为日期,由于Date.parse作为基础方法已存在,方法名使用`deformat` * @param s 日期字符串 * @param fmt 格式化模式 * @returns {Date} 日期对象 */ declare function parseDate(s: string, fmt: string): Date; declare const date_formatDate: typeof formatDate; declare const date_parseDate: typeof parseDate; declare namespace date { export { date_formatDate as formatDate, date_parseDate as parseDate, }; } declare const isEmail: (s: string) => boolean; declare const isMobile$1: (s: string) => boolean; /** * 座机 * @param s * @return {boolean} */ declare const isTel: (s: string) => boolean; /** * 身份证号 * @param s * @return {boolean} */ declare const isIdNo: (s: string) => boolean; /** * 车牌号 * @param s * @return {boolean} */ declare const isCarNo: (s: string) => boolean; declare const isChinese: (s: string) => boolean; declare const isUrl: (s: string) => boolean; declare const isDate: (s: string) => boolean; declare const regexp_isEmail: typeof isEmail; declare const regexp_isTel: typeof isTel; declare const regexp_isIdNo: typeof isIdNo; declare const regexp_isCarNo: typeof isCarNo; declare const regexp_isChinese: typeof isChinese; declare const regexp_isUrl: typeof isUrl; declare const regexp_isDate: typeof isDate; declare namespace regexp { export { regexp_isEmail as isEmail, isMobile$1 as isMobile, regexp_isTel as isTel, regexp_isIdNo as isIdNo, regexp_isCarNo as isCarNo, regexp_isChinese as isChinese, regexp_isUrl as isUrl, regexp_isDate as isDate, }; } declare function parseQuery(href?: string): Record<string, string | string[]>; declare function getQuery(name: any, href?: string): string | string[]; declare function asQuery(obj: any): string; declare const url_parseQuery: typeof parseQuery; declare const url_getQuery: typeof getQuery; declare const url_asQuery: typeof asQuery; declare namespace url { export { url_parseQuery as parseQuery, url_getQuery as getQuery, url_asQuery as asQuery, }; } declare const isMobile: () => boolean; declare const isWechat: () => boolean; declare const isAndroid: () => boolean; declare const isIpad: () => boolean; declare const isIphone: () => boolean; declare const isWindowsPhone: () => boolean; declare const isMac: () => boolean; declare const isWindows: () => boolean; declare const isLinux: () => boolean; declare const isPC: () => boolean; declare const getAgentType: () => string; declare const device_isMobile: typeof isMobile; declare const device_isWechat: typeof isWechat; declare const device_isAndroid: typeof isAndroid; declare const device_isIpad: typeof isIpad; declare const device_isIphone: typeof isIphone; declare const device_isWindowsPhone: typeof isWindowsPhone; declare const device_isMac: typeof isMac; declare const device_isWindows: typeof isWindows; declare const device_isLinux: typeof isLinux; declare const device_isPC: typeof isPC; declare const device_getAgentType: typeof getAgentType; declare namespace device { export { device_isMobile as isMobile, device_isWechat as isWechat, device_isAndroid as isAndroid, device_isIpad as isIpad, device_isIphone as isIphone, device_isWindowsPhone as isWindowsPhone, device_isMac as isMac, device_isWindows as isWindows, device_isLinux as isLinux, device_isPC as isPC, device_getAgentType as getAgentType, }; } declare function setCookie(key: string, value: string, options?: any): void; declare function getCookie(key: string): string; declare function delCookie(key: string): boolean; declare const cookie_setCookie: typeof setCookie; declare const cookie_getCookie: typeof getCookie; declare const cookie_delCookie: typeof delCookie; declare namespace cookie { export { cookie_setCookie as setCookie, cookie_getCookie as getCookie, cookie_delCookie as delCookie, }; } declare const parse: (source: string, reviver?: (this: any, key: string, value: any) => any) => any; declare const stringify: (value: any, replacer?: any, space?: string | number) => string; declare const jsonfix_parse: typeof parse; declare const jsonfix_stringify: typeof stringify; declare namespace jsonfix { export { jsonfix_parse as parse, jsonfix_stringify as stringify, }; } declare function hashCode(obj: any): number; declare const hash_hashCode: typeof hashCode; declare namespace hash { export { hash_hashCode as hashCode, }; } declare type ColorsFunction = (d: any) => string; declare function colors(specifier: string): ColorsFunction; declare const category10: ColorsFunction; declare const accent: ColorsFunction; declare const dark2: ColorsFunction; declare const paired: ColorsFunction; declare const pastel1: ColorsFunction; declare const pastel2: ColorsFunction; declare const set1: ColorsFunction; declare const set2: ColorsFunction; declare const set3: ColorsFunction; declare const tableau10: ColorsFunction; type colors$1_ColorsFunction = ColorsFunction; declare const colors$1_colors: typeof colors; declare const colors$1_category10: typeof category10; declare const colors$1_accent: typeof accent; declare const colors$1_dark2: typeof dark2; declare const colors$1_paired: typeof paired; declare const colors$1_pastel1: typeof pastel1; declare const colors$1_pastel2: typeof pastel2; declare const colors$1_set1: typeof set1; declare const colors$1_set2: typeof set2; declare const colors$1_set3: typeof set3; declare const colors$1_tableau10: typeof tableau10; declare namespace colors$1 { export { colors$1_ColorsFunction as ColorsFunction, colors$1_colors as colors, colors$1_category10 as category10, colors$1_accent as accent, colors$1_dark2 as dark2, colors$1_paired as paired, colors$1_pastel1 as pastel1, colors$1_pastel2 as pastel2, colors$1_set1 as set1, colors$1_set2 as set2, colors$1_set3 as set3, colors$1_tableau10 as tableau10, }; } declare function proto(): void; export { colors$1 as colors, cookie, date, device, hash, jsonfix as json, proto, regexp, string, type$1 as type, url, utils };