jordy 0.12.0

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.
Files changed (128) hide show
  1. package/README.md +11 -0
  2. package/esm5/adaptive-render/AdaptiveRender.js +14 -0
  3. package/esm5/adaptive-render/DeviceDetectContext.js +62 -0
  4. package/esm5/adaptive-render/adaptive-render.type.js +1 -0
  5. package/esm5/adaptive-render/device.type.js +9 -0
  6. package/esm5/adaptive-render/index.js +4 -0
  7. package/esm5/adaptive-render/withAdaptiveRender.js +29 -0
  8. package/esm5/hooks/index.js +3 -0
  9. package/esm5/hooks/useDebounce.js +26 -0
  10. package/esm5/hooks/useQueryParams.js +20 -0
  11. package/esm5/hooks/useThrottle.js +18 -0
  12. package/esm5/http-api/httpApi.factory.js +143 -0
  13. package/esm5/http-api/httpHeader.factory.js +46 -0
  14. package/esm5/http-api/index.js +3 -0
  15. package/esm5/http-api/network.type.js +1 -0
  16. package/esm5/http-api/networkParser.js +73 -0
  17. package/esm5/index.js +11 -0
  18. package/esm5/proxies/cache.proxy.js +40 -0
  19. package/esm5/proxies/index.js +1 -0
  20. package/esm5/queries/buildMutationCreator.js +87 -0
  21. package/esm5/queries/buildQueryCreator.js +124 -0
  22. package/esm5/queries/index.js +2 -0
  23. package/esm5/queries/useMakeDeps.js +23 -0
  24. package/esm5/queries/utils/clearCacheByKeyword.js +50 -0
  25. package/esm5/queries/utils/createCacheKey.js +23 -0
  26. package/esm5/queries/utils/index.js +2 -0
  27. package/esm5/route-system/AsyncGuard.js +37 -0
  28. package/esm5/route-system/index.js +3 -0
  29. package/esm5/route-system/moduleRoute.model.js +1 -0
  30. package/esm5/route-system/renderRouteSystem.js +64 -0
  31. package/esm5/route-system/routeSystem.util.js +23 -0
  32. package/esm5/storage/CookieStorageAdapter.js +20 -0
  33. package/esm5/storage/ExpiableStorageAdapter.js +36 -0
  34. package/esm5/storage/MemorySimpleStorage.js +18 -0
  35. package/esm5/storage/SimpleStorageAdapter.js +18 -0
  36. package/esm5/storage/cookie.js +27 -0
  37. package/esm5/storage/index.js +4 -0
  38. package/esm5/storage/memoryStorage.js +35 -0
  39. package/esm5/storage/storage.factory.js +30 -0
  40. package/esm5/storage/storage.type.js +1 -0
  41. package/esm5/storage/token-provider.factory.js +23 -0
  42. package/esm5/types/component.type.js +1 -0
  43. package/esm5/types/index.js +2 -0
  44. package/esm5/types/marshalling.type.js +1 -0
  45. package/esm5/util/collection.js +17 -0
  46. package/esm5/util/envCheck.js +55 -0
  47. package/esm5/util/etc.js +12 -0
  48. package/esm5/util/filter.js +10 -0
  49. package/esm5/util/format.js +8 -0
  50. package/esm5/util/index.js +15 -0
  51. package/esm5/util/josa.js +57 -0
  52. package/esm5/util/json.js +19 -0
  53. package/esm5/util/libLoader.js +27 -0
  54. package/esm5/util/path.js +16 -0
  55. package/esm5/util/queryString.js +62 -0
  56. package/esm5/util/redux.js +6 -0
  57. package/esm5/util/template.js +65 -0
  58. package/esm5/util/typeCheck.js +33 -0
  59. package/esm5/validate/fn.js +66 -0
  60. package/esm5/validate/index.js +7 -0
  61. package/esm5/validate/mergeValidates.js +22 -0
  62. package/esm5/validate/validate.js +22 -0
  63. package/esm5/validate/validate.type.js +1 -0
  64. package/esm5/validate/validateSubUtils.js +67 -0
  65. package/libs/adaptive-render/AdaptiveRender.d.ts +25 -0
  66. package/libs/adaptive-render/DeviceDetectContext.d.ts +16 -0
  67. package/libs/adaptive-render/adaptive-render.type.d.ts +63 -0
  68. package/libs/adaptive-render/device.type.d.ts +14 -0
  69. package/libs/adaptive-render/index.d.ts +4 -0
  70. package/libs/adaptive-render/withAdaptiveRender.d.ts +35 -0
  71. package/libs/hooks/index.d.ts +3 -0
  72. package/libs/hooks/useDebounce.d.ts +29 -0
  73. package/libs/hooks/useQueryParams.d.ts +19 -0
  74. package/libs/hooks/useThrottle.d.ts +25 -0
  75. package/libs/http-api/httpApi.factory.d.ts +9 -0
  76. package/libs/http-api/httpHeader.factory.d.ts +15 -0
  77. package/libs/http-api/index.d.ts +3 -0
  78. package/libs/http-api/network.type.d.ts +109 -0
  79. package/libs/http-api/networkParser.d.ts +9 -0
  80. package/libs/index.d.ts +11 -0
  81. package/libs/proxies/cache.proxy.d.ts +11 -0
  82. package/libs/proxies/index.d.ts +1 -0
  83. package/libs/queries/buildMutationCreator.d.ts +37 -0
  84. package/libs/queries/buildQueryCreator.d.ts +115 -0
  85. package/libs/queries/index.d.ts +2 -0
  86. package/libs/queries/useMakeDeps.d.ts +1 -0
  87. package/libs/queries/utils/clearCacheByKeyword.d.ts +14 -0
  88. package/libs/queries/utils/createCacheKey.d.ts +1 -0
  89. package/libs/queries/utils/index.d.ts +2 -0
  90. package/libs/route-system/AsyncGuard.d.ts +8 -0
  91. package/libs/route-system/index.d.ts +3 -0
  92. package/libs/route-system/moduleRoute.model.d.ts +49 -0
  93. package/libs/route-system/renderRouteSystem.d.ts +5 -0
  94. package/libs/route-system/routeSystem.util.d.ts +4 -0
  95. package/libs/storage/CookieStorageAdapter.d.ts +11 -0
  96. package/libs/storage/ExpiableStorageAdapter.d.ts +11 -0
  97. package/libs/storage/MemorySimpleStorage.d.ts +10 -0
  98. package/libs/storage/SimpleStorageAdapter.d.ts +10 -0
  99. package/libs/storage/cookie.d.ts +2 -0
  100. package/libs/storage/index.d.ts +4 -0
  101. package/libs/storage/memoryStorage.d.ts +7 -0
  102. package/libs/storage/storage.factory.d.ts +31 -0
  103. package/libs/storage/storage.type.d.ts +96 -0
  104. package/libs/storage/token-provider.factory.d.ts +9 -0
  105. package/libs/types/component.type.d.ts +23 -0
  106. package/libs/types/index.d.ts +2 -0
  107. package/libs/types/marshalling.type.d.ts +5 -0
  108. package/libs/util/collection.d.ts +25 -0
  109. package/libs/util/envCheck.d.ts +56 -0
  110. package/libs/util/etc.d.ts +11 -0
  111. package/libs/util/filter.d.ts +2 -0
  112. package/libs/util/format.d.ts +6 -0
  113. package/libs/util/index.d.ts +15 -0
  114. package/libs/util/josa.d.ts +66 -0
  115. package/libs/util/json.d.ts +14 -0
  116. package/libs/util/libLoader.d.ts +1 -0
  117. package/libs/util/path.d.ts +20 -0
  118. package/libs/util/queryString.d.ts +35 -0
  119. package/libs/util/redux.d.ts +3 -0
  120. package/libs/util/template.d.ts +38 -0
  121. package/libs/util/typeCheck.d.ts +42 -0
  122. package/libs/validate/fn.d.ts +111 -0
  123. package/libs/validate/index.d.ts +58 -0
  124. package/libs/validate/mergeValidates.d.ts +21 -0
  125. package/libs/validate/validate.d.ts +2 -0
  126. package/libs/validate/validate.type.d.ts +84 -0
  127. package/libs/validate/validateSubUtils.d.ts +12 -0
  128. package/package.json +58 -0
