jc-structure 0.1.21 → 0.1.22
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/index.d.ts +21 -12
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="./types/string.extensions.d.ts"/>
|
|
2
|
-
|
|
3
1
|
declare module "jc-structure" {
|
|
4
2
|
//#region data structure
|
|
5
3
|
/**
|
|
@@ -833,7 +831,7 @@ declare module "jc-structure" {
|
|
|
833
831
|
* @param start 开始索引
|
|
834
832
|
* @param end 结束索引
|
|
835
833
|
*/
|
|
836
|
-
sliceByPoint(start: number, end
|
|
834
|
+
sliceByPoint(start: number, end?: number): string;
|
|
837
835
|
/**
|
|
838
836
|
* #### 首字母大写
|
|
839
837
|
*/
|
|
@@ -847,7 +845,7 @@ declare module "jc-structure" {
|
|
|
847
845
|
* @param length 长度,包含‘...’
|
|
848
846
|
* @param suffix 后缀符号,默认‘...’
|
|
849
847
|
*/
|
|
850
|
-
truncate(length: number, suffix
|
|
848
|
+
truncate(length: number, suffix?: string): string;
|
|
851
849
|
/**
|
|
852
850
|
* #### 是否是回文字符串
|
|
853
851
|
*/
|
|
@@ -881,9 +879,9 @@ declare module "jc-structure" {
|
|
|
881
879
|
isValidBracket(str: string): boolean;
|
|
882
880
|
/**
|
|
883
881
|
* #### 根据长度获取随机字符串
|
|
884
|
-
* @param length
|
|
882
|
+
* @param length 长度 默认为:8
|
|
885
883
|
*/
|
|
886
|
-
random(length
|
|
884
|
+
random(length?: number): string;
|
|
887
885
|
/**
|
|
888
886
|
* #### 生成模板字符串
|
|
889
887
|
* @param template 模板字符串
|
|
@@ -926,6 +924,21 @@ declare module "jc-structure" {
|
|
|
926
924
|
}
|
|
927
925
|
declare var Reg: RegConstructor;
|
|
928
926
|
|
|
927
|
+
interface DateInfo {
|
|
928
|
+
year: number;
|
|
929
|
+
month: number;
|
|
930
|
+
day: number;
|
|
931
|
+
hour: number;
|
|
932
|
+
minute: number;
|
|
933
|
+
second: number;
|
|
934
|
+
millisecond: number;
|
|
935
|
+
yyyy?: string;
|
|
936
|
+
MM?: string;
|
|
937
|
+
dd?: string;
|
|
938
|
+
HH?: string;
|
|
939
|
+
mm?: string;
|
|
940
|
+
ss?: string;
|
|
941
|
+
}
|
|
929
942
|
interface FormatOptions {
|
|
930
943
|
/**
|
|
931
944
|
* #### 是否补零
|
|
@@ -949,11 +962,7 @@ declare module "jc-structure" {
|
|
|
949
962
|
* @param formatter 格式化器
|
|
950
963
|
* @param options
|
|
951
964
|
*/
|
|
952
|
-
format(
|
|
953
|
-
date: Date,
|
|
954
|
-
formatter: Formatter,
|
|
955
|
-
options: FormatOptions = {}
|
|
956
|
-
): string;
|
|
965
|
+
format(date: Date, formatter: Formatter, options?: FormatOptions): string;
|
|
957
966
|
}
|
|
958
967
|
declare var DateEx: DateExConstructor;
|
|
959
968
|
|
|
@@ -1046,7 +1055,7 @@ declare module "jc-structure" {
|
|
|
1046
1055
|
* @param visited
|
|
1047
1056
|
* @returns
|
|
1048
1057
|
*/
|
|
1049
|
-
deepClone(obj: unknown, visited
|
|
1058
|
+
deepClone(obj: unknown, visited?: WeakMap): unknown;
|
|
1050
1059
|
}
|
|
1051
1060
|
declare var Obj: ObjConstructor;
|
|
1052
1061
|
|