mixlea-utils-js 0.1.87 → 0.1.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mixlea-utils-js.js +1519 -1432
- package/dist/mixlea-utils-js.umd.js +2 -2
- package/dist/types/index.d.ts +763 -695
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -541,985 +541,1053 @@ export declare const getConfigStoreAtKey: <V = any>(key: string) => V | undefine
|
|
|
541
541
|
|
|
542
542
|
export declare function getCurrentDate(): Date;
|
|
543
543
|
|
|
544
|
-
export declare function getDateDay(value: any, defaultValue?: number): number;
|
|
545
|
-
|
|
546
|
-
export declare function getDateLastDay(value: any, defaultValue?: number): number;
|
|
547
|
-
|
|
548
|
-
export declare function getDateMonth(value: any, defaultValue?: number): number;
|
|
549
|
-
|
|
550
|
-
export declare function getDateMonthEndDate(value: any, defaultValue?: Date): Date;
|
|
551
|
-
|
|
552
|
-
export declare function getDateMonthStartDate(value: any, defaultValue?: Date): Date;
|
|
553
|
-
|
|
554
|
-
export declare function getDateTimestamp(value: any, defaultValue: number): number;
|
|
555
|
-
|
|
556
|
-
export declare function getDateWeekday(value: any, defaultValue?: number): number;
|
|
557
|
-
|
|
558
|
-
export declare function getDateYear(value: any, defaultValue?: number): number;
|
|
559
|
-
|
|
560
|
-
export declare function getDateZeroTimeZoneTime(value: any): number;
|
|
561
|
-
|
|
562
|
-
export declare function getDayEndTimestamp(value: any, defaultValue?: number): number;
|
|
563
|
-
|
|
564
|
-
export declare function getDayStartTimestamp(value: any, defaultValue?: number): number;
|
|
565
|
-
|
|
566
|
-
export declare function getDOMRect(element: any): DOMRect | null;
|
|
567
|
-
|
|
568
|
-
export declare function getFileType(fileName: string): string;
|
|
569
|
-
|
|
570
|
-
export declare function getFileTypeFromPath(path: string): {
|
|
571
|
-
ext: null;
|
|
572
|
-
mime: null;
|
|
573
|
-
} | {
|
|
574
|
-
ext: string;
|
|
575
|
-
mime: string;
|
|
576
|
-
};
|
|
577
|
-
|
|
578
544
|
/**
|
|
579
|
-
*
|
|
580
|
-
* @param
|
|
581
|
-
* @param
|
|
582
|
-
* @returns
|
|
583
|
-
|
|
584
|
-
export declare function
|
|
545
|
+
* 获取指定日期所属的年份和周号
|
|
546
|
+
* @param date - 目标日期
|
|
547
|
+
* @param firstDayOfWeek - 每周起始日(0=周日, 1=周一 ... 6=周六,默认1)
|
|
548
|
+
* @returns { year: number, week: number }
|
|
549
|
+
*/
|
|
550
|
+
export declare function getDateBelongWeek(date: Date, firstDayOfWeek?: number): {
|
|
551
|
+
year: number;
|
|
552
|
+
week: number;
|
|
553
|
+
};
|
|
585
554
|
|
|
586
|
-
export declare function
|
|
555
|
+
export declare function getDateDay(value: any, defaultValue?: number): number;
|
|
587
556
|
|
|
588
|
-
export declare function
|
|
557
|
+
export declare function getDateLastDay(value: any, defaultValue?: number): number;
|
|
589
558
|
|
|
590
|
-
export declare function
|
|
559
|
+
export declare function getDateMonth(value: any, defaultValue?: number): number;
|
|
591
560
|
|
|
592
|
-
export declare function
|
|
561
|
+
export declare function getDateMonthEndDate(value: any, defaultValue?: Date): Date;
|
|
593
562
|
|
|
594
|
-
export declare function
|
|
563
|
+
export declare function getDateMonthStartDate(value: any, defaultValue?: Date): Date;
|
|
595
564
|
|
|
596
|
-
export declare function
|
|
565
|
+
export declare function getDateTimestamp(value: any, defaultValue: number): number;
|
|
597
566
|
|
|
598
|
-
export declare function
|
|
567
|
+
export declare function getDateWeekday(value: any, defaultValue?: number): number;
|
|
599
568
|
|
|
600
|
-
export declare function
|
|
569
|
+
export declare function getDateYear(value: any, defaultValue?: number): number;
|
|
601
570
|
|
|
602
|
-
export declare function
|
|
571
|
+
export declare function getDateZeroTimeZoneTime(value: any): number;
|
|
603
572
|
|
|
604
|
-
export declare function
|
|
573
|
+
export declare function getDayEndTimestamp(value: any, defaultValue?: number): number;
|
|
605
574
|
|
|
606
|
-
export declare function
|
|
575
|
+
export declare function getDayStartTimestamp(value: any, defaultValue?: number): number;
|
|
607
576
|
|
|
608
|
-
export declare function
|
|
577
|
+
export declare function getDOMRect(element: any): DOMRect | null;
|
|
609
578
|
|
|
610
|
-
export declare function
|
|
579
|
+
export declare function getFileType(fileName: string): string;
|
|
611
580
|
|
|
612
|
-
export declare function
|
|
581
|
+
export declare function getFileTypeFromPath(path: string): {
|
|
582
|
+
ext: null;
|
|
583
|
+
mime: null;
|
|
584
|
+
} | {
|
|
585
|
+
ext: string;
|
|
586
|
+
mime: string;
|
|
587
|
+
};
|
|
613
588
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
589
|
+
/**
|
|
590
|
+
* 根据占比调整 HEX 颜色的亮度(通过 HSL)
|
|
591
|
+
* @param hexColor 十六进制颜色(如 "#4CAF50")
|
|
592
|
+
* @param percentage 占比(0~1,0=最亮,1=最暗)
|
|
593
|
+
* @returns 调整后的 HEX 颜色
|
|
594
|
+
*/
|
|
595
|
+
export declare function getHexPercentColor(hexColor: string, percentage: number): string;
|
|
617
596
|
|
|
618
|
-
export declare function
|
|
597
|
+
export declare function getMonthEndTimestamp(value: any, defaultValue: number): number;
|
|
619
598
|
|
|
620
|
-
|
|
621
|
-
* 在两个 HEX 颜色之间平滑过渡
|
|
622
|
-
* @param startHex 起始颜色(如 "#FF0000")
|
|
623
|
-
* @param endHex 结束颜色(如 "#00FF00")
|
|
624
|
-
* @param percent 过渡比例(0~1,0=起始色,1=结束色)
|
|
625
|
-
* @returns 过渡后的 HEX 颜色
|
|
626
|
-
*/
|
|
627
|
-
export declare function getRangeHexPercentColor(startHex: string, endHex: string, percent: number): string;
|
|
599
|
+
export declare function getMonthStartTimestamp(value: any, defaultValue: number): number;
|
|
628
600
|
|
|
629
|
-
export declare function
|
|
601
|
+
export declare function getNextMonthDate(value: any, defaultValue?: Date): Date;
|
|
630
602
|
|
|
631
|
-
export declare function
|
|
603
|
+
export declare function getNextYearDate(value: any, defaultValue?: Date): Date;
|
|
632
604
|
|
|
633
|
-
export declare function
|
|
605
|
+
export declare function getNumberPrecision(value: any): number;
|
|
634
606
|
|
|
635
|
-
export declare function
|
|
607
|
+
export declare function getNumberStandardString(value: any): string;
|
|
636
608
|
|
|
637
|
-
export declare function
|
|
609
|
+
export declare function getObjectEntries<T extends Record<string, any>>(obj: T): [string, any][];
|
|
638
610
|
|
|
639
|
-
export declare function
|
|
611
|
+
export declare function getObjectUID(key: Record<string, any>): any;
|
|
640
612
|
|
|
641
|
-
export declare
|
|
642
|
-
downloadBuffer: typeof downloadBuffer_2;
|
|
643
|
-
downloadURL: typeof downloadURL_2;
|
|
644
|
-
exportFile: typeof exportFile;
|
|
645
|
-
exportJson: typeof exportJson;
|
|
646
|
-
readJsonFile: typeof readJsonFile;
|
|
647
|
-
};
|
|
613
|
+
export declare function getOffsetDaysDate(input: any, days: number, fallbackDate?: Date): Date;
|
|
648
614
|
|
|
649
|
-
export declare function
|
|
615
|
+
export declare function getOffsetMonthsDate(input: any, months: number, fallbackDate?: Date): Date;
|
|
650
616
|
|
|
651
|
-
export declare function
|
|
652
|
-
v: string;
|
|
653
|
-
o: {
|
|
654
|
-
r: number;
|
|
655
|
-
g: number;
|
|
656
|
-
b: number;
|
|
657
|
-
a: number;
|
|
658
|
-
};
|
|
659
|
-
};
|
|
617
|
+
export declare function getOffsetYearsDate(input: any, years: number, fallbackDate?: Date): Date;
|
|
660
618
|
|
|
661
|
-
export declare function
|
|
619
|
+
export declare function getPercentRGB(rgb: [number, number, number], percentage: number, darken?: boolean): number[];
|
|
662
620
|
|
|
663
|
-
export declare function
|
|
621
|
+
export declare function getPrevMonthDate(value: any, defaultValue?: Date): Date;
|
|
664
622
|
|
|
665
|
-
export declare function
|
|
623
|
+
export declare function getPrevYearDate(value: any, defaultValue?: Date): Date;
|
|
666
624
|
|
|
667
|
-
declare
|
|
668
|
-
|
|
669
|
-
}
|
|
625
|
+
export declare function getRangeDateMonthSegments([startDate, endDate]: [Date, Date], opts?: {
|
|
626
|
+
hasYear?: boolean;
|
|
627
|
+
}): string[];
|
|
670
628
|
|
|
671
|
-
declare
|
|
629
|
+
export declare function getRangeDateYearSegments([startDate, endDate]: [Date, Date]): string[];
|
|
672
630
|
|
|
673
|
-
|
|
631
|
+
/**
|
|
632
|
+
* 在两个 HEX 颜色之间平滑过渡
|
|
633
|
+
* @param startHex 起始颜色(如 "#FF0000")
|
|
634
|
+
* @param endHex 结束颜色(如 "#00FF00")
|
|
635
|
+
* @param percent 过渡比例(0~1,0=起始色,1=结束色)
|
|
636
|
+
* @returns 过渡后的 HEX 颜色
|
|
637
|
+
*/
|
|
638
|
+
export declare function getRangeHexPercentColor(startHex: string, endHex: string, percent: number): string;
|
|
674
639
|
|
|
675
|
-
export declare function
|
|
640
|
+
export declare function getRecordMergeKey<R extends Record<string, any>>(row: R, ...fields: (string | ((row: R) => any))[]): any;
|
|
676
641
|
|
|
677
|
-
export declare function
|
|
642
|
+
export declare function getToday(): Date;
|
|
678
643
|
|
|
679
|
-
export declare function
|
|
644
|
+
export declare function getTodayEndTimestamp(): number;
|
|
680
645
|
|
|
681
|
-
export declare function
|
|
646
|
+
export declare function getTodayStartTimestamp(): number;
|
|
682
647
|
|
|
683
|
-
|
|
648
|
+
/**
|
|
649
|
+
* 获取某年详细的周数信息
|
|
650
|
+
* @param year - 年份,默认为当前年份
|
|
651
|
+
* @param firstDayOfWeek - 一周的起始日(0=周日,1=周一,默认为1)
|
|
652
|
+
* @returns 周信息数组:[{ week: number, range: [Date, Date] }]
|
|
653
|
+
*/
|
|
654
|
+
export declare function getYearDetailWeeks(year?: number, firstDayOfWeek?: number): {
|
|
655
|
+
week: number;
|
|
656
|
+
range: [Date, Date];
|
|
657
|
+
}[];
|
|
684
658
|
|
|
685
|
-
export declare function
|
|
659
|
+
export declare function getYearEndTimestamp(input: any): number | null;
|
|
686
660
|
|
|
687
|
-
|
|
661
|
+
/**
|
|
662
|
+
* 获取指定年份的第一周开始日期(0点)
|
|
663
|
+
* @param year - 年份
|
|
664
|
+
* @param firstDayOfWeek - 一周的起始日(0=周日, 1=周一 ... 6=周六,默认1)
|
|
665
|
+
* @returns 第一周的开始日期(0点)
|
|
666
|
+
*/
|
|
667
|
+
export declare function getYearFirstWeekStartDate(year: number, firstDayOfWeek?: number): Date;
|
|
688
668
|
|
|
689
|
-
|
|
669
|
+
/**
|
|
670
|
+
* 获取指定年份最后一周的结束日期(23:59:59.999)
|
|
671
|
+
* @param year - 年份
|
|
672
|
+
* @param firstDayOfWeek - 一周起始日(0=周日, 1=周一 ... 6=周六,默认1)
|
|
673
|
+
* @returns 最后一周的结束日期
|
|
674
|
+
*/
|
|
675
|
+
export declare function getYearLastWeekEndDate(year: number, firstDayOfWeek?: number): Date;
|
|
690
676
|
|
|
691
|
-
export declare function
|
|
677
|
+
export declare function getYearStartTimestamp(input: any): number | null;
|
|
692
678
|
|
|
693
|
-
|
|
679
|
+
/**
|
|
680
|
+
* 根据年份和周号获取该周的开始日期
|
|
681
|
+
* @param year - 年份
|
|
682
|
+
* @param week - 第几周(1-based)
|
|
683
|
+
* @param firstDayOfWeek - 一周的起始日(0=周日, 1=周一 ... 6=周六,默认为1)
|
|
684
|
+
* @returns 周的开始日期
|
|
685
|
+
*/
|
|
686
|
+
export declare function getYearWeekEndDate(year: number, week: number, firstDayOfWeek?: number): Date;
|
|
694
687
|
|
|
695
|
-
export declare function
|
|
696
|
-
then<T>(truthy: ValueOrFn<T>): {
|
|
697
|
-
else(falsy: ValueOrFn<T>): T;
|
|
698
|
-
};
|
|
699
|
-
};
|
|
688
|
+
export declare function getYearWeekOffsetEndDate(year: number, week: number, offsetWeek: number, firstDayOfWeek?: number): Date;
|
|
700
689
|
|
|
701
|
-
|
|
702
|
-
* @param value 输入值
|
|
703
|
-
* @param thousandth 千分位, 默认 true
|
|
704
|
-
* @param allowNegative 允许负数, 默认 true
|
|
705
|
-
* @param allowDecimal 允许小数, 默认 true
|
|
706
|
-
* @param precision 小数位, 默认 2
|
|
707
|
-
*/
|
|
708
|
-
export declare function inputNumberMask(value: any, options?: {
|
|
709
|
-
thousandth?: boolean;
|
|
710
|
-
allowNegative?: boolean;
|
|
711
|
-
allowDecimal?: boolean;
|
|
712
|
-
precision?: number;
|
|
713
|
-
}): string;
|
|
690
|
+
export declare function getYearWeekOffsetStartDate(year: number, week: number, offsetWeek: number, firstDayOfWeek?: number): Date;
|
|
714
691
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
692
|
+
/**
|
|
693
|
+
* 获取某年的周数信息
|
|
694
|
+
* @param year - 年份,默认为当前年份
|
|
695
|
+
* @param firstDayOfWeek - 一周的起始日(0=周日,1=周一,默认为1)
|
|
696
|
+
* @returns 周信息数组:[{ week: number, range: [Date, Date] }]
|
|
697
|
+
*/
|
|
698
|
+
export declare function getYearWeeks(year?: number, firstDayOfWeek?: number): number[];
|
|
718
699
|
|
|
719
|
-
|
|
700
|
+
/**
|
|
701
|
+
* 根据年份和周号获取该周的开始日期
|
|
702
|
+
* @param year - 年份
|
|
703
|
+
* @param week - 第几周(1-based)
|
|
704
|
+
* @param firstDayOfWeek - 一周的起始日(0=周日, 1=周一 ... 6=周六,默认为1)
|
|
705
|
+
* @returns 周的开始日期
|
|
706
|
+
*/
|
|
707
|
+
export declare function getYearWeekStartDate(year: number, week: number, firstDayOfWeek?: number): Date;
|
|
720
708
|
|
|
721
|
-
export declare
|
|
709
|
+
export declare const h5: {
|
|
710
|
+
downloadBuffer: typeof downloadBuffer_2;
|
|
711
|
+
downloadURL: typeof downloadURL_2;
|
|
712
|
+
exportFile: typeof exportFile;
|
|
713
|
+
exportJson: typeof exportJson;
|
|
714
|
+
readJsonFile: typeof readJsonFile;
|
|
715
|
+
};
|
|
722
716
|
|
|
723
|
-
declare
|
|
724
|
-
[name: string]: any;
|
|
725
|
-
}
|
|
717
|
+
export declare function hexToArgb(hexColor: string): string;
|
|
726
718
|
|
|
727
|
-
export declare function
|
|
719
|
+
export declare function hexToRgba(ahex: string, inpuyAlpha?: number | string): {
|
|
720
|
+
v: string;
|
|
721
|
+
o: {
|
|
722
|
+
r: number;
|
|
723
|
+
g: number;
|
|
724
|
+
b: number;
|
|
725
|
+
a: number;
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
728
|
|
|
729
|
-
export declare function
|
|
729
|
+
export declare function htmlElementAppendChild(parentElement: HTMLElement, sonElement: HTMLElement): HTMLElement;
|
|
730
730
|
|
|
731
|
-
export declare function
|
|
731
|
+
export declare function htmlElementHasClassName(element: Element, className: string): boolean;
|
|
732
732
|
|
|
733
|
-
export declare function
|
|
733
|
+
export declare function htmlElementRemoveChild(parentElement: HTMLElement, sonElement: HTMLElement): HTMLElement;
|
|
734
734
|
|
|
735
|
-
|
|
735
|
+
declare interface IAbstractTreeNode {
|
|
736
|
+
children?: IAbstractTreeNode[];
|
|
737
|
+
}
|
|
736
738
|
|
|
737
|
-
|
|
739
|
+
declare type IBaseValue<T> = T;
|
|
738
740
|
|
|
739
|
-
export declare function
|
|
741
|
+
export declare function IF(condition: any, trueValue: any | (() => any)): any;
|
|
740
742
|
|
|
741
|
-
|
|
742
|
-
* 判断数据是否为[null, undefind], 数组为空, 字符串为空, 对象为空
|
|
743
|
-
* @param input
|
|
744
|
-
*/
|
|
745
|
-
export declare function isEmpty(input: any): input is VoidLike_2;
|
|
743
|
+
export declare function IF_ZERO_OR_NAN_REPLACE(input: any, replace: any): any;
|
|
746
744
|
|
|
747
|
-
export declare function
|
|
745
|
+
export declare function IFEL<C, T, F>(condition: C, trueExp: T | ((condition: C) => T), falseExp: F | ((condition: C) => F)): T | F;
|
|
748
746
|
|
|
749
|
-
export declare function
|
|
747
|
+
export declare function ifElse(condition: boolean, trueReturn: any, falseReturn: any): any;
|
|
750
748
|
|
|
751
|
-
export declare function
|
|
749
|
+
export declare function IFEmpty<T = any, K = any>(val: T, elVal: K): T | K;
|
|
752
750
|
|
|
753
|
-
export declare function
|
|
751
|
+
export declare function IFEqualReplace(val: any, equalValue: any, replace: any): any;
|
|
754
752
|
|
|
755
|
-
export declare function
|
|
753
|
+
export declare function IFInvalidDateReplace(date: any, replace: Date): any;
|
|
756
754
|
|
|
757
|
-
export declare function
|
|
755
|
+
export declare function ifNaNReplace(val: any, replace: any): any;
|
|
758
756
|
|
|
759
|
-
|
|
757
|
+
declare type IFnValue<T> = (...args: any[]) => T;
|
|
760
758
|
|
|
761
|
-
export declare function
|
|
759
|
+
export declare function ifReplace<T>(val: T, fn: (val: T) => boolean, replace: any): any;
|
|
762
760
|
|
|
763
|
-
export declare function
|
|
761
|
+
export declare function ifReturn<T>(condition: boolean | (() => boolean), val: T): T | undefined;
|
|
764
762
|
|
|
765
|
-
export declare function
|
|
763
|
+
export declare function iif(condition: ValueOrFn<boolean>): {
|
|
764
|
+
then<T>(truthy: ValueOrFn<T>): {
|
|
765
|
+
else(falsy: ValueOrFn<T>): T;
|
|
766
|
+
};
|
|
767
|
+
};
|
|
766
768
|
|
|
767
|
-
|
|
769
|
+
/**
|
|
770
|
+
* @param value 输入值
|
|
771
|
+
* @param thousandth 千分位, 默认 true
|
|
772
|
+
* @param allowNegative 允许负数, 默认 true
|
|
773
|
+
* @param allowDecimal 允许小数, 默认 true
|
|
774
|
+
* @param precision 小数位, 默认 2
|
|
775
|
+
*/
|
|
776
|
+
export declare function inputNumberMask(value: any, options?: {
|
|
777
|
+
thousandth?: boolean;
|
|
778
|
+
allowNegative?: boolean;
|
|
779
|
+
allowDecimal?: boolean;
|
|
780
|
+
precision?: number;
|
|
781
|
+
}): string;
|
|
768
782
|
|
|
769
|
-
export declare function
|
|
783
|
+
export declare function integerFormatter<T = unknown>(value: T, options?: {
|
|
784
|
+
thousandth?: boolean;
|
|
785
|
+
}): string;
|
|
770
786
|
|
|
771
|
-
export declare function
|
|
787
|
+
export declare function invalidDateReplace<T = any>(date: Date, repalce: T): Date | T;
|
|
772
788
|
|
|
773
|
-
|
|
774
|
-
* 判断数据是否不为[null, undefind], 数组不为空, 字符串不为空, 对象不为空
|
|
775
|
-
* @param input
|
|
776
|
-
*/
|
|
777
|
-
export declare function isNotEmpty(input: any): input is NotVoidLike;
|
|
789
|
+
export declare function invokeable<T>(value: IValue<T>, args: any[]): T;
|
|
778
790
|
|
|
779
|
-
|
|
791
|
+
declare interface IObject {
|
|
792
|
+
[name: string]: any;
|
|
793
|
+
}
|
|
780
794
|
|
|
781
|
-
export declare function
|
|
795
|
+
export declare function isArray<T>(arr: T[] | unknown): arr is T[];
|
|
782
796
|
|
|
783
|
-
export declare function
|
|
797
|
+
export declare function isBoolean(value: any): value is boolean;
|
|
784
798
|
|
|
785
|
-
export declare function
|
|
799
|
+
export declare function isChineseChar(input: any): boolean;
|
|
786
800
|
|
|
787
|
-
export declare function
|
|
801
|
+
export declare function isChineseString(input: any): boolean;
|
|
788
802
|
|
|
789
|
-
export declare function
|
|
803
|
+
export declare function isDate(date: any): date is Date;
|
|
790
804
|
|
|
791
|
-
export declare function
|
|
805
|
+
export declare function isDesktopBrowser(): boolean;
|
|
792
806
|
|
|
793
|
-
export declare function
|
|
807
|
+
export declare function isDOM(element: any): any;
|
|
794
808
|
|
|
795
|
-
|
|
809
|
+
/**
|
|
810
|
+
* 判断数据是否为[null, undefind], 数组为空, 字符串为空, 对象为空
|
|
811
|
+
* @param input
|
|
812
|
+
*/
|
|
813
|
+
export declare function isEmpty(input: any): input is VoidLike_2;
|
|
796
814
|
|
|
797
|
-
export declare function
|
|
815
|
+
export declare function isEmptyString(value: any): boolean;
|
|
798
816
|
|
|
799
|
-
export declare function
|
|
817
|
+
export declare function isEqual(x: any, y: any): boolean;
|
|
800
818
|
|
|
801
|
-
|
|
802
|
-
* 判断两个对象是否相等
|
|
803
|
-
*/
|
|
804
|
-
export declare function isObjStructureEqual(obj1: Record<string, any>, obj2: Record<string, any>): boolean;
|
|
819
|
+
export declare function isEqualZero(number: number, digits?: number): boolean;
|
|
805
820
|
|
|
806
|
-
export declare function
|
|
821
|
+
export declare function isEveryVoid(...items: any[]): boolean;
|
|
807
822
|
|
|
808
|
-
export declare function
|
|
823
|
+
export declare function isFalse(val: any): val is false;
|
|
809
824
|
|
|
810
|
-
export declare function
|
|
825
|
+
export declare function isFasly(val: any): val is false;
|
|
811
826
|
|
|
812
|
-
export declare function
|
|
827
|
+
export declare function isFormData(input: any): input is FormData;
|
|
813
828
|
|
|
814
|
-
export declare function
|
|
829
|
+
export declare function isFunction<T extends (...args: any[]) => any>(input: unknown): input is T;
|
|
815
830
|
|
|
816
|
-
export declare function
|
|
831
|
+
export declare function isHtmlElement(input: any): input is HTMLElement;
|
|
817
832
|
|
|
818
|
-
export declare function
|
|
819
|
-
leafField?: string;
|
|
820
|
-
}): boolean;
|
|
833
|
+
export declare function isHtmlInputElement(input: any): input is HTMLInputElement;
|
|
821
834
|
|
|
822
|
-
export declare function
|
|
823
|
-
leafField?: string;
|
|
824
|
-
}): boolean;
|
|
835
|
+
export declare function isMobileBrowser(): boolean;
|
|
825
836
|
|
|
826
|
-
export declare function
|
|
837
|
+
export declare function isMoreThanZero(val: any): boolean;
|
|
827
838
|
|
|
828
|
-
export declare function
|
|
839
|
+
export declare function isNodeContains(container: HTMLElement | null | undefined, target?: HTMLElement | null | undefined): boolean;
|
|
829
840
|
|
|
830
|
-
|
|
841
|
+
/**
|
|
842
|
+
* 判断数据是否不为[null, undefind], 数组不为空, 字符串不为空, 对象不为空
|
|
843
|
+
* @param input
|
|
844
|
+
*/
|
|
845
|
+
export declare function isNotEmpty(input: any): input is NotVoidLike;
|
|
831
846
|
|
|
832
|
-
export declare function
|
|
847
|
+
export declare function isNotEmptyArray(arr: any): arr is Array<any>;
|
|
833
848
|
|
|
834
|
-
export declare function
|
|
849
|
+
export declare function isNotEmptyString(value: any): value is string;
|
|
835
850
|
|
|
836
|
-
export declare function
|
|
851
|
+
export declare function isNotEqualZero(number: number, digits?: number): boolean;
|
|
837
852
|
|
|
838
|
-
export declare function
|
|
853
|
+
export declare function isNotNullish<T>(value: T | null | undefined): value is T;
|
|
839
854
|
|
|
840
|
-
export declare function
|
|
855
|
+
export declare function isNotPlainObject(val: any): boolean;
|
|
841
856
|
|
|
842
|
-
export declare function
|
|
857
|
+
export declare function isNotUndefined(value: any): boolean;
|
|
843
858
|
|
|
844
|
-
declare
|
|
845
|
-
[field: string]: any | (() => any);
|
|
846
|
-
default?: any | (() => any);
|
|
847
|
-
}
|
|
859
|
+
export declare function isNotVoid(input: any): input is NotVoidLike_2;
|
|
848
860
|
|
|
849
|
-
declare
|
|
850
|
-
|
|
851
|
-
export declare const jsonParser: {
|
|
852
|
-
FUNC_PREFIX: string;
|
|
853
|
-
REG_PREFIX: string;
|
|
854
|
-
isArrOrObj(obj: any): boolean;
|
|
855
|
-
isArr(obj: any): boolean;
|
|
856
|
-
isObj(obj: any): boolean;
|
|
857
|
-
isRegExp(obj: any): boolean;
|
|
858
|
-
isFunc(obj: any): boolean;
|
|
859
|
-
funcParse(obj: IObject | any[]): any;
|
|
860
|
-
parse(jsonStr: string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): any;
|
|
861
|
-
stringify(obj: any, replacer?: ((key: string, value: any) => any) | undefined, space?: number | string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): string;
|
|
862
|
-
fastStringify(obj: any, space?: number | string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): string;
|
|
863
|
-
nativeStringify: {
|
|
864
|
-
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
865
|
-
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
866
|
-
};
|
|
867
|
-
nativeParse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any;
|
|
868
|
-
};
|
|
861
|
+
export declare function isNullish<T>(value: T | null | undefined): value is null | undefined;
|
|
869
862
|
|
|
870
|
-
export declare function
|
|
863
|
+
export declare function isNumber(value: any): value is number;
|
|
871
864
|
|
|
872
|
-
export declare function
|
|
865
|
+
export declare function isNumeric(token: string): boolean;
|
|
873
866
|
|
|
874
|
-
export declare function
|
|
867
|
+
export declare function isObject<T extends Record<string, any>>(obj: unknown): obj is T;
|
|
875
868
|
|
|
876
|
-
|
|
869
|
+
/**
|
|
870
|
+
* 判断两个对象是否相等
|
|
871
|
+
*/
|
|
872
|
+
export declare function isObjStructureEqual(obj1: Record<string, any>, obj2: Record<string, any>): boolean;
|
|
877
873
|
|
|
878
|
-
export declare function
|
|
874
|
+
export declare function isPlainObject(val: any): boolean;
|
|
879
875
|
|
|
880
|
-
declare
|
|
881
|
-
eq: string | number;
|
|
882
|
-
ne: string | number;
|
|
883
|
-
ge: string | number;
|
|
884
|
-
le: string | number;
|
|
885
|
-
gt: string | number;
|
|
886
|
-
lt: string | number;
|
|
887
|
-
in: (string | number | Record<string, any>)[];
|
|
888
|
-
notIn: (string | number | Record<string, any>)[];
|
|
889
|
-
like: string | number;
|
|
890
|
-
likeRight: string | number;
|
|
891
|
-
likeLeft: string | number;
|
|
892
|
-
between: [string | number, string | number];
|
|
893
|
-
isNull: boolean;
|
|
894
|
-
isEmpty: boolean;
|
|
895
|
-
}
|
|
876
|
+
export declare function isPromise<T>(input: T): input is T extends Promise<any> ? T : never;
|
|
896
877
|
|
|
897
|
-
declare
|
|
898
|
-
eq?: Nullable_2<string | number>;
|
|
899
|
-
ne?: Nullable_2<string | number>;
|
|
900
|
-
ge?: Nullable_2<string | number>;
|
|
901
|
-
le?: Nullable_2<string | number>;
|
|
902
|
-
gt?: Nullable_2<string | number>;
|
|
903
|
-
lt?: Nullable_2<string | number>;
|
|
904
|
-
in?: Nullable_2<(string | number | Record<string, any>)[]>;
|
|
905
|
-
notIn?: Nullable_2<(string | number | Record<string, any>)[]>;
|
|
906
|
-
like?: Nullable_2<string | number>;
|
|
907
|
-
likeRight?: Nullable_2<string | number>;
|
|
908
|
-
likeLeft?: Nullable_2<string | number>;
|
|
909
|
-
between?: Nullable_2<[string | number, string | number]>;
|
|
910
|
-
isNull?: Nullable_2<boolean>;
|
|
911
|
-
isEmpty?: Nullable_2<boolean>;
|
|
912
|
-
tag?: Nullable_2<string>;
|
|
913
|
-
}
|
|
878
|
+
export declare function isSomeNotVoid(...items: any[]): boolean;
|
|
914
879
|
|
|
915
|
-
declare
|
|
916
|
-
eq?: string | number;
|
|
917
|
-
ne?: string | number;
|
|
918
|
-
ge?: string | number;
|
|
919
|
-
le?: string | number;
|
|
920
|
-
gt?: string | number;
|
|
921
|
-
lt?: string | number;
|
|
922
|
-
in?: (string | number | Record<string, any>)[];
|
|
923
|
-
notIn?: (string | number | Record<string, any>)[];
|
|
924
|
-
like?: string | number;
|
|
925
|
-
likeRight?: string | number;
|
|
926
|
-
likeLeft?: string | number;
|
|
927
|
-
between?: [string | number, string | number];
|
|
928
|
-
isNull?: boolean;
|
|
929
|
-
isEmpty?: boolean;
|
|
930
|
-
tag?: string;
|
|
931
|
-
}
|
|
880
|
+
export declare function isSomeVoid(...items: any[]): boolean;
|
|
932
881
|
|
|
933
|
-
export declare function
|
|
882
|
+
export declare function isString(value: unknown): value is string;
|
|
934
883
|
|
|
935
|
-
declare
|
|
936
|
-
case: <CK extends CaseKey, CV>(key: Callable<CK> | Callable<CK[]>, value: Callable<CV>) => MatchBuilder<K, V | CV>;
|
|
937
|
-
default: <DV>(value: Callable<DV>) => V | DV;
|
|
938
|
-
};
|
|
884
|
+
export declare function isTimestamp(input: any): boolean;
|
|
939
885
|
|
|
940
|
-
export declare function
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
precision?: number;
|
|
944
|
-
} | number): number;
|
|
886
|
+
export declare function isTreeBranch<T extends Record<string, any>>(node: T, opts?: {
|
|
887
|
+
leafField?: string;
|
|
888
|
+
}): boolean;
|
|
945
889
|
|
|
946
|
-
declare
|
|
890
|
+
export declare function isTreeLeaf<T extends Record<string, any>>(node: T, opts?: {
|
|
891
|
+
leafField?: string;
|
|
892
|
+
}): boolean;
|
|
947
893
|
|
|
948
|
-
|
|
894
|
+
export declare function isTrue(val: any): val is true;
|
|
949
895
|
|
|
950
|
-
export declare
|
|
951
|
-
get: typeof get;
|
|
952
|
-
set: (key: string | symbol, val: unknown) => void;
|
|
953
|
-
delete: (key: string | symbol) => void;
|
|
954
|
-
};
|
|
896
|
+
export declare function isTruly(val: any): val is true;
|
|
955
897
|
|
|
956
|
-
|
|
898
|
+
export declare function isUndefined(value: any): boolean;
|
|
957
899
|
|
|
958
|
-
export declare function
|
|
900
|
+
export declare function isURLSearchParams(input: any): input is URLSearchParams;
|
|
959
901
|
|
|
960
|
-
export declare function
|
|
902
|
+
export declare function isValidDate(input: any): input is Date;
|
|
961
903
|
|
|
962
|
-
export declare function
|
|
904
|
+
export declare function isValidNumber(val: any): boolean;
|
|
963
905
|
|
|
964
|
-
export declare function
|
|
965
|
-
thousandth?: boolean;
|
|
966
|
-
enableBillion?: boolean;
|
|
967
|
-
precision?: number | ((unit: 'None' | 'K' | 'W' | 'M' | 'B') => number);
|
|
968
|
-
onlyUnit?: 'None' | 'K' | 'W' | 'M' | 'B';
|
|
969
|
-
}): string;
|
|
906
|
+
export declare function isVoid(input: any): input is VoidLike;
|
|
970
907
|
|
|
971
|
-
export declare function
|
|
972
|
-
replaceNaNItem?: number;
|
|
973
|
-
replaceNaNResult?: number;
|
|
974
|
-
}): number;
|
|
908
|
+
export declare function isWebViewBrowser(): boolean;
|
|
975
909
|
|
|
976
|
-
export declare function
|
|
977
|
-
replaceNaNItem?: number;
|
|
978
|
-
replaceNaNResult?: number;
|
|
979
|
-
}): number;
|
|
910
|
+
export declare function isWeixinBrowser(): boolean;
|
|
980
911
|
|
|
981
|
-
declare
|
|
912
|
+
declare interface ISwitchMap {
|
|
913
|
+
[field: string]: any | (() => any);
|
|
914
|
+
default?: any | (() => any);
|
|
915
|
+
}
|
|
982
916
|
|
|
983
|
-
declare type
|
|
917
|
+
declare type IValue<T> = IBaseValue<T> | IFnValue<T>;
|
|
984
918
|
|
|
985
|
-
|
|
919
|
+
export declare const jsonParser: {
|
|
920
|
+
FUNC_PREFIX: string;
|
|
921
|
+
REG_PREFIX: string;
|
|
922
|
+
isArrOrObj(obj: any): boolean;
|
|
923
|
+
isArr(obj: any): boolean;
|
|
924
|
+
isObj(obj: any): boolean;
|
|
925
|
+
isRegExp(obj: any): boolean;
|
|
926
|
+
isFunc(obj: any): boolean;
|
|
927
|
+
funcParse(obj: IObject | any[]): any;
|
|
928
|
+
parse(jsonStr: string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): any;
|
|
929
|
+
stringify(obj: any, replacer?: ((key: string, value: any) => any) | undefined, space?: number | string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): string;
|
|
930
|
+
fastStringify(obj: any, space?: number | string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): string;
|
|
931
|
+
nativeStringify: {
|
|
932
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
933
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
934
|
+
};
|
|
935
|
+
nativeParse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any;
|
|
936
|
+
};
|
|
986
937
|
|
|
987
|
-
|
|
938
|
+
export declare function localStorageDelete(key: string): void;
|
|
988
939
|
|
|
989
|
-
declare
|
|
940
|
+
export declare function localStorageGet<T>(key: string): T | null;
|
|
990
941
|
|
|
991
|
-
|
|
992
|
-
* 返回第一个非 null 或 undefined 的值(支持直接值和函数懒求值)
|
|
993
|
-
*/
|
|
994
|
-
export declare function nullishCoalesce<T extends readonly MaybeThunk<any>[]>(...items: T): CoalesceReturn<T>;
|
|
942
|
+
export declare function localStorageSet(key: string, value: any): void;
|
|
995
943
|
|
|
996
|
-
export declare function
|
|
997
|
-
mode: 'round' | 'truncate';
|
|
998
|
-
}): string;
|
|
944
|
+
export declare function makeArray<T>(input: T): EnsureArray<T>;
|
|
999
945
|
|
|
1000
|
-
export declare function
|
|
946
|
+
export declare function mapKeys(map: any): any[];
|
|
1001
947
|
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
multiply?: number;
|
|
1019
|
-
}): string;
|
|
948
|
+
declare interface Mapping {
|
|
949
|
+
eq: string | number;
|
|
950
|
+
ne: string | number;
|
|
951
|
+
ge: string | number;
|
|
952
|
+
le: string | number;
|
|
953
|
+
gt: string | number;
|
|
954
|
+
lt: string | number;
|
|
955
|
+
in: (string | number | Record<string, any>)[];
|
|
956
|
+
notIn: (string | number | Record<string, any>)[];
|
|
957
|
+
like: string | number;
|
|
958
|
+
likeRight: string | number;
|
|
959
|
+
likeLeft: string | number;
|
|
960
|
+
between: [string | number, string | number];
|
|
961
|
+
isNull: boolean;
|
|
962
|
+
isEmpty: boolean;
|
|
963
|
+
}
|
|
1020
964
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
965
|
+
declare interface Mapping_2 {
|
|
966
|
+
eq?: Nullable_2<string | number>;
|
|
967
|
+
ne?: Nullable_2<string | number>;
|
|
968
|
+
ge?: Nullable_2<string | number>;
|
|
969
|
+
le?: Nullable_2<string | number>;
|
|
970
|
+
gt?: Nullable_2<string | number>;
|
|
971
|
+
lt?: Nullable_2<string | number>;
|
|
972
|
+
in?: Nullable_2<(string | number | Record<string, any>)[]>;
|
|
973
|
+
notIn?: Nullable_2<(string | number | Record<string, any>)[]>;
|
|
974
|
+
like?: Nullable_2<string | number>;
|
|
975
|
+
likeRight?: Nullable_2<string | number>;
|
|
976
|
+
likeLeft?: Nullable_2<string | number>;
|
|
977
|
+
between?: Nullable_2<[string | number, string | number]>;
|
|
978
|
+
isNull?: Nullable_2<boolean>;
|
|
979
|
+
isEmpty?: Nullable_2<boolean>;
|
|
980
|
+
tag?: Nullable_2<string>;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
declare interface MappingReuslt {
|
|
984
|
+
eq?: string | number;
|
|
985
|
+
ne?: string | number;
|
|
986
|
+
ge?: string | number;
|
|
987
|
+
le?: string | number;
|
|
988
|
+
gt?: string | number;
|
|
989
|
+
lt?: string | number;
|
|
990
|
+
in?: (string | number | Record<string, any>)[];
|
|
991
|
+
notIn?: (string | number | Record<string, any>)[];
|
|
992
|
+
like?: string | number;
|
|
993
|
+
likeRight?: string | number;
|
|
994
|
+
likeLeft?: string | number;
|
|
995
|
+
between?: [string | number, string | number];
|
|
996
|
+
isNull?: boolean;
|
|
997
|
+
isEmpty?: boolean;
|
|
998
|
+
tag?: string;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
export declare function match<K extends CaseKey>(key: Callable<K>): MatchBuilder<K, never>;
|
|
1002
|
+
|
|
1003
|
+
declare type MatchBuilder<K, V> = {
|
|
1004
|
+
case: <CK extends CaseKey, CV>(key: Callable<CK> | Callable<CK[]>, value: Callable<CV>) => MatchBuilder<K, V | CV>;
|
|
1005
|
+
default: <DV>(value: Callable<DV>) => V | DV;
|
|
1006
|
+
};
|
|
1007
|
+
|
|
1008
|
+
export declare function mathTakeEvaluate(variables: Record<string, any>, expression: string, opts?: {
|
|
1009
|
+
fallbackValue: number;
|
|
1010
|
+
termFallbackValue: number;
|
|
1011
|
+
precision?: number;
|
|
1012
|
+
} | number): number;
|
|
1013
|
+
|
|
1014
|
+
declare type MaybeThunk<T> = T | (() => T);
|
|
1015
|
+
|
|
1016
|
+
declare type MaybeThunk_2<T> = T | (() => T);
|
|
1017
|
+
|
|
1018
|
+
export declare const memoStore: {
|
|
1019
|
+
get: typeof get;
|
|
1020
|
+
set: (key: string | symbol, val: unknown) => void;
|
|
1021
|
+
delete: (key: string | symbol) => void;
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
declare type Merge<T extends any[]> = T extends [infer First, ...infer Rest extends any[]] ? First extends object ? Rest extends any[] ? First & Merge<Rest> : First : never : {};
|
|
1025
|
+
|
|
1026
|
+
export declare function mergeArray(...arrs: any[]): any[];
|
|
1027
|
+
|
|
1028
|
+
export declare function mergeObject<T extends any[]>(...objectList: T): Merge<T>;
|
|
1029
|
+
|
|
1030
|
+
export declare function mergeProps<T extends Record<string, any>>(base: T, extra: T): T;
|
|
1031
|
+
|
|
1032
|
+
export declare function moneyFormatter(input: any, opts?: {
|
|
1033
|
+
thousandth?: boolean;
|
|
1034
|
+
enableBillion?: boolean;
|
|
1035
|
+
precision?: number | ((unit: 'None' | 'K' | 'W' | 'M' | 'B') => number);
|
|
1036
|
+
onlyUnit?: 'None' | 'K' | 'W' | 'M' | 'B';
|
|
1037
|
+
}): string;
|
|
1038
|
+
|
|
1039
|
+
export declare function multiply(arr: any[], options?: {
|
|
1040
|
+
replaceNaNItem?: number;
|
|
1041
|
+
replaceNaNResult?: number;
|
|
1042
|
+
}): number;
|
|
1043
|
+
|
|
1044
|
+
export declare function multiplyBy(val: Record<string, any>, fields: string[], options?: {
|
|
1045
|
+
replaceNaNItem?: number;
|
|
1046
|
+
replaceNaNResult?: number;
|
|
1047
|
+
}): number;
|
|
1048
|
+
|
|
1049
|
+
declare type NextFunction<T> = (state: T) => T;
|
|
1050
|
+
|
|
1051
|
+
declare type NotVoidLike = object | Map<any, any> | Set<any> | string | number | boolean;
|
|
1052
|
+
|
|
1053
|
+
declare type NotVoidLike_2 = object | Map<any, any> | Set<any> | string | number | boolean;
|
|
1054
|
+
|
|
1055
|
+
declare type Nullable<T> = T | null | undefined;
|
|
1056
|
+
|
|
1057
|
+
declare type Nullable_2<T> = T | null | undefined;
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* 返回第一个非 null 或 undefined 的值(支持直接值和函数懒求值)
|
|
1061
|
+
*/
|
|
1062
|
+
export declare function nullishCoalesce<T extends readonly MaybeThunk<any>[]>(...items: T): CoalesceReturn<T>;
|
|
1063
|
+
|
|
1064
|
+
export declare function numberFormateDecimal(input: any, decimals?: number, opts?: {
|
|
1065
|
+
mode: 'round' | 'truncate';
|
|
1066
|
+
}): string;
|
|
1067
|
+
|
|
1068
|
+
export declare function numberFormateThousandth(value: any): string;
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* @param value 需格式化值
|
|
1072
|
+
* @param thousandth 千分位, 默认 true
|
|
1073
|
+
* @param percent 百分比, 默认 false
|
|
1074
|
+
* @param allowRound 四舍五入, 默认 true
|
|
1075
|
+
* @param precision 小数位, 默认 2
|
|
1076
|
+
* @param precisionPad 小数位填充, 默认 true
|
|
1077
|
+
* @param multiply 小数位填充, 默认 1
|
|
1078
|
+
*/
|
|
1079
|
+
export declare function numberFormatter<T = unknown>(value: T, options?: {
|
|
1080
|
+
allowDecimal?: boolean;
|
|
1081
|
+
thousandth?: boolean;
|
|
1082
|
+
percent?: boolean;
|
|
1083
|
+
allowRound?: boolean;
|
|
1084
|
+
precision?: number;
|
|
1085
|
+
precisionPad?: boolean;
|
|
1086
|
+
multiply?: number;
|
|
1087
|
+
}): string;
|
|
1031
1088
|
|
|
1032
|
-
|
|
1089
|
+
/**
|
|
1090
|
+
* 保留指定位数的小数
|
|
1091
|
+
* @param value 原始数字
|
|
1092
|
+
* @param decimals 要保留的小数位数(默认为 2)
|
|
1093
|
+
* @param mode 保留模式:'round' 表示四舍五入,'trunc' 表示直接截取(默认为 'round')
|
|
1094
|
+
*/
|
|
1095
|
+
export declare function numberKeepDecimal(input: any, decimals?: number, opts?: {
|
|
1096
|
+
mode?: 'round' | 'trunc';
|
|
1097
|
+
fallback?: number;
|
|
1098
|
+
}): number;
|
|
1033
1099
|
|
|
1034
|
-
export declare function
|
|
1100
|
+
export declare function numberRandom(min: number, max: number): number;
|
|
1035
1101
|
|
|
1036
|
-
|
|
1037
|
-
* 将一个数字转换为整数
|
|
1038
|
-
* - 支持四种方法:
|
|
1039
|
-
* - "round"(默认,四舍五入)
|
|
1040
|
-
* - "floor"(向下取整)
|
|
1041
|
-
* - "ceil"(向上取整)
|
|
1042
|
-
* - "trunc"(直接去掉小数部分,取整)
|
|
1043
|
-
* @param value 输入的数字
|
|
1044
|
-
* @param method 转换方法
|
|
1045
|
-
* @param opts.fallback 失败默认值
|
|
1046
|
-
* @returns 整数
|
|
1047
|
-
*/
|
|
1048
|
-
export declare function numberToInt(input: any, method?: 'floor' | 'ceil' | 'round' | 'trunc', opts?: {
|
|
1049
|
-
fallback: number;
|
|
1050
|
-
}): number;
|
|
1102
|
+
export declare function numberRound(value: any, precision: number): number;
|
|
1051
1103
|
|
|
1052
|
-
|
|
1104
|
+
/**
|
|
1105
|
+
* 将一个数字转换为整数
|
|
1106
|
+
* - 支持四种方法:
|
|
1107
|
+
* - "round"(默认,四舍五入)
|
|
1108
|
+
* - "floor"(向下取整)
|
|
1109
|
+
* - "ceil"(向上取整)
|
|
1110
|
+
* - "trunc"(直接去掉小数部分,取整)
|
|
1111
|
+
* @param value 输入的数字
|
|
1112
|
+
* @param method 转换方法
|
|
1113
|
+
* @param opts.fallback 失败默认值
|
|
1114
|
+
* @returns 整数
|
|
1115
|
+
*/
|
|
1116
|
+
export declare function numberToInt(input: any, method?: 'floor' | 'ceil' | 'round' | 'trunc', opts?: {
|
|
1117
|
+
fallback: number;
|
|
1118
|
+
}): number;
|
|
1053
1119
|
|
|
1054
|
-
export declare function
|
|
1120
|
+
export declare function objectArrayExpressionCalcInject(arr: Record<string, any>[], injects: Record<string, string>): Record<string, any>[];
|
|
1055
1121
|
|
|
1056
|
-
export declare function
|
|
1122
|
+
export declare function objectArrayFieldMax<T extends Record<string, any>, K extends keyof T>(arr: T[], field: K, defaultValue?: T[K]): number;
|
|
1057
1123
|
|
|
1058
|
-
export declare function
|
|
1124
|
+
export declare function objectArrayFieldMin<T extends Record<string, any>, K extends keyof T>(arr: T[], field: K, defaultValue?: T[K]): number;
|
|
1059
1125
|
|
|
1060
|
-
export declare function
|
|
1126
|
+
export declare function objectArrayFieldsMax<T extends Record<string, any>, K extends keyof T>(arr: T[], fields: K[], defaultValue?: T[K]): number;
|
|
1061
1127
|
|
|
1062
|
-
export declare function
|
|
1128
|
+
export declare function objectArrayFieldsMin<T extends Record<string, any>, K extends keyof T>(arr: T[], fields: K[], defaultValue?: T[K]): number;
|
|
1063
1129
|
|
|
1064
|
-
export declare function
|
|
1130
|
+
export declare function objectArrayMerge<T extends Record<string, any>>(arr: T[], classNames: string[], mergeCallback?: (mergeRecord: T, item: T) => T): T[];
|
|
1065
1131
|
|
|
1066
|
-
export declare function
|
|
1132
|
+
export declare function objectArrayPick(arr: Record<string, any>[], pick: string): any[];
|
|
1067
1133
|
|
|
1068
|
-
export declare function
|
|
1134
|
+
export declare function objectArrayResetFields<T extends Record<string, any>>(arr: T[], resetFields: Record<string, any>): T[];
|
|
1069
1135
|
|
|
1070
|
-
export declare function
|
|
1136
|
+
export declare function objectArraySyncFields(arr: Record<string, any>[], fields: Record<string, string>): Record<string, any>[];
|
|
1071
1137
|
|
|
1072
|
-
export declare function
|
|
1073
|
-
compareFields?: string[];
|
|
1074
|
-
}): boolean;
|
|
1138
|
+
export declare function objectAssign<T>(obj: T, assign: Record<string, any>): T;
|
|
1075
1139
|
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
* @param fields 默认Object.keys获取到的字段
|
|
1080
|
-
* @param callback 默认isEmpty
|
|
1081
|
-
* @return boolean
|
|
1082
|
-
*/
|
|
1083
|
-
export declare function objectFieldsEvery(obj: any, validateFunc: (fieldValue: any) => boolean, fields?: string[], defaultValue?: boolean): boolean;
|
|
1140
|
+
export declare function objectEqual(obj: any, obj1: any, opts?: {
|
|
1141
|
+
compareFields?: string[];
|
|
1142
|
+
}): boolean;
|
|
1084
1143
|
|
|
1085
|
-
|
|
1144
|
+
/**
|
|
1145
|
+
* 对象字段校验
|
|
1146
|
+
* @param obj 检测对象
|
|
1147
|
+
* @param fields 默认Object.keys获取到的字段
|
|
1148
|
+
* @param callback 默认isEmpty
|
|
1149
|
+
* @return boolean
|
|
1150
|
+
*/
|
|
1151
|
+
export declare function objectFieldsEvery(obj: any, validateFunc: (fieldValue: any) => boolean, fields?: string[], defaultValue?: boolean): boolean;
|
|
1086
1152
|
|
|
1087
|
-
export declare function
|
|
1153
|
+
export declare function objectFieldsSetNull(o: any, fields: string[]): Record<string, any>;
|
|
1088
1154
|
|
|
1089
|
-
|
|
1090
|
-
* 对象字段校验
|
|
1091
|
-
* @param obj 检测对象
|
|
1092
|
-
* @param fields 默认Object.keys获取到的字段
|
|
1093
|
-
* @param callback 默认isNotEmpty
|
|
1094
|
-
* @return boolean
|
|
1095
|
-
*/
|
|
1096
|
-
export declare function objectFieldsValidate(obj: any, fields?: string[] | null, validateFunc?: (fieldValue: any) => boolean): boolean;
|
|
1155
|
+
export declare function objectFieldsSetUndefined(o: any, fields: string[]): Record<string, any>;
|
|
1097
1156
|
|
|
1098
|
-
|
|
1157
|
+
/**
|
|
1158
|
+
* 对象字段校验
|
|
1159
|
+
* @param obj 检测对象
|
|
1160
|
+
* @param fields 默认Object.keys获取到的字段
|
|
1161
|
+
* @param callback 默认isNotEmpty
|
|
1162
|
+
* @return boolean
|
|
1163
|
+
*/
|
|
1164
|
+
export declare function objectFieldsValidate(obj: any, fields?: string[] | null, validateFunc?: (fieldValue: any) => boolean): boolean;
|
|
1099
1165
|
|
|
1100
|
-
export declare function
|
|
1166
|
+
export declare function objectFieldsValidatePaths(record: Record<string, any>, paths: string[], check?: (val: any) => boolean): (readonly [string, boolean])[];
|
|
1101
1167
|
|
|
1102
|
-
export declare function
|
|
1168
|
+
export declare function objectFieldsValidateVoidPaths(record: Record<string, any>, paths: string[]): string[];
|
|
1103
1169
|
|
|
1104
|
-
export declare function
|
|
1170
|
+
export declare function objectForEach<T extends Record<string, any>>(obj: T, callback: (key: string, value: any, obj: T) => void): void;
|
|
1105
1171
|
|
|
1106
|
-
export declare function
|
|
1172
|
+
export declare function objectGet(value: unknown, path?: string, defaultValue?: any): any;
|
|
1107
1173
|
|
|
1108
|
-
export declare function
|
|
1174
|
+
export declare function objectHas(obj: unknown, fields: string | string[]): boolean;
|
|
1109
1175
|
|
|
1110
|
-
export declare function
|
|
1111
|
-
excludeKeys?: string[];
|
|
1112
|
-
includeKeys?: string[];
|
|
1113
|
-
}, keyMap?: (key: string) => string): any[];
|
|
1176
|
+
export declare function objectHasKey<T, K extends PropertyKey>(obj: T, key: K): key is K & keyof T;
|
|
1114
1177
|
|
|
1115
|
-
export declare function
|
|
1178
|
+
export declare function objectKeys(obj: any, opts?: {
|
|
1179
|
+
excludeKeys?: string[];
|
|
1180
|
+
includeKeys?: string[];
|
|
1181
|
+
}, keyMap?: (key: string) => string): any[];
|
|
1116
1182
|
|
|
1117
|
-
export declare function
|
|
1183
|
+
export declare function objectOmit<O extends Record<string, any>>(input: O, check: any[] | ((value: any) => boolean)): Record<string, any>;
|
|
1118
1184
|
|
|
1119
|
-
export declare function
|
|
1185
|
+
export declare function objectOmitFields<O extends object, F extends keyof O>(input: O, fields: F[]): Omit<O, F>;
|
|
1120
1186
|
|
|
1121
|
-
export declare function
|
|
1187
|
+
export declare function objectPathsJoin(record: Record<string, any>, paths: string[], joinSymbol?: string): string;
|
|
1122
1188
|
|
|
1123
|
-
export declare function
|
|
1189
|
+
export declare function objectPick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
1124
1190
|
|
|
1125
|
-
export declare function
|
|
1191
|
+
export declare function objectRemoveFields(o: any, fields: string[]): Record<string, any>;
|
|
1126
1192
|
|
|
1127
|
-
export declare function
|
|
1193
|
+
export declare function objectRemoveNullishFields<T extends Record<string, any>>(obj: T): Partial<T>;
|
|
1128
1194
|
|
|
1129
|
-
export declare function
|
|
1195
|
+
export declare function objectSet<T extends Record<string, any>>(obj: T, path: string, val: unknown): void;
|
|
1130
1196
|
|
|
1131
|
-
export declare function
|
|
1197
|
+
export declare function objectShallowGet(obj: any, field: string): any;
|
|
1132
1198
|
|
|
1133
|
-
|
|
1134
|
-
* 对象字段校验
|
|
1135
|
-
* @param obj 检测对象
|
|
1136
|
-
* @param fields 默认Object.keys获取到的字段
|
|
1137
|
-
* @param callback 默认isEmpty
|
|
1138
|
-
* @return boolean
|
|
1139
|
-
*/
|
|
1140
|
-
export declare function objectSome(obj: any, validateFunc: (fieldValue: any) => boolean, fields?: string[] | null, defaultValue?: boolean): boolean;
|
|
1199
|
+
export declare function objectShallowMap(obj: Record<any, any>, keyFn: (key: any, value: any, obj: Record<any, any>) => string, valueFn: (value: any, key: any, obj: Record<any, any>) => any): Record<any, any>;
|
|
1141
1200
|
|
|
1142
|
-
|
|
1201
|
+
/**
|
|
1202
|
+
* 对象字段校验
|
|
1203
|
+
* @param obj 检测对象
|
|
1204
|
+
* @param fields 默认Object.keys获取到的字段
|
|
1205
|
+
* @param callback 默认isEmpty
|
|
1206
|
+
* @return boolean
|
|
1207
|
+
*/
|
|
1208
|
+
export declare function objectSome(obj: any, validateFunc: (fieldValue: any) => boolean, fields?: string[] | null, defaultValue?: boolean): boolean;
|
|
1143
1209
|
|
|
1144
|
-
export declare function
|
|
1210
|
+
export declare function objectSomeFields(input: any, fields: string[], func: (fieldValue: any, field: string) => boolean): boolean;
|
|
1145
1211
|
|
|
1146
|
-
export declare function
|
|
1212
|
+
export declare function objectStringify(obj: Record<string, any>, allowDots?: boolean): string;
|
|
1147
1213
|
|
|
1148
|
-
export declare function
|
|
1214
|
+
export declare function objectToArray<T extends Record<string, any>>(obj: Record<string, any>, callback: (key: string, value: any) => T): T[];
|
|
1149
1215
|
|
|
1150
|
-
|
|
1151
|
-
* 对象转url参数
|
|
1152
|
-
* @param {*} data
|
|
1153
|
-
* @param {*} isPrefix
|
|
1154
|
-
*/
|
|
1155
|
-
export declare function objToUrl(data: any, isPrefix?: boolean): string;
|
|
1216
|
+
export declare function objectValueMap<T extends Record<string, any>, R>(input: T, valueGetter: (value: T[keyof T], key: keyof T, input: T) => R): Record<keyof T, R>;
|
|
1156
1217
|
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
}
|
|
1218
|
+
/**
|
|
1219
|
+
* 对象转url参数
|
|
1220
|
+
* @param {*} data
|
|
1221
|
+
* @param {*} isPrefix
|
|
1222
|
+
*/
|
|
1223
|
+
export declare function objToUrl(data: any, isPrefix?: boolean): string;
|
|
1161
1224
|
|
|
1162
|
-
export declare function
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
}): string;
|
|
1225
|
+
export declare function parseURL(path: string): {
|
|
1226
|
+
pathname: string;
|
|
1227
|
+
params: Record<string, string>;
|
|
1228
|
+
};
|
|
1167
1229
|
|
|
1168
|
-
export declare function
|
|
1230
|
+
export declare function percentFormatter(input: any, opts?: {
|
|
1231
|
+
positiveSymbol?: boolean;
|
|
1232
|
+
precision?: number | ((value: number) => number);
|
|
1233
|
+
maxValue?: number;
|
|
1234
|
+
}): string;
|
|
1169
1235
|
|
|
1170
|
-
export declare function
|
|
1236
|
+
export declare function pickObjectArrayField<T extends Record<string, any>, K extends keyof T>(arr: T[], field: K, defaultValue?: T[K]): T[K][];
|
|
1171
1237
|
|
|
1172
|
-
export declare function
|
|
1238
|
+
export declare function pickObjectArrayFields<T extends Record<string, any>, K extends keyof T>(arr: T[], fields: K[], defaultValue?: T[K]): T[K][];
|
|
1173
1239
|
|
|
1174
|
-
export declare function pipe<A extends unknown[], B
|
|
1240
|
+
export declare function pipe<A extends unknown[], B>(ab: (this: void, ...a: A) => B): (...args: A) => B;
|
|
1175
1241
|
|
|
1176
|
-
export declare function pipe<A extends unknown[], B, C
|
|
1242
|
+
export declare function pipe<A extends unknown[], B, C>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C): (...args: A) => C;
|
|
1177
1243
|
|
|
1178
|
-
export declare function pipe<A extends unknown[], B, C, D
|
|
1244
|
+
export declare function pipe<A extends unknown[], B, C, D>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D): (...args: A) => D;
|
|
1179
1245
|
|
|
1180
|
-
export declare function pipe<A extends unknown[], B, C, D, E
|
|
1246
|
+
export declare function pipe<A extends unknown[], B, C, D, E>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E): (...args: A) => E;
|
|
1181
1247
|
|
|
1182
|
-
export declare function pipe<A extends unknown[], B, C, D, E, F
|
|
1248
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F): (...args: A) => F;
|
|
1183
1249
|
|
|
1184
|
-
export declare function pipe<A extends unknown[], B, C, D, E, F, G
|
|
1250
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F, G>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G): (...args: A) => G;
|
|
1185
1251
|
|
|
1186
|
-
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H
|
|
1252
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H): (...args: A) => H;
|
|
1187
1253
|
|
|
1188
|
-
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H, I
|
|
1254
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H, I>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I): (...args: A) => I;
|
|
1189
1255
|
|
|
1190
|
-
export declare function
|
|
1256
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H, I, J>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I, ij: (this: void, i: I) => J): (...args: A) => J;
|
|
1191
1257
|
|
|
1192
|
-
export declare function pipeWith<A, B
|
|
1258
|
+
export declare function pipeWith<A, B>(a: A, ab: (this: void, a: A) => B): B;
|
|
1193
1259
|
|
|
1194
|
-
export declare function pipeWith<A, B, C
|
|
1260
|
+
export declare function pipeWith<A, B, C>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C): C;
|
|
1195
1261
|
|
|
1196
|
-
export declare function pipeWith<A, B, C, D
|
|
1262
|
+
export declare function pipeWith<A, B, C, D>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D): D;
|
|
1197
1263
|
|
|
1198
|
-
export declare function pipeWith<A, B, C, D, E
|
|
1264
|
+
export declare function pipeWith<A, B, C, D, E>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E): E;
|
|
1199
1265
|
|
|
1200
|
-
export declare function pipeWith<A, B, C, D, E, F
|
|
1266
|
+
export declare function pipeWith<A, B, C, D, E, F>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F): F;
|
|
1201
1267
|
|
|
1202
|
-
export declare function pipeWith<A, B, C, D, E, F, G
|
|
1268
|
+
export declare function pipeWith<A, B, C, D, E, F, G>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G): G;
|
|
1203
1269
|
|
|
1204
|
-
export declare function pipeWith<A, B, C, D, E, F, G, H
|
|
1270
|
+
export declare function pipeWith<A, B, C, D, E, F, G, H>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H): H;
|
|
1205
1271
|
|
|
1206
|
-
export declare function pipeWith<A, B, C, D, E, F, G, H, I
|
|
1272
|
+
export declare function pipeWith<A, B, C, D, E, F, G, H, I>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I): I;
|
|
1207
1273
|
|
|
1208
|
-
declare
|
|
1209
|
-
x: number;
|
|
1210
|
-
y: number;
|
|
1211
|
-
}
|
|
1274
|
+
export declare function pipeWith<A, B, C, D, E, F, G, H, I, J>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I, ij: (this: void, i: I) => J): J;
|
|
1212
1275
|
|
|
1213
|
-
declare
|
|
1214
|
-
|
|
1215
|
-
|
|
1276
|
+
declare interface Point {
|
|
1277
|
+
x: number;
|
|
1278
|
+
y: number;
|
|
1279
|
+
}
|
|
1216
1280
|
|
|
1217
|
-
declare type
|
|
1218
|
-
|
|
1219
|
-
};
|
|
1281
|
+
declare type Point_2<X extends string, Y extends string> = {
|
|
1282
|
+
[K in X | Y]: number;
|
|
1283
|
+
};
|
|
1220
1284
|
|
|
1221
|
-
declare type
|
|
1222
|
-
|
|
1223
|
-
};
|
|
1285
|
+
declare type Point_3<X extends string, Y extends string> = {
|
|
1286
|
+
[K in X | Y]: number;
|
|
1287
|
+
};
|
|
1224
1288
|
|
|
1225
|
-
|
|
1289
|
+
declare type Point_4<X extends string, Y extends string> = {
|
|
1290
|
+
[K in X | Y]: number;
|
|
1291
|
+
};
|
|
1226
1292
|
|
|
1227
|
-
export declare
|
|
1228
|
-
stringify: typeof stringify;
|
|
1229
|
-
};
|
|
1293
|
+
export declare function promiseQueue(arr: Promise<any>[]): Promise<any[]>;
|
|
1230
1294
|
|
|
1231
|
-
export declare
|
|
1295
|
+
export declare const qs: {
|
|
1296
|
+
stringify: typeof stringify;
|
|
1297
|
+
};
|
|
1232
1298
|
|
|
1233
|
-
export declare function
|
|
1299
|
+
export declare function queryStructure(mapping: Mapping_2): MappingReuslt;
|
|
1234
1300
|
|
|
1235
|
-
export declare function
|
|
1301
|
+
export declare function rangeDateFormatter<T = unknown>(value: T): string;
|
|
1236
1302
|
|
|
1237
|
-
|
|
1238
|
-
export declare function rangeYearFormatter<T = unknown>(value: T): string;
|
|
1303
|
+
export declare function rangeMonthFormatter<T = unknown>(value: T): string;
|
|
1239
1304
|
|
|
1240
|
-
|
|
1305
|
+
/** TODO: 值类型检测需更完善一点 */
|
|
1306
|
+
export declare function rangeYearFormatter<T = unknown>(value: T): string;
|
|
1241
1307
|
|
|
1242
|
-
export declare function
|
|
1308
|
+
export declare function readBlobAsBuffer(bolb: Blob): Promise<ArrayBuffer>;
|
|
1243
1309
|
|
|
1244
|
-
export declare function
|
|
1310
|
+
export declare function readFileAsArrayBuffer(file: File): Promise<ArrayBuffer>;
|
|
1245
1311
|
|
|
1246
|
-
declare function
|
|
1247
|
-
file: File;
|
|
1248
|
-
fallbackResult?: T;
|
|
1249
|
-
}): Promise<T>;
|
|
1312
|
+
export declare function readFileAsBuffer(file: File): Promise<ArrayBuffer>;
|
|
1250
1313
|
|
|
1251
|
-
|
|
1314
|
+
declare function readJsonFile<T = any>({ file, fallbackResult }: {
|
|
1315
|
+
file: File;
|
|
1316
|
+
fallbackResult?: T;
|
|
1317
|
+
}): Promise<T>;
|
|
1252
1318
|
|
|
1253
|
-
|
|
1319
|
+
export declare function readURLAsBuffer(url: string): Promise<ArrayBuffer>;
|
|
1254
1320
|
|
|
1255
|
-
|
|
1321
|
+
declare type Reducer<T, A> = (state: T, action: A) => T;
|
|
1256
1322
|
|
|
1257
|
-
export declare function
|
|
1323
|
+
export declare function returnNotVoid<X, Y>(param1: X, param2: Y | (() => Y)): X | Y;
|
|
1258
1324
|
|
|
1259
|
-
export declare
|
|
1260
|
-
a?: number;
|
|
1261
|
-
b: number;
|
|
1262
|
-
g: number;
|
|
1263
|
-
r: number;
|
|
1264
|
-
}
|
|
1325
|
+
export declare function rgba2obj(rgba?: string): RGBColor;
|
|
1265
1326
|
|
|
1266
|
-
export declare
|
|
1327
|
+
export declare interface RGBColor {
|
|
1328
|
+
a?: number;
|
|
1329
|
+
b: number;
|
|
1330
|
+
g: number;
|
|
1331
|
+
r: number;
|
|
1332
|
+
}
|
|
1267
1333
|
|
|
1268
|
-
export declare function
|
|
1334
|
+
export declare function runPromiseQueue(promises: Promise<any>[]): Promise<any[]>;
|
|
1269
1335
|
|
|
1270
|
-
export declare function
|
|
1336
|
+
export declare function runQueuePromise(promises: (() => Promise<any>)[]): Promise<any[]>;
|
|
1271
1337
|
|
|
1272
|
-
export declare function
|
|
1338
|
+
export declare function safeArray(arr: any): any[];
|
|
1273
1339
|
|
|
1274
|
-
export declare function
|
|
1340
|
+
export declare function safeArrayJoin(arr: any, seperator?: string): string;
|
|
1275
1341
|
|
|
1276
|
-
|
|
1277
|
-
* 安全获取
|
|
1278
|
-
*/
|
|
1279
|
-
export declare function safeGet<T = any>(prop: any, ...opts: any): T;
|
|
1342
|
+
export declare function safeDateGetYear(date: Date): number;
|
|
1280
1343
|
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1344
|
+
/**
|
|
1345
|
+
* 安全获取
|
|
1346
|
+
*/
|
|
1347
|
+
export declare function safeGet<T = any>(prop: any, ...opts: any): T;
|
|
1285
1348
|
|
|
1286
|
-
export declare
|
|
1349
|
+
export declare function selectFile({ accept, multiple }: {
|
|
1350
|
+
accept?: string;
|
|
1351
|
+
multiple?: 'multiple';
|
|
1352
|
+
}): Promise<File[]>;
|
|
1287
1353
|
|
|
1288
|
-
export declare const
|
|
1354
|
+
export declare const setConfigStore: (nextStore: ConfigStore) => void;
|
|
1289
1355
|
|
|
1290
|
-
export declare
|
|
1356
|
+
export declare const setConfigStoreAtKey: <V>(key: string, value: V) => void;
|
|
1291
1357
|
|
|
1292
|
-
export declare function
|
|
1358
|
+
export declare function setDOMStyle(element: any, styles: Record<string, any>): void;
|
|
1293
1359
|
|
|
1294
|
-
export declare function
|
|
1295
|
-
dispatchEvent: boolean | 'bubbles';
|
|
1296
|
-
}): Promise<T>;
|
|
1360
|
+
export declare function setDOMStylePropertys(element: any, propertys: Record<string, any>): void;
|
|
1297
1361
|
|
|
1298
|
-
export declare function
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
itemField: string;
|
|
1302
|
-
itemShare?: (item: any, percentageAmount: number) => number;
|
|
1303
|
-
}): Record<string, any>[];
|
|
1362
|
+
export declare function setHtmlInputValue<T = any>(el: T, value: any, opts?: {
|
|
1363
|
+
dispatchEvent: boolean | 'bubbles';
|
|
1364
|
+
}): Promise<T>;
|
|
1304
1365
|
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1366
|
+
export declare function shareAmount(totalAmount: any, target: {
|
|
1367
|
+
items: Record<string, any>[];
|
|
1368
|
+
itemPercentage: (row: any) => number;
|
|
1369
|
+
itemField: string;
|
|
1370
|
+
itemShare?: (item: any, percentageAmount: number) => number;
|
|
1371
|
+
}): Record<string, any>[];
|
|
1309
1372
|
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1373
|
+
/**
|
|
1374
|
+
* 比较函数,支持字符串、数字、数组、[null, undefined]
|
|
1375
|
+
*/
|
|
1376
|
+
export declare function smartCompare(x: any, y: any, order?: 'asc' | 'desc' | 'none' | undefined | null): number;
|
|
1314
1377
|
|
|
1315
|
-
declare interface
|
|
1316
|
-
|
|
1317
|
-
|
|
1378
|
+
declare interface SortCondition<T> {
|
|
1379
|
+
condition: (item: T) => any;
|
|
1380
|
+
order: 'asc' | 'desc';
|
|
1381
|
+
}
|
|
1318
1382
|
|
|
1319
|
-
declare interface
|
|
1320
|
-
|
|
1321
|
-
}
|
|
1383
|
+
declare interface SpecialEvent {
|
|
1384
|
+
type: 'focus';
|
|
1385
|
+
}
|
|
1322
1386
|
|
|
1323
|
-
|
|
1387
|
+
declare interface SpecialEvent_2 {
|
|
1388
|
+
type: 'focus';
|
|
1389
|
+
}
|
|
1324
1390
|
|
|
1325
|
-
declare
|
|
1326
|
-
getState: () => T;
|
|
1327
|
-
dispatch: (action: A) => void;
|
|
1328
|
-
subscribe: (listener: () => void) => () => void;
|
|
1329
|
-
}
|
|
1391
|
+
export declare function stopDOMEvent(event: any): void;
|
|
1330
1392
|
|
|
1331
|
-
declare
|
|
1393
|
+
declare interface StoreResult<T, A> {
|
|
1394
|
+
getState: () => T;
|
|
1395
|
+
dispatch: (action: A) => void;
|
|
1396
|
+
subscribe: (listener: () => void) => () => void;
|
|
1397
|
+
}
|
|
1332
1398
|
|
|
1333
|
-
|
|
1399
|
+
declare function stringify(obj: any, unsafePrefix?: string): string;
|
|
1334
1400
|
|
|
1335
|
-
export declare function
|
|
1401
|
+
export declare function stringInsert(value: any, strIndex: number, insert: any): string;
|
|
1336
1402
|
|
|
1337
|
-
export declare function
|
|
1338
|
-
matchStr: string;
|
|
1339
|
-
matchStrIndex: number;
|
|
1340
|
-
matchCount: number;
|
|
1341
|
-
matchTotal: number;
|
|
1342
|
-
}) => boolean): string;
|
|
1403
|
+
export declare function stringJoin(value: any, interval: number, joinStr: string): string;
|
|
1343
1404
|
|
|
1344
|
-
export declare function
|
|
1405
|
+
export declare function stringReplaceAll(value: string, regOrStr: string | RegExp, replaceStr: string, apply?: (opts: {
|
|
1406
|
+
matchStr: string;
|
|
1407
|
+
matchStrIndex: number;
|
|
1408
|
+
matchCount: number;
|
|
1409
|
+
matchTotal: number;
|
|
1410
|
+
}) => boolean): string;
|
|
1345
1411
|
|
|
1346
|
-
export declare function
|
|
1412
|
+
export declare function stringSplit(str: any, seperator: string): string[];
|
|
1347
1413
|
|
|
1348
|
-
|
|
1349
|
-
* 字符串内字符个数统计
|
|
1350
|
-
* @param str
|
|
1351
|
-
* @param char
|
|
1352
|
-
* @returns
|
|
1353
|
-
*/
|
|
1354
|
-
export declare function stringWordCount(str: string, word: string): number;
|
|
1414
|
+
export declare function stringToKebabCase(str: string): string;
|
|
1355
1415
|
|
|
1356
|
-
|
|
1416
|
+
/**
|
|
1417
|
+
* 字符串内字符个数统计
|
|
1418
|
+
* @param str
|
|
1419
|
+
* @param char
|
|
1420
|
+
* @returns
|
|
1421
|
+
*/
|
|
1422
|
+
export declare function stringWordCount(str: string, word: string): number;
|
|
1357
1423
|
|
|
1358
|
-
export declare function
|
|
1359
|
-
replaceNaNItem?: number;
|
|
1360
|
-
replaceNaNResult?: number;
|
|
1361
|
-
}): number;
|
|
1424
|
+
export declare function substringSimilarity(a: string, b: string): 0 | 1;
|
|
1362
1425
|
|
|
1363
|
-
export declare function
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
}): number;
|
|
1426
|
+
export declare function subtract(arr: any[], options?: {
|
|
1427
|
+
replaceNaNItem?: number;
|
|
1428
|
+
replaceNaNResult?: number;
|
|
1429
|
+
}): number;
|
|
1367
1430
|
|
|
1368
|
-
export declare function
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
}): number;
|
|
1431
|
+
export declare function sum<T>(arr: T[], opts?: {
|
|
1432
|
+
replaceNaNItem?: number;
|
|
1433
|
+
replaceNaNResult?: number;
|
|
1434
|
+
}): number;
|
|
1372
1435
|
|
|
1373
|
-
export declare function
|
|
1436
|
+
export declare function sumBy<T>(arr: T[], getter: string | ((item: T) => number), opts?: {
|
|
1437
|
+
replaceNaNItem?: number;
|
|
1438
|
+
replaceNaNResult?: number;
|
|
1439
|
+
}): number;
|
|
1374
1440
|
|
|
1375
|
-
export declare function
|
|
1441
|
+
export declare function sumByFields<T extends Record<string, any>>(arr: T[], fields: string[]): number;
|
|
1376
1442
|
|
|
1377
|
-
export declare function
|
|
1443
|
+
export declare function SWITCH(key: any, map: ISwitchMap): any;
|
|
1378
1444
|
|
|
1379
|
-
export declare function
|
|
1445
|
+
export declare function switchCase(condition: any, cases: Record<any, any>): any;
|
|
1380
1446
|
|
|
1381
|
-
export declare function
|
|
1447
|
+
export declare function toArray<T>(input: T | T[] | undefined): T[];
|
|
1382
1448
|
|
|
1383
|
-
|
|
1384
|
-
*
|
|
1385
|
-
* @param input
|
|
1386
|
-
* @param format yyyy MM dd HH mm ss
|
|
1387
|
-
* @param fallbackValue
|
|
1388
|
-
* @returns
|
|
1389
|
-
*/
|
|
1390
|
-
export declare function toFormatDate<FV = Date>(input: any, format?: string, fallbackValue?: FV): Date | FV;
|
|
1449
|
+
export declare function toDate(value: any, fallback?: Date): Date;
|
|
1391
1450
|
|
|
1392
|
-
|
|
1451
|
+
/**
|
|
1452
|
+
*
|
|
1453
|
+
* @param input
|
|
1454
|
+
* @param format yyyy MM dd HH mm ss
|
|
1455
|
+
* @param fallbackValue
|
|
1456
|
+
* @returns
|
|
1457
|
+
*/
|
|
1458
|
+
export declare function toFormatDate<FV = Date>(input: any, format?: string, fallbackValue?: FV): Date | FV;
|
|
1393
1459
|
|
|
1394
|
-
export declare function
|
|
1395
|
-
nanReplace?: number;
|
|
1396
|
-
multiply?: number;
|
|
1397
|
-
}): number;
|
|
1460
|
+
export declare function toFormatUtcDate<FV = Date>(input: any, format?: string, fallbackValue?: FV): Date | FV;
|
|
1398
1461
|
|
|
1399
|
-
export declare function
|
|
1462
|
+
export declare function toNumber(value: any, opts?: {
|
|
1463
|
+
nanReplace?: number;
|
|
1464
|
+
multiply?: number;
|
|
1465
|
+
}): number;
|
|
1400
1466
|
|
|
1401
|
-
export declare function
|
|
1402
|
-
multiply?: number;
|
|
1403
|
-
}): number;
|
|
1467
|
+
export declare function toQueryValue<K extends keyof Mapping>(k: K, value: Nullable<Mapping[K]>): { [k in K]: Nullable<Mapping[k]>; } | undefined;
|
|
1404
1468
|
|
|
1405
|
-
export declare function
|
|
1469
|
+
export declare function toSafeNumber(value: any, options?: {
|
|
1470
|
+
multiply?: number;
|
|
1471
|
+
}): number;
|
|
1406
1472
|
|
|
1407
|
-
export declare function
|
|
1408
|
-
excludeKey?: (key: string) => boolean;
|
|
1409
|
-
}): T;
|
|
1473
|
+
export declare function toSafeString(val: unknown): string;
|
|
1410
1474
|
|
|
1411
|
-
declare function
|
|
1412
|
-
|
|
1475
|
+
export declare function toSimplifiedChinese<T>(input: T, opts?: {
|
|
1476
|
+
excludeKey?: (key: string) => boolean;
|
|
1477
|
+
}): T;
|
|
1413
1478
|
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
}): T;
|
|
1479
|
+
declare function toString_2(value: any): string;
|
|
1480
|
+
export { toString_2 as toString }
|
|
1417
1481
|
|
|
1418
|
-
export declare function
|
|
1482
|
+
export declare function toTraditionalChinese<T>(input: T, opts?: {
|
|
1483
|
+
excludeKey?: (key: string) => boolean;
|
|
1484
|
+
}): T;
|
|
1419
1485
|
|
|
1420
|
-
export declare function
|
|
1421
|
-
leafField: string;
|
|
1422
|
-
}): T[];
|
|
1486
|
+
export declare function transferNumberWithPx<T = unknown>(num: T): string | undefined;
|
|
1423
1487
|
|
|
1424
|
-
export declare function
|
|
1425
|
-
|
|
1426
|
-
}): T[];
|
|
1488
|
+
export declare function treeCollect<T extends Record<string, any>>(treeData: T[], type?: 'pre' | 'post' | 'leaf-only', opts?: {
|
|
1489
|
+
leafField: string;
|
|
1490
|
+
}): T[];
|
|
1427
1491
|
|
|
1428
|
-
export declare function
|
|
1429
|
-
|
|
1430
|
-
}):
|
|
1492
|
+
export declare function treeDelete<T extends Record<string, any>>(tree: T[], callback: (node: T, nodeIndexes: number[]) => boolean, opts?: {
|
|
1493
|
+
leafField: string;
|
|
1494
|
+
}): T[];
|
|
1431
1495
|
|
|
1432
|
-
export declare function
|
|
1496
|
+
export declare function treeDepth<T extends Record<string, any>>(nodes: T[], opts?: {
|
|
1497
|
+
leafField: string;
|
|
1498
|
+
}): number;
|
|
1433
1499
|
|
|
1434
|
-
export declare function
|
|
1435
|
-
flatSubNodes: T[];
|
|
1436
|
-
}) => boolean, opts?: {
|
|
1437
|
-
leafField: string;
|
|
1438
|
-
}): T[];
|
|
1500
|
+
export declare function treeExcludeNodes<T extends IAbstractTreeNode>(tree: IAbstractTreeNode[], compare: (node: IAbstractTreeNode) => boolean): T[];
|
|
1439
1501
|
|
|
1440
|
-
export declare function
|
|
1441
|
-
|
|
1442
|
-
}) => boolean, opts?: {
|
|
1443
|
-
|
|
1444
|
-
}): T
|
|
1502
|
+
export declare function treeFilter<T extends Record<string, any>>(treeData: T[], callback: (node: T, opts: {
|
|
1503
|
+
flatSubNodes: T[];
|
|
1504
|
+
}) => boolean, opts?: {
|
|
1505
|
+
leafField: string;
|
|
1506
|
+
}): T[];
|
|
1445
1507
|
|
|
1446
|
-
export declare function
|
|
1447
|
-
|
|
1448
|
-
})
|
|
1508
|
+
export declare function treeFind<T extends Record<string, any>>(nodes: T[], callback: (node: T, opts: {
|
|
1509
|
+
flatSubNodes: T[];
|
|
1510
|
+
}) => boolean, opts?: {
|
|
1511
|
+
leafField: string;
|
|
1512
|
+
}): T | null;
|
|
1449
1513
|
|
|
1450
|
-
export declare function
|
|
1451
|
-
|
|
1452
|
-
})
|
|
1453
|
-
leafField: string;
|
|
1454
|
-
}): void;
|
|
1514
|
+
export declare function treeFindNodePath<T extends Record<string, any>>(nodes: T[], callback: (node: T, nodeIndexList: number[]) => boolean, opts?: {
|
|
1515
|
+
leafField: string;
|
|
1516
|
+
}): number[];
|
|
1455
1517
|
|
|
1456
|
-
export declare function
|
|
1457
|
-
|
|
1458
|
-
})
|
|
1518
|
+
export declare function treeForeach<T extends Record<string, any>>(nodes: T[], callback: (node: T, opts: {
|
|
1519
|
+
flatSubNodes: T[];
|
|
1520
|
+
}) => void, opts?: {
|
|
1521
|
+
leafField: string;
|
|
1522
|
+
}): void;
|
|
1459
1523
|
|
|
1460
|
-
export declare function
|
|
1461
|
-
|
|
1462
|
-
}): any;
|
|
1524
|
+
export declare function treeMap<T extends Record<string, any>, R extends Record<string, any>>(nodes: T[], callback: (node: T, nodeIndexes: number[]) => R, opts?: {
|
|
1525
|
+
leafField: string;
|
|
1526
|
+
}): any;
|
|
1463
1527
|
|
|
1464
|
-
export declare function
|
|
1465
|
-
|
|
1466
|
-
}): any;
|
|
1528
|
+
export declare function treeNodeAddChilds<T extends Record<string, any>, R extends Record<string, any>>(nodes: T[], callback: (node: T, nodeIndexes: number[]) => R, childs: T[], opts?: {
|
|
1529
|
+
leafField: string;
|
|
1530
|
+
}): any;
|
|
1467
1531
|
|
|
1468
|
-
export declare function
|
|
1469
|
-
|
|
1470
|
-
}): any;
|
|
1532
|
+
export declare function treePathAddChildNodes<T extends Record<string, any>>(nodes: T[], targetPath: number[], childNodes: T[], opts?: {
|
|
1533
|
+
leafField: string;
|
|
1534
|
+
}): any;
|
|
1471
1535
|
|
|
1472
|
-
export declare function
|
|
1473
|
-
|
|
1474
|
-
}):
|
|
1536
|
+
export declare function treePathAppendNodes<T extends Record<string, any>>(tree: T[], targetPath: number[], appendNodes: T[], opts?: {
|
|
1537
|
+
leafField: string;
|
|
1538
|
+
}): any;
|
|
1475
1539
|
|
|
1476
|
-
export declare function
|
|
1477
|
-
|
|
1478
|
-
})
|
|
1479
|
-
leafField: string;
|
|
1480
|
-
}): T[];
|
|
1540
|
+
export declare function treePathDelete<T extends Record<string, any>>(tree: T[], targetPath: number[], opts?: {
|
|
1541
|
+
leafField: string;
|
|
1542
|
+
}): T[];
|
|
1481
1543
|
|
|
1482
|
-
export declare function
|
|
1544
|
+
export declare function treePick<T extends Record<string, any>>(nodes: T[], callback: (node: T, opts: {
|
|
1545
|
+
flatSubNodes: T[];
|
|
1546
|
+
}) => boolean, opts?: {
|
|
1547
|
+
leafField: string;
|
|
1548
|
+
}): T[];
|
|
1483
1549
|
|
|
1484
|
-
|
|
1485
|
-
* @param tree 树结构
|
|
1486
|
-
* @param childField 每个节点中子树的字段名
|
|
1487
|
-
* @returns 扁平数组
|
|
1488
|
-
*/
|
|
1489
|
-
export declare function treeToFlatArray(tree?: any[], childField?: string): any[];
|
|
1550
|
+
export declare function treeSort<T extends AbstractTreeNode>(treeData: T[], compare: (x: T, y: T) => number): T[];
|
|
1490
1551
|
|
|
1491
|
-
|
|
1552
|
+
/**
|
|
1553
|
+
* @param tree 树结构
|
|
1554
|
+
* @param childField 每个节点中子树的字段名
|
|
1555
|
+
* @returns 扁平数组
|
|
1556
|
+
*/
|
|
1557
|
+
export declare function treeToFlatArray(tree?: any[], childField?: string): any[];
|
|
1492
1558
|
|
|
1493
|
-
export declare function
|
|
1559
|
+
export declare function triggerDOMEvent(element: HTMLElement, eventName: 'mousemove'): void;
|
|
1494
1560
|
|
|
1495
|
-
export declare function
|
|
1496
|
-
encode?: boolean;
|
|
1497
|
-
delimiter?: string;
|
|
1498
|
-
}): string;
|
|
1561
|
+
export declare function uniqueBy<T extends object, K extends keyof T>(arr: T[], by: K): T[K][];
|
|
1499
1562
|
|
|
1500
|
-
export declare function
|
|
1563
|
+
export declare function urlStringify(obj: Record<string, any>, prefix?: string, options?: {
|
|
1564
|
+
encode?: boolean;
|
|
1565
|
+
delimiter?: string;
|
|
1566
|
+
}): string;
|
|
1501
1567
|
|
|
1502
|
-
|
|
1568
|
+
export declare function uuid(): string;
|
|
1503
1569
|
|
|
1504
|
-
declare type
|
|
1570
|
+
declare type ValueOrFn<T> = T | (() => T);
|
|
1505
1571
|
|
|
1506
|
-
declare type
|
|
1572
|
+
declare type ValueOrFn_2<T> = T | (() => T);
|
|
1507
1573
|
|
|
1508
|
-
declare type
|
|
1574
|
+
declare type VoidLike = null | undefined | '' | [];
|
|
1509
1575
|
|
|
1510
|
-
|
|
1511
|
-
elseWhen(condition: ValueOrFn_2<boolean>, result: ValueOrFn_2<V>): any;
|
|
1512
|
-
default(defaultResult: ValueOrFn_2<V>): V;
|
|
1513
|
-
};
|
|
1576
|
+
declare type VoidLike_2 = null | undefined | '' | [] | Record<string, never>;
|
|
1514
1577
|
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1578
|
+
export declare function when<V>(condition: ValueOrFn_2<boolean>, result: ValueOrFn_2<V>): {
|
|
1579
|
+
elseWhen(condition: ValueOrFn_2<boolean>, result: ValueOrFn_2<V>): any;
|
|
1580
|
+
default(defaultResult: ValueOrFn_2<V>): V;
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
/**
|
|
1584
|
+
* 字符串内字符个数统计
|
|
1585
|
+
* @param str
|
|
1586
|
+
* @param char
|
|
1587
|
+
* @returns
|
|
1588
|
+
*/
|
|
1589
|
+
export declare function wordCount(str: string, word: string): number;
|
|
1522
1590
|
|
|
1523
|
-
export declare function zipArrayObject(param: Record<string, any[]>): any[];
|
|
1591
|
+
export declare function zipArrayObject(param: Record<string, any[]>): any[];
|
|
1524
1592
|
|
|
1525
|
-
export { }
|
|
1593
|
+
export { }
|