@@ -0,0 +1,11 @@
1
+ import { MarshallingType } from '../types';
2
+ import { SimpleStorage, ExpiableStorageModel } from './storage.type';
3
+ export declare class ExpiableStorageAdapter<T extends MarshallingType> implements SimpleStorage<T> {
4
+ private storage;
5
+ expiredTime: number;
6
+ constructor(storage: SimpleStorage<ExpiableStorageModel<T>>, expiredTime?: number);
7
+ get key(): string;
8
+ get(): T | null;
9
+ set(value: T): void;
10
+ remove(): void;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { MarshallingType } from '../types';
2
+ import { SimpleStorage } from './storage.type';
3
+ export declare class MemorySimpleStorage<T extends MarshallingType> implements SimpleStorage<T> {
4
+ readonly key: string;
5
+ private storage;
6
+ constructor(key: string);
7
+ get(): T;
8
+ set(value: T): void;
9
+ remove(): void;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { MarshallingType } from '../types';
2
+ import { SimpleStorage } from './storage.type';
3
+ export declare class SimpleStorageAdapter<T extends MarshallingType> implements SimpleStorage<T> {
4
+ readonly key: string;
5
+ private storage;
6
+ constructor(key: string, storage: Storage);
7
+ get(): T;
8
+ set(value: T): void;
9
+ remove(): void;
10
+ }
@@ -0,0 +1,2 @@
1
+ import { CookieService } from './storage.type';
2
+ export declare const cookie: CookieService;
@@ -0,0 +1,4 @@
1
+ export * from './storage.factory';
2
+ export * from './token-provider.factory';
3
+ export * from './storage.type';
4
+ export * from './memoryStorage';
@@ -0,0 +1,7 @@
1
+ import { StorageKeyManager } from './storage.type';
2
+ interface MemoryStorage extends StorageKeyManager {
3
+ getItem(key: string): any;
4
+ setItem(key: string, value: any): void;
5
+ }
6
+ export declare const memoryStorage: MemoryStorage;
7
+ export {};
@@ -0,0 +1,31 @@
1
+ import { SimpleStorage, StorageType } from './storage.type';
2
+ import { MarshallingType } from '../types';
3
+ /**
4
+ * 캐시용 스토리지를 만드는 빌더.
5
+ * Memory, Local, Session 3가지로 만들 수 있다.
6
+ * 사용 시 type, key 가 필요하다.
7
+ *
8
+ * 만약 서버 환경이거나 스토리지를 이용 할 수 없을 경우, type 은 memory 로 강제된다.
9
+ *
10
+ * @example
11
+ * interface SampleModel {
12
+ * name: string;
13
+ * age: number;
14
+ * }
15
+ * const sto = storageFactory<SampleModel>('local', 'sampleKey');
16
+ * const data: SampleModel = {
17
+ * name: '포메포메',
18
+ * age: 3,
19
+ * };
20
+ *
21
+ * sto.set(data); // 스토리지에 데이터 설정
22
+ *
23
+ * const result = sto.get(); // 스토리지에서 데이터 가져오기
24
+ *
25
+ * sto.remove(); // 스토리지에서 데이터 삭제
26
+ *
27
+ * @param type 스토리지 타입. session, local, memory 중 하나. 기본 session.
28
+ * @param key 스토리지에서 쓰이는 키. 기본값은 '_' (underbar).
29
+ * @param expiredTime 유효시간 (seconds). 시간을 주지 않거나 0보다 작다면 자료 유효시간이 없다. 기본값은 0.
30
+ */
31
+ export declare const createStorage: <T extends MarshallingType>(type?: StorageType, key?: string, expiredTime?: number) => SimpleStorage<T>;
@@ -0,0 +1,96 @@
1
+ import { MarshallingType } from '../types';
2
+ /**
3
+ * 스토리지 타입
4
+ * - local - 로컬 스토리지
5
+ * - session - 세션 스토리지
6
+ * - memory - 메모리 스토리지
7
+ */
8
+ export declare type StorageType = 'local' | 'session' | 'memory' | 'cookie';
9
+ /**
10
+ * 스토리지의 키를 관리한다.
11
+ *
12
+ * sessionStorage 와 localStorage, memoryStorage 의 공통기능 모음이다.
13
+ */
14
+ export interface StorageKeyManager {
15
+ /**
16
+ * 스토리지가 가진 자료의 개수
17
+ */
18
+ readonly length: number;
19
+ /**
20
+ * 스토리지 내 모든 자료를 제거한다.
21
+ */
22
+ clear(): void;
23
+ /**
24
+ * 주어진 인덱스를 통해 스토리지의 키를 가져온다.
25
+ * @param index
26
+ */
27
+ key(index: number): string | null;
28
+ /**
29
+ * 주어진 키로 저장된 자료를 제거한다.
30
+ * @param key
31
+ */
32
+ removeItem(key: string): void;
33
+ }
34
+ /**
35
+ * 간단한 스토리지를 구성할 때 쓰이는 인터페이스.
36
+ *
37
+ * 사용 가능한 타입은 string 이나 객체형이다.
38
+ */
39
+ export interface SimpleStorage<T extends MarshallingType> {
40
+ /**
41
+ * 현재 스토리지가 사용하고 있는 키값.
42
+ * get, set, remove 이용 시 지정된 키값을 자동으로 사용 한다.
43
+ */
44
+ readonly key: string;
45
+ /**
46
+ * 스토리지에서 값을 가져온다.
47
+ */
48
+ get(): T | null;
49
+ /**
50
+ * 스토리지에 값을 설정한다.
51
+ * @param {T} value
52
+ */
53
+ set(value: T): void;
54
+ /**
55
+ * 스토리지에 설정된 값을 지운다.
56
+ */
57
+ remove(): void;
58
+ }
59
+ /**
60
+ * 유효기간이 있는 스토리지 데이터 모델.
61
+ */
62
+ export interface ExpiableStorageModel<T> {
63
+ /**
64
+ * 최대 유효시간. Unix Time Stamp 값을 기준으로 기록한다.
65
+ *
66
+ * Date.prototype.getTime 값에 대응한다.
67
+ */
68
+ expiredTime: number;
69
+ /**
70
+ * 보관된 자료
71
+ */
72
+ data: T;
73
+ }
74
+ /**
75
+ * 토큰을 제공한다.
76
+ */
77
+ export interface TokenProvider {
78
+ /**
79
+ * 토큰 값을 가져 온다.
80
+ */
81
+ get(): string;
82
+ /**
83
+ * 토큰 값을 설정 한다.
84
+ * @param token 토큰값
85
+ */
86
+ set(token: string): void;
87
+ /**
88
+ * 현재 토큰값을 지운다.
89
+ */
90
+ clear(): void;
91
+ }
92
+ export interface CookieService {
93
+ get(key: string): string;
94
+ set(key: string, value: string, expireDays?: number): void;
95
+ remove(key: string): void;
96
+ }
@@ -0,0 +1,9 @@
1
+ import { StorageType, TokenProvider } from './storage.type';
2
+ /**
3
+ * 토큰 제공자를 생성하여 가져온다.
4
+ *
5
+ * @param type 사용할 스토리지 타입
6
+ * @param key 보관에 기준이되는 키
7
+ * @param expiredTime 유효시간 (seconds). 시간을 주지 않거나 0보다 작다면 자료 유효시간이 없다. 기본값은 0.
8
+ */
9
+ export declare function createTokenProvider(type: StorageType, key: string, expiredTime?: number): TokenProvider;
@@ -0,0 +1,23 @@
1
+ export interface InputChangeArgs {
2
+ name: string;
3
+ value: string;
4
+ }
5
+ export interface RowInputChangeArgs extends InputChangeArgs {
6
+ index: number;
7
+ }
8
+ export interface CheckedChangeArgs {
9
+ name: string;
10
+ checked: boolean;
11
+ }
12
+ export interface SelectOptionItemModel {
13
+ value: string;
14
+ text: string;
15
+ }
16
+ export interface KeywordOptionItemModel extends SelectOptionItemModel {
17
+ keywords: string;
18
+ }
19
+ export interface SimpleDropDownListChangeArgs {
20
+ name: string;
21
+ value: string;
22
+ item: SelectOptionItemModel;
23
+ }
@@ -0,0 +1,2 @@
1
+ export * from './component.type';
2
+ export * from './marshalling.type';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 문자열에서 json 혹은 문자열로의 변환이 가능한 타입들을 나열한 것.
3
+ * 문자열과 객체, 배열, 혹은 이들에서 파생된 형태의 타입들을 의미 한다.
4
+ */
5
+ export declare type MarshallingType = boolean | string | string[] | Record<string, any> | Array<Record<string, any>>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 주어진 배열내 특정 2가지 요소에 대하여 서로 순서를 뒤바꾼다.
3
+ *
4
+ * sortable ui 결과를 이용할 때 쓰인다.
5
+ * @param list
6
+ * @param startIndex
7
+ * @param endIndex
8
+ * @returns
9
+ */
10
+ export declare function reorder<T>(list: T[], startIndex: number, endIndex: number): T[];
11
+ /**
12
+ * 주어진 배열의 특정 인덱스에 대하여 제시된 아이템 내용으로 업데이트한다.
13
+ * @param list
14
+ * @param index
15
+ * @param item
16
+ * @returns
17
+ */
18
+ export declare function update<T>(list: T[], index: number, item: T): T[];
19
+ /**
20
+ * 주어진 배열에서 특정 인덱스의 아이템을 삭제한다.
21
+ * @param list
22
+ * @param index
23
+ * @returns
24
+ */
25
+ export declare function remove<T>(list: T[], index: number): T[];
@@ -0,0 +1,56 @@
1
+ /**
2
+ * 서버 환경인지 확인한다.
3
+ */
4
+ export declare const isServer: () => boolean;
5
+ /**
6
+ * isServer 의 확인 내용을 특정 값으로 설정 한다.
7
+ *
8
+ * 개발 모드에서만 가능하며 그 외 상황에서는 설정 내용을 무시한다.
9
+ *
10
+ * 그러므로 가급적 테스트 상황에서만 호출하여 사용한다.
11
+ * @param val 서버 환경 여부에 대한 설정값
12
+ */
13
+ export declare const setIsServer: (val: boolean) => void;
14
+ /**
15
+ * 로컬 스토리지 사용 가능 여부를 확인한다.
16
+ */
17
+ export declare const isStorageAvailable: () => boolean;
18
+ export declare const setIsStorageAvailable: (val: boolean) => void;
19
+ /**
20
+ * user agent 정보를 설정 한다.
21
+ * 설정하는 장소는 Next js SSR 기준으로 App.getInitialProps 이다.
22
+ *
23
+ * client side 에서 동작 시 무시한다.
24
+ *
25
+ * @param ua 적용 할 user agent 정보
26
+ */
27
+ export declare function setUserAgent(ua?: string): void;
28
+ /**
29
+ * user agent 정보를 가져 온다.
30
+ *
31
+ * server side 일 경우, 수행전 반드시 setUserAgent 로 값을 주어야 하며
32
+ *
33
+ * client side 는 자동으로 window.navigator.userAgent 값을 전달한다.
34
+ */
35
+ export declare function getUserAgent(): string;
36
+ /**
37
+ * user-agent 정보를 이용하여 단순 모바일인지 여부를 확인한다.
38
+ *
39
+ * 모바일 기종: 안드로이드 계열 전 기종, ios 를 사용하는 모든 기종 (아이폰, 아이패드, 아이팟 등)
40
+ */
41
+ export declare function isMobile(): boolean;
42
+ /**
43
+ * user-agent 정보를 이용하여 태블릿 여부를 판단한다.
44
+ *
45
+ * TODO: 아직 Android 태블릿 여부는 확인이 불가하다. (ipad 만 가능)
46
+ */
47
+ export declare function isTablet(): boolean;
48
+ /**
49
+ * user-agent 정보를 이용하여 ios 여부를 판단한다.
50
+ */
51
+ export declare function isIOS(): boolean;
52
+ export declare function setNativeAppKeyword(keyword: string): void;
53
+ /**
54
+ * user-agent 정보를 이용하여 native app 여부를 판단한다.
55
+ */
56
+ export declare function isNativeApp(): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 특정 시간이 지난 후 비동기로 특정 값을 전달 한다.
3
+ * @param time 경과 할 시간 (ms)
4
+ * @param value 시간이 지난 후 전달 할 값
5
+ * @param stopCallback 타임아웃 되기 전, 중지 할 수 있는 함수를 넘겨주는 콜백. stop 수행 시 reject 된다.
6
+ */
7
+ export declare function timeout<T = void>(time: number, value?: T, stopCallback?: (stop: () => void) => void): Promise<T>;
8
+ /**
9
+ * 아무것도 수행하지 않는 빈 함수이다.
10
+ */
11
+ export declare function noop(): void;
@@ -0,0 +1,2 @@
1
+ export declare function throttle(func: (...args: any) => any, wait?: number): import("lodash").DebouncedFunc<(...args: any) => any>;
2
+ export declare function debounce(func: (...args: any) => any, wait?: number): import("lodash").DebouncedFunc<(...args: any) => any>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 숫자값을 3자리마다 쉼표가 찍힌 문자열로 바꿔준다.
3
+ * @param value 바꿀 숫자.
4
+ * @param def 값이 없을 때 기본 출력될 값.
5
+ */
6
+ export declare function numberFormat(value: number, def?: string): string;
@@ -0,0 +1,15 @@
1
+ export * from './collection';
2
+ import * as envCheck from './envCheck';
3
+ export * from './typeCheck';
4
+ export * from './etc';
5
+ export * from './filter';
6
+ export * from './format';
7
+ export * from './josa';
8
+ export * from './json';
9
+ export * from './path';
10
+ export * from './queryString';
11
+ export * from './redux';
12
+ export * from './template';
13
+ export * from './libLoader';
14
+ declare const isServer: () => boolean;
15
+ export { envCheck, isServer };
@@ -0,0 +1,66 @@
1
+ declare const _formats: {
2
+ '\uC744/\uB97C': ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
3
+ 을: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
4
+ 를: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
5
+ 을를: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
6
+ '\uC740/\uB294': ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
7
+ 은: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
8
+ 는: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
9
+ 은는: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
10
+ '\uC774/\uAC00': ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
11
+ 이: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
12
+ 가: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
13
+ 이가: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
14
+ '\uC640/\uACFC': ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
15
+ 와: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
16
+ 과: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
17
+ 와과: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
18
+ '\uC73C\uB85C/\uB85C': ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
19
+ 으로: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
20
+ 로: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
21
+ 으로로: ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
22
+ '\uC774/': ((string: string) => "을" | "를") | ((string: string) => "은" | "는") | ((string: string) => "이" | "가") | ((string: string) => "과" | "와") | ((string: string) => "으로" | "로") | ((string: string) => "" | "이");
23
+ };
24
+ declare type JosaResultType = keyof typeof _formats;
25
+ /**
26
+ * Josa.js는 한국어 조사인 은/는, 을/를, 이/가, 와/과를 구분해주는 자바스크립트 라이브러리입니다.
27
+ *
28
+ * https://github.com/e-/Josa.js/
29
+ */
30
+ export declare const josa: {
31
+ /**
32
+ * word와 format에 해당하는 조사를 돌려줍니다.
33
+ ```ts
34
+ Josa.c('사과','을/를'); // '를'
35
+ Josa.c('귤','이/가'); // '이'
36
+ Josa.c('바나나','은/는'); // '는'
37
+ Josa.c('딸기','와/과'); // '와'
38
+ ```
39
+ Josa.c의 반환값에는 word 자체는 포함되지 않는다는걸 주의하세요. word 자체를 포함하려면 Josa.r을 사용하세요.
40
+
41
+ format에는 '이/가', '은/는', '을/를', '와/과' 를 사용할 수 있고 짧은 이름도 가능합니다.
42
+
43
+ ```ts
44
+ Josa.c('사과','을/를'); // '를'
45
+ Josa.c('사과','을'); // '를'
46
+ Josa.c('사과','를'); // '를'
47
+ Josa.c('사과','을를'); // '를'
48
+ ```
49
+ * @param word
50
+ * @param format
51
+ * @returns
52
+ */
53
+ c: (word: string, format: JosaResultType) => "" | "을" | "를" | "이" | "은" | "는" | "가" | "과" | "와" | "으로" | "로";
54
+ /**
55
+ * Josa.c와 비슷하나 word를 포함한 결과값을 돌려줍니다.
56
+ ```ts
57
+ Josa.r('사과','을/를'); // '사과를'
58
+ Josa.r('귤','이/가'); // '귤이'
59
+ ```
60
+ * @param word
61
+ * @param format
62
+ * @returns
63
+ */
64
+ r: (word: string, format: JosaResultType) => string;
65
+ };
66
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 객체를 문자열 형태로 직렬화 한다.
3
+ * 만약 값이 문자열이면 그 값 그대로 돌려준다.
4
+ * @param value
5
+ */
6
+ export declare function marshalJson(value: any): string;
7
+ /**
8
+ * 특정 문자열의 내용을 확인하여 Object 로 만든다.
9
+ * 첫문자와 마지막 문자를 비교하여 JSON 형태가 아니라면 string을 반환하며,
10
+ * JSON 변환 시 문제가 발생된다면 null을 반환 한다.
11
+ * 그 외 값이 유효하지 않을 경우, 들어온 raw 값을 그대로 반환 한다.
12
+ * @param raw
13
+ */
14
+ export declare function unmarshalJson(raw: string | null): unknown;
@@ -0,0 +1 @@
1
+ export declare function loadOuterScript(url: string): Promise<boolean>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 특정 URL에서 파일명만 가져온다.
3
+ * @param url 파일명을 가져오고싶은 경로
4
+ */
5
+ export declare function getFileName(url: string): string;
6
+ /**
7
+ * 이거 대신 qs.parse 를 사용할 것.
8
+ * @deprecated
9
+ * @param url
10
+ * @returns
11
+ */
12
+ export declare function parseQueryString(url: string): Record<string, string>;
13
+ /**
14
+ * 이거 대신 qs.serialize 를 사용할 것.
15
+ * @deprecated
16
+ * @param params
17
+ * @param withQuestionMark
18
+ * @returns
19
+ */
20
+ export declare function serializeToQueryString<T = Record<string, unknown>>(params: T, withQuestionMark?: boolean): string;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Query String 을 조작하는 유틸리티 모음
3
+ */
4
+ interface QueryString {
5
+ /**
6
+ * 특정 URL 에서 쿼리 파라미터를 객체 형태로 만들어준다.
7
+ *
8
+ * 경로에 쿼리 파라미터가 존재하지 않다면 단순 빈 배열을 반환한다.
9
+ * @param url 파라미터를 가져오고 싶은 웹경로
10
+ */
11
+ parse(url: string): Record<string, string>;
12
+ /**
13
+ * 전달되는 객체의 key 와 value 를 이용하여 쿼리 파라미터 문자열로 바꿔준다.
14
+ * @param params
15
+ * @param withQuestionMark
16
+ * @returns
17
+ */
18
+ serialize<T = Record<string, unknown>>(params: T, withQuestionMark?: boolean): string;
19
+ /**
20
+ * 검색 문자열 (search string) 에 지정된 자료로 쿼리 파라미터를 덧붙인다.
21
+ * @param search "?"로 시작되는 search string
22
+ * @param data 덧붙일 쿼리 파라미터가 될 객체
23
+ * @throws "?"로 시작되지 않는 문자열일 경우 에러 발생
24
+ * @returns
25
+ */
26
+ append(search: string, data: Record<string, unknown>): string;
27
+ }
28
+ /**
29
+ * Query String 을 조작하는 유틸리티 모음.
30
+ *
31
+ * @description
32
+ * 외부의 "qs" 라이브러리와는 관계가 없다.
33
+ */
34
+ export declare const qs: QueryString;
35
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function clearMessageBy(errorMessages: Record<string, string>, name: string): {
2
+ [x: string]: string;
3
+ };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 간단한 템플릿 메시지 처리기.
3
+ *
4
+ * 중괄호({})로 구성된 메시지 템플릿에 주어진 객체의 값을 이용하여 메시지를 완성한다.
5
+ *
6
+ * ```ts
7
+ * const tmpl = '총 {totalCount}개의 상태가 {status}으로 바뀝니다.\n계속 하시겠습니까?';
8
+ * const data = {
9
+ * totalCount: 320,
10
+ * status: '배송중',
11
+ * };
12
+ * const message = messageTemplate(tmpl, data);
13
+ * // 총 320개의 상태가 배송중으로 바뀝니다.\n계속 하시겠습니까?
14
+ * ```
15
+ *
16
+ * ### 한글 조사 처리
17
+ *
18
+ * 아래와 같이 변수 템플릿 우측에 조사를 템플릿으로 넣어주면 된다.
19
+ *
20
+ * ```ts
21
+ * const tmpl = '이제 {name}{으로}만 유효합니다.';
22
+ *
23
+ * messageTemplate(tmpl, { name: '원숭이' });
24
+ * // 이제 원숭이로만 유효합니다.
25
+ *
26
+ * messageTemplate(tmpl, { name: '고객님' });
27
+ * // 이제 고객님으로만 유효합니다.
28
+ * ```
29
+ *
30
+ * @param tmplText 템플릿이 적용된 메시지
31
+ * @param data 적용될 객체 데이터
32
+ * @returns 만들어진 메시지
33
+ */
34
+ export declare function messageTemplate<T extends Record<string, string | number>>(tmplText: string, data: T): string;
35
+ export declare namespace messageTemplate {
36
+ var parse: (value: string) => string[];
37
+ var clear: () => void;
38
+ }
@@ -0,0 +1,42 @@
1
+ export declare function isUndefined(val: unknown): val is undefined;
2
+ export declare function isString(val: unknown): val is string;
3
+ /**
4
+ * 값이 undefined 이거나 null 인지 여부를 확인한다.
5
+ *
6
+ * 그리고 내용이 문자열 'undefined' 나 'null' 인지도 판단한다.
7
+ * @param val 확인 할 값.
8
+ */
9
+ export declare function isNullable(val: unknown): val is void;
10
+ /**
11
+ * 들어온 값이 빈 배열인지 확인한다.
12
+ * @param val
13
+ */
14
+ export declare function isEmptyArray(val: unknown): boolean;
15
+ /**
16
+ * 값이 숫자인지 확인한다.
17
+ * @param val
18
+ */
19
+ export declare function isNumber(val: unknown): val is number;
20
+ /**
21
+ * 순수 숫자인지 아니면 문자열로 된 숫자인지 확인한다.
22
+ * @param val
23
+ */
24
+ export declare function isNumberLike(val: unknown): boolean;
25
+ /**
26
+ * 주어진 값이 빈 객체인지 여부를 확인한다.
27
+ * @param val
28
+ * @returns
29
+ */
30
+ export declare function isEmptyObject(val: unknown): val is Record<string, never>;
31
+ /**
32
+ * 호출 가능한 함수인지 여부를 확인한다.
33
+ * @param val
34
+ * @returns
35
+ */
36
+ export declare function isFunction(val: unknown): val is CallableFunction;
37
+ /**
38
+ * 객체인지 확인한다.
39
+ * @param val
40
+ * @returns
41
+ */
42
+ export declare function isObject(val: unknown): val is Object;