@uniai-fe/util-functions 0.2.8 → 0.2.10
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/README.md +27 -2
- package/dist/api/index.cjs +9 -0
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.mjs +5 -0
- package/dist/api/index.mjs.map +1 -1
- package/dist/convert/index.cjs +9 -0
- package/dist/convert/index.cjs.map +1 -1
- package/dist/convert/index.mjs +5 -0
- package/dist/convert/index.mjs.map +1 -1
- package/dist/date/index.cjs +9 -0
- package/dist/date/index.cjs.map +1 -1
- package/dist/date/index.mjs +5 -0
- package/dist/date/index.mjs.map +1 -1
- package/dist/format/index.cjs +21 -2
- package/dist/format/index.cjs.map +1 -1
- package/dist/format/index.d.cts +9 -1
- package/dist/format/index.d.ts +9 -1
- package/dist/format/index.mjs +17 -3
- package/dist/format/index.mjs.map +1 -1
- package/dist/index.cjs +21 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +17 -3
- package/dist/index.mjs.map +1 -1
- package/dist/style/size/index.d.cts +34 -7
- package/dist/style/size/index.d.ts +34 -7
- package/package.json +1 -1
|
@@ -1,10 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 스타일 옵션 타입; 스타일 속성 값
|
|
3
|
+
* - number | string
|
|
4
|
+
*/
|
|
1
5
|
type StyleSpacingPrimitive = number | string;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* 개수가 지정된 배열 정의
|
|
8
|
+
* @example
|
|
9
|
+
* type DataArray = FixedLengthArray<number | string, 3>;
|
|
10
|
+
*/
|
|
11
|
+
type FixedLengthArray<ItemType, Length extends number> = [
|
|
12
|
+
ItemType,
|
|
13
|
+
...ItemType[]
|
|
14
|
+
] & {
|
|
15
|
+
length: Length;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 스타일 옵션 타입; margin, padding을 배열로 받는 경우
|
|
19
|
+
* @desc
|
|
20
|
+
* - [상하좌우]: 일괄적용 처리
|
|
21
|
+
* - [상하, 좌우]: [top-bottom, left-right]
|
|
22
|
+
* - [상, 좌우, 하]: [top, left-right, bottom]
|
|
23
|
+
* - [상, 우, 하, 좌]: [top, right, bottom, left]
|
|
24
|
+
*/
|
|
25
|
+
type StyleSpacingArray = FixedLengthArray<number | string, 1 | 2 | 3 | 4>;
|
|
26
|
+
/**
|
|
27
|
+
* 스타일 옵션 타입; margin, padding
|
|
28
|
+
* @desc
|
|
29
|
+
* - number | string: 단일 값
|
|
30
|
+
* - [상하좌우]: 일괄적용 처리
|
|
31
|
+
* - [상하, 좌우]
|
|
32
|
+
* - [상, 좌우, 하]
|
|
33
|
+
* - [상, 우, 하, 좌]
|
|
34
|
+
*/
|
|
8
35
|
type StyleSpacingType = StyleSpacingPrimitive | StyleSpacingArray;
|
|
9
36
|
|
|
10
37
|
/**
|
|
@@ -84,4 +111,4 @@ declare const stylePaddingSize: (unit: "px" | "rem", spacing: StyleSpacingType |
|
|
|
84
111
|
*/
|
|
85
112
|
declare const styleMarginSize: (unit: "px" | "rem", spacing: StyleSpacingType | undefined, alt?: StyleSpacingType) => string;
|
|
86
113
|
|
|
87
|
-
export { type StyleSpacingArray, type StyleSpacingPrimitive, type StyleSpacingType, styleBaseSize, styleMarginSize, stylePaddingSize, styleRem, styleRemAmount, styleSpacingArray, styleSpacingSize };
|
|
114
|
+
export { type FixedLengthArray, type StyleSpacingArray, type StyleSpacingPrimitive, type StyleSpacingType, styleBaseSize, styleMarginSize, stylePaddingSize, styleRem, styleRemAmount, styleSpacingArray, styleSpacingSize };
|
|
@@ -1,10 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 스타일 옵션 타입; 스타일 속성 값
|
|
3
|
+
* - number | string
|
|
4
|
+
*/
|
|
1
5
|
type StyleSpacingPrimitive = number | string;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* 개수가 지정된 배열 정의
|
|
8
|
+
* @example
|
|
9
|
+
* type DataArray = FixedLengthArray<number | string, 3>;
|
|
10
|
+
*/
|
|
11
|
+
type FixedLengthArray<ItemType, Length extends number> = [
|
|
12
|
+
ItemType,
|
|
13
|
+
...ItemType[]
|
|
14
|
+
] & {
|
|
15
|
+
length: Length;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 스타일 옵션 타입; margin, padding을 배열로 받는 경우
|
|
19
|
+
* @desc
|
|
20
|
+
* - [상하좌우]: 일괄적용 처리
|
|
21
|
+
* - [상하, 좌우]: [top-bottom, left-right]
|
|
22
|
+
* - [상, 좌우, 하]: [top, left-right, bottom]
|
|
23
|
+
* - [상, 우, 하, 좌]: [top, right, bottom, left]
|
|
24
|
+
*/
|
|
25
|
+
type StyleSpacingArray = FixedLengthArray<number | string, 1 | 2 | 3 | 4>;
|
|
26
|
+
/**
|
|
27
|
+
* 스타일 옵션 타입; margin, padding
|
|
28
|
+
* @desc
|
|
29
|
+
* - number | string: 단일 값
|
|
30
|
+
* - [상하좌우]: 일괄적용 처리
|
|
31
|
+
* - [상하, 좌우]
|
|
32
|
+
* - [상, 좌우, 하]
|
|
33
|
+
* - [상, 우, 하, 좌]
|
|
34
|
+
*/
|
|
8
35
|
type StyleSpacingType = StyleSpacingPrimitive | StyleSpacingArray;
|
|
9
36
|
|
|
10
37
|
/**
|
|
@@ -84,4 +111,4 @@ declare const stylePaddingSize: (unit: "px" | "rem", spacing: StyleSpacingType |
|
|
|
84
111
|
*/
|
|
85
112
|
declare const styleMarginSize: (unit: "px" | "rem", spacing: StyleSpacingType | undefined, alt?: StyleSpacingType) => string;
|
|
86
113
|
|
|
87
|
-
export { type StyleSpacingArray, type StyleSpacingPrimitive, type StyleSpacingType, styleBaseSize, styleMarginSize, stylePaddingSize, styleRem, styleRemAmount, styleSpacingArray, styleSpacingSize };
|
|
114
|
+
export { type FixedLengthArray, type StyleSpacingArray, type StyleSpacingPrimitive, type StyleSpacingType, styleBaseSize, styleMarginSize, stylePaddingSize, styleRem, styleRemAmount, styleSpacingArray, styleSpacingSize };
|