@cp949/mui-react19 2.0.3 → 2.1.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.
- package/LICENSE +21 -0
- package/README.md +10 -0
- package/dist/closables-CeOGJV-d.d.cts +136 -0
- package/dist/closables-CeOGJV-d.d.ts +136 -0
- package/dist/file-drop/index.cjs +1 -1
- package/dist/file-drop/index.cjs.map +1 -1
- package/dist/file-drop/index.d.cts +224 -217
- package/dist/file-drop/index.d.ts +224 -217
- package/dist/file-drop/index.js +1 -1
- package/dist/file-drop/index.js.map +1 -1
- package/dist/helper/index.cjs +1 -1
- package/dist/helper/index.cjs.map +1 -1
- package/dist/helper/index.d.cts +22 -38
- package/dist/helper/index.d.ts +22 -38
- package/dist/helper/index.js +1 -1
- package/dist/helper/index.js.map +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +417 -307
- package/dist/hooks/index.d.ts +417 -307
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1032 -684
- package/dist/index.d.ts +1032 -684
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/misc-utils-B2de-HS4.cjs +2 -0
- package/dist/misc-utils-B2de-HS4.cjs.map +1 -0
- package/dist/misc-utils-BXQ8UU0R.js +2 -0
- package/dist/misc-utils-BXQ8UU0R.js.map +1 -0
- package/dist/parallel-map-DyuHvxYY.js +2 -0
- package/dist/parallel-map-DyuHvxYY.js.map +1 -0
- package/dist/parallel-map-_ZhC5iBn.cjs +2 -0
- package/dist/parallel-map-_ZhC5iBn.cjs.map +1 -0
- package/dist/rolldown-runtime-Chgba0Kb.cjs +1 -0
- package/dist/rolldown-runtime-DK3Fl9T5.js +1 -0
- package/llm.txt +350 -0
- package/package.json +19 -17
- package/dist/chunk-2OEB5VHZ.js +0 -2
- package/dist/chunk-2OEB5VHZ.js.map +0 -1
- package/dist/chunk-4C666HHU.js +0 -2
- package/dist/chunk-4C666HHU.js.map +0 -1
- package/dist/chunk-M4G6J7DP.cjs +0 -2
- package/dist/chunk-M4G6J7DP.cjs.map +0 -1
- package/dist/chunk-QNR3IXPA.cjs +0 -2
- package/dist/chunk-QNR3IXPA.cjs.map +0 -1
- package/dist/closables-BK0Db72u.d.cts +0 -135
- package/dist/closables-BK0Db72u.d.ts +0 -135
- package/dist/parallel-map-M764G6IE.js +0 -2
- package/dist/parallel-map-M764G6IE.js.map +0 -1
- package/dist/parallel-map-V2OVUIFQ.cjs +0 -2
- package/dist/parallel-map-V2OVUIFQ.cjs.map +0 -1
package/dist/hooks/index.d.cts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import 'rxjs';
|
|
6
|
-
|
|
1
|
+
import { t as Closables } from "../closables-CeOGJV-d.cjs";
|
|
2
|
+
import React$1, { DependencyList, Dispatch, EffectCallback, SetStateAction, useEffect } from "react";
|
|
3
|
+
import { UseMediaQueryOptions } from "@mui/material/useMediaQuery";
|
|
4
|
+
//#region src/hooks/useAbsolutePosition.d.ts
|
|
7
5
|
/**
|
|
8
6
|
* 주어진 요소의 좌측,상단 위치를 리턴한다.
|
|
9
7
|
*/
|
|
10
|
-
declare function useAbsolutePosition<E extends Element = Element>(deps:
|
|
11
|
-
|
|
8
|
+
export declare function useAbsolutePosition<E extends Element = Element>(deps: React$1.DependencyList, options?: {
|
|
9
|
+
intervalMs?: number;
|
|
12
10
|
}): [(element: E | null) => void, {
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
15
13
|
}];
|
|
16
|
-
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/hooks/useAudioUnlocked.d.ts
|
|
17
16
|
/**
|
|
18
17
|
* 사용자의 입력(터치, 클릭, 키보드 등)을 감지하여 오디오가 활성화되었는지(unlocked) 상태를 관리하는 커스텀 훅입니다.
|
|
19
18
|
*
|
|
@@ -40,23 +39,26 @@ declare function useAbsolutePosition<E extends Element = Element>(deps: react__d
|
|
|
40
39
|
* );
|
|
41
40
|
* ```
|
|
42
41
|
*/
|
|
43
|
-
declare function useAudioUnlocked(options: {
|
|
44
|
-
|
|
42
|
+
export declare function useAudioUnlocked(options: {
|
|
43
|
+
onUnlocked: () => void;
|
|
45
44
|
}): boolean;
|
|
46
|
-
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/hooks/types.d.ts
|
|
47
47
|
interface Observable<T> {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
subscribe: (listener: (value: T) => void) => {
|
|
49
|
+
unsubscribe: () => void;
|
|
50
|
+
};
|
|
51
51
|
}
|
|
52
52
|
interface BehaviorSubject<T> extends Observable<T> {
|
|
53
|
-
|
|
53
|
+
value: T;
|
|
54
54
|
}
|
|
55
55
|
type DependenciesComparator<Deps extends DependencyList = DependencyList> = (a: Deps, b: Deps) => boolean;
|
|
56
|
-
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/hooks/useBehaviorSubject.d.ts
|
|
57
58
|
type Fn<T> = () => T;
|
|
58
|
-
declare function useBehaviorSubject<TItem>(subject: BehaviorSubject<TItem> | Fn<BehaviorSubject<TItem>>): TItem;
|
|
59
|
-
|
|
59
|
+
export declare function useBehaviorSubject<TItem>(subject: BehaviorSubject<TItem> | Fn<BehaviorSubject<TItem>>): TItem;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/hooks/useCallbackRef.d.ts
|
|
60
62
|
/**
|
|
61
63
|
* React 컴포넌트에서 최신의 콜백을 안전하게 참조하기 위한 커스텀 훅.
|
|
62
64
|
*
|
|
@@ -86,8 +88,9 @@ declare function useBehaviorSubject<TItem>(subject: BehaviorSubject<TItem> | Fn<
|
|
|
86
88
|
* };
|
|
87
89
|
* ```
|
|
88
90
|
*/
|
|
89
|
-
declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T;
|
|
90
|
-
|
|
91
|
+
export declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T;
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/hooks/useCenterInView.d.ts
|
|
91
94
|
/**
|
|
92
95
|
* 특정 요소가 뷰포트의 세로 중앙에 위치해 있는지를 감지하는 커스텀 React 훅입니다.
|
|
93
96
|
*
|
|
@@ -110,11 +113,12 @@ declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T |
|
|
|
110
113
|
* );
|
|
111
114
|
* ```
|
|
112
115
|
*/
|
|
113
|
-
declare function useCenterInView(offset?: number): {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
export declare function useCenterInView(offset?: number): {
|
|
117
|
+
ref: React.RefObject<HTMLDivElement | null>;
|
|
118
|
+
isCenter: boolean;
|
|
116
119
|
};
|
|
117
|
-
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/hooks/useClipboard.d.ts
|
|
118
122
|
/**
|
|
119
123
|
* 클립보드 복사 기능을 제공하는 React 훅입니다.
|
|
120
124
|
*
|
|
@@ -140,18 +144,20 @@ declare function useCenterInView(offset?: number): {
|
|
|
140
144
|
* );
|
|
141
145
|
* ```
|
|
142
146
|
*/
|
|
143
|
-
declare function useClipboard({ timeout }?: {
|
|
144
|
-
|
|
147
|
+
export declare function useClipboard({ timeout }?: {
|
|
148
|
+
timeout?: number | undefined;
|
|
145
149
|
}): {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
copy: (valueToCopy: string) => Promise<boolean>;
|
|
151
|
+
reset: () => void;
|
|
152
|
+
error: Error | null;
|
|
153
|
+
copied: boolean;
|
|
150
154
|
};
|
|
151
|
-
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/hooks/useClosableEffect.d.ts
|
|
152
157
|
type Callback = ((closable: Closables) => VoidFunction | undefined) | ((closable: Closables) => void);
|
|
153
|
-
declare function useClosableEffect(callback: Callback, deps: unknown[]): void;
|
|
154
|
-
|
|
158
|
+
export declare function useClosableEffect(callback: Callback, deps: unknown[]): void;
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/hooks/useComposedRefs.d.ts
|
|
155
161
|
type PossibleRef<T> = React.Ref<T> | undefined;
|
|
156
162
|
/**
|
|
157
163
|
* A utility to compose multiple refs together
|
|
@@ -163,9 +169,11 @@ declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) =>
|
|
|
163
169
|
* Accepts callback refs and RefObject(s)
|
|
164
170
|
*/
|
|
165
171
|
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/hooks/useConstant.d.ts
|
|
174
|
+
export declare function useConstant<T>(fn: () => T): T;
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/hooks/useCooldown.d.ts
|
|
169
177
|
/**
|
|
170
178
|
* useCooldown
|
|
171
179
|
*
|
|
@@ -185,11 +193,12 @@ declare function useConstant<T>(fn: () => T): T;
|
|
|
185
193
|
* return <button onClick={trigger} disabled={isCooldown} />;
|
|
186
194
|
* ```
|
|
187
195
|
*/
|
|
188
|
-
declare function useCooldown<T extends (...args: any[]) => void = () => void>(callback: T | undefined, cooldown: number): {
|
|
189
|
-
|
|
190
|
-
|
|
196
|
+
export declare function useCooldown<T extends (...args: any[]) => void = () => void>(callback: T | undefined, cooldown: number): {
|
|
197
|
+
isCooldown: boolean;
|
|
198
|
+
trigger: (...args: Parameters<T>) => void;
|
|
191
199
|
};
|
|
192
|
-
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/hooks/useCustomCompareEffect.d.ts
|
|
193
202
|
type DepsEqualFnType<TDeps extends DependencyList> = (prevDeps: TDeps, nextDeps: TDeps) => boolean;
|
|
194
203
|
/**
|
|
195
204
|
* 사용자 정의 비교 함수를 사용하여 `useEffect`의 의존성 배열을 커스텀 비교 방식으로 처리할 수 있는 커스텀 훅입니다.
|
|
@@ -240,8 +249,9 @@ type DepsEqualFnType<TDeps extends DependencyList> = (prevDeps: TDeps, nextDeps:
|
|
|
240
249
|
*
|
|
241
250
|
* @returns 없음. 이 훅은 `useEffect`와 동일하게 부수 효과를 실행하며, 반환값은 없습니다.
|
|
242
251
|
*/
|
|
243
|
-
declare const useCustomCompareEffect: <TDeps extends DependencyList>(effect: EffectCallback, deps: TDeps, depsEqual: DepsEqualFnType<TDeps>) => void;
|
|
244
|
-
|
|
252
|
+
export declare const useCustomCompareEffect: <TDeps extends DependencyList>(effect: EffectCallback, deps: TDeps, depsEqual: DepsEqualFnType<TDeps>) => void;
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/hooks/useCustomCompareMemo.d.ts
|
|
245
255
|
/**
|
|
246
256
|
* Like useMemo but uses provided comparator function to validate dependency changes.
|
|
247
257
|
*
|
|
@@ -250,11 +260,12 @@ declare const useCustomCompareEffect: <TDeps extends DependencyList>(effect: Eff
|
|
|
250
260
|
* @param comparator function to validate dependency changes
|
|
251
261
|
* @returns useMemo result
|
|
252
262
|
*/
|
|
253
|
-
declare const useCustomCompareMemo: <T, Deps extends DependencyList>(factory: () => T, deps: Deps, comparator: DependenciesComparator<Deps>) => T;
|
|
254
|
-
|
|
263
|
+
export declare const useCustomCompareMemo: <T, Deps extends DependencyList>(factory: () => T, deps: Deps, comparator: DependenciesComparator<Deps>) => T;
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region src/hooks/useDebouncedCallback.d.ts
|
|
255
266
|
interface UseDebouncedCallbackOptions {
|
|
256
|
-
|
|
257
|
-
|
|
267
|
+
leading?: boolean;
|
|
268
|
+
trailing?: boolean;
|
|
258
269
|
}
|
|
259
270
|
/**
|
|
260
271
|
* useDebouncedCallback
|
|
@@ -285,10 +296,53 @@ interface UseDebouncedCallbackOptions {
|
|
|
285
296
|
* debouncedUpdate.cancel();
|
|
286
297
|
* ```
|
|
287
298
|
*/
|
|
288
|
-
declare function useDebouncedCallback<T extends (...args: any[]) => void>(callback: T, wait: number, options?: UseDebouncedCallbackOptions): T & {
|
|
289
|
-
|
|
299
|
+
export declare function useDebouncedCallback<T extends (...args: any[]) => void>(callback: T, wait: number, options?: UseDebouncedCallbackOptions): T & {
|
|
300
|
+
cancel: () => void;
|
|
290
301
|
};
|
|
291
|
-
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/hooks/useDebouncedParams.d.ts
|
|
304
|
+
export interface UseDebouncedParamsOptions {
|
|
305
|
+
/** 마지막 입력 후 발행까지 기다릴 시간(ms). 기본값: 200 */
|
|
306
|
+
delayMs?: number;
|
|
307
|
+
}
|
|
308
|
+
export interface UseDebouncedParamsResult<T> {
|
|
309
|
+
/** 화면에 보여줄 초안 검색 조건. 입력 즉시 갱신된다. */
|
|
310
|
+
params: Partial<T>;
|
|
311
|
+
/** 초안에 부분 변경을 병합하고 발행을 예약한다. */
|
|
312
|
+
onChange: (updated: Partial<T>) => void;
|
|
313
|
+
/** 대기 중인 입력이 있으면 기다리지 않고 바로 발행한다. 없으면 아무 일도 하지 않는다. */
|
|
314
|
+
flush: () => void;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* 검색 조건 입력을 초안으로 보관하고, 입력이 멈추면 한 번만 외부로 발행하는 훅.
|
|
318
|
+
*
|
|
319
|
+
* 외부 조건(`params`)이 바뀌면 초안을 외부 값으로 맞춘다. 단, 이 훅이 발행한 값이
|
|
320
|
+
* 부모를 거쳐 돌아온 경우(에코)는 초안을 되돌리지 않는다. 부모의 갱신이 비동기여도
|
|
321
|
+
* 그 사이에 입력한 내용이 사라지지 않는다.
|
|
322
|
+
*
|
|
323
|
+
* @param params - 외부 검색 조건. 깊은 비교로 변경 여부를 판단한다.
|
|
324
|
+
* @param onChange - 디바운스가 끝난 시점에 초안 전체를 전달받는 콜백. 항상 최신 콜백이 호출된다.
|
|
325
|
+
* @param options - `delayMs`: 발행 지연 시간(ms)
|
|
326
|
+
* @returns `params`(초안), `onChange`(입력 핸들러), `flush`(즉시 발행)
|
|
327
|
+
*
|
|
328
|
+
* @remarks
|
|
329
|
+
* - 외부 값이 발행값과 다르게 돌아오면(부모가 값을 보정한 경우 등) 외부 값이 우선하고, 대기 중인 입력은 버린다.
|
|
330
|
+
* - 대기 중에 언마운트하면 입력을 발행하지 않고 버린다.
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* ```tsx
|
|
334
|
+
* const { params: draft, onChange, flush } = useDebouncedParams(searchParams, setSearchParams);
|
|
335
|
+
*
|
|
336
|
+
* <TextField
|
|
337
|
+
* value={draft.keyword ?? ''}
|
|
338
|
+
* onChange={(e) => onChange({ keyword: e.target.value })}
|
|
339
|
+
* onKeyDown={(e) => e.key === 'Enter' && flush()}
|
|
340
|
+
* />
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
export declare function useDebouncedParams<T>(params: Partial<T>, onChange: (params: Partial<T>) => void, options?: UseDebouncedParamsOptions): UseDebouncedParamsResult<T>;
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/hooks/useDebouncedState.d.ts
|
|
292
346
|
/**
|
|
293
347
|
* 상태 업데이트를 지연시키는 커스텀 훅.
|
|
294
348
|
* `useState`와 비슷하지만 상태 업데이트를 지연(debounce)시킬 수 있는 React 커스텀 훅입니다.
|
|
@@ -316,12 +370,13 @@ declare function useDebouncedCallback<T extends (...args: any[]) => void>(callba
|
|
|
316
370
|
* );
|
|
317
371
|
* ```
|
|
318
372
|
*/
|
|
319
|
-
declare function useDebouncedState<T>(defaultValue: T
|
|
320
|
-
wait: number
|
|
321
|
-
options?: {
|
|
322
|
-
|
|
373
|
+
export declare function useDebouncedState<T>(defaultValue: T // 초기 상태 값
|
|
374
|
+
, wait: number // 지연 시간 (밀리초)
|
|
375
|
+
, options?: {
|
|
376
|
+
leading: boolean;
|
|
323
377
|
}): readonly [T, (next: SetStateAction<T>) => void];
|
|
324
|
-
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/hooks/useDebouncedValue.d.ts
|
|
325
380
|
/**
|
|
326
381
|
* 값의 변화를 지연시키는 커스텀 훅
|
|
327
382
|
*
|
|
@@ -333,21 +388,22 @@ options?: {
|
|
|
333
388
|
*
|
|
334
389
|
* @returns 지연 처리된 값과 타이머를 취소하는 함수.
|
|
335
390
|
*/
|
|
336
|
-
declare function useDebouncedValue<T>(
|
|
391
|
+
export declare function useDebouncedValue<T>(
|
|
337
392
|
/** 지연 처리할 값 */
|
|
338
|
-
value: T,
|
|
393
|
+
value: T,
|
|
339
394
|
/** 지연 시간(밀리초 단위) */
|
|
340
|
-
wait: number,
|
|
395
|
+
wait: number,
|
|
341
396
|
/** 옵션: 첫 업데이트 즉시 처리 여부 */
|
|
342
397
|
options?: {
|
|
343
|
-
|
|
398
|
+
leading: boolean;
|
|
344
399
|
}): readonly [T, () => void];
|
|
345
|
-
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region src/hooks/useDebounceEffect.d.ts
|
|
346
402
|
interface DebounceOptions$1 {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
403
|
+
wait?: number;
|
|
404
|
+
leading?: boolean;
|
|
405
|
+
trailing?: boolean;
|
|
406
|
+
maxWait?: number;
|
|
351
407
|
}
|
|
352
408
|
/**
|
|
353
409
|
* 디바운스 처리된 `effect`를 제공하는 React 커스텀 훅입니다.
|
|
@@ -393,13 +449,14 @@ interface DebounceOptions$1 {
|
|
|
393
449
|
* @see `useDebounceFn` 디바운스 처리된 함수 생성에 사용됩니다.
|
|
394
450
|
* @see `useUpdateEffect` 업데이트 시점에 이펙트를 실행하는 데 사용됩니다.
|
|
395
451
|
*/
|
|
396
|
-
declare function useDebounceEffect(effect: EffectCallback, deps?: DependencyList, options?: DebounceOptions$1): void;
|
|
397
|
-
|
|
452
|
+
export declare function useDebounceEffect(effect: EffectCallback, deps?: DependencyList, options?: DebounceOptions$1): void;
|
|
453
|
+
//#endregion
|
|
454
|
+
//#region src/hooks/useDebounceFn.d.ts
|
|
398
455
|
interface DebounceOptions {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
456
|
+
wait?: number;
|
|
457
|
+
leading?: boolean;
|
|
458
|
+
trailing?: boolean;
|
|
459
|
+
maxWait?: number;
|
|
403
460
|
}
|
|
404
461
|
type noop = (...args: any[]) => any;
|
|
405
462
|
/**
|
|
@@ -437,15 +494,16 @@ type noop = (...args: any[]) => any;
|
|
|
437
494
|
* };
|
|
438
495
|
* ```
|
|
439
496
|
*/
|
|
440
|
-
declare function useDebounceFn<T extends noop>(fn: T, options?: DebounceOptions): {
|
|
441
|
-
|
|
442
|
-
cancel: () => void;
|
|
443
|
-
flush: () => ReturnType<T> | undefined;
|
|
444
|
-
};
|
|
497
|
+
export declare function useDebounceFn<T extends noop>(fn: T, options?: DebounceOptions): {
|
|
498
|
+
run: ((...args: Parameters<T>) => ReturnType<T>) & {
|
|
445
499
|
cancel: () => void;
|
|
446
500
|
flush: () => ReturnType<T> | undefined;
|
|
501
|
+
};
|
|
502
|
+
cancel: () => void;
|
|
503
|
+
flush: () => ReturnType<T> | undefined;
|
|
447
504
|
};
|
|
448
|
-
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region src/hooks/useDeepCompareEffect.d.ts
|
|
449
507
|
/**
|
|
450
508
|
* 의존성 배열의 깊은 비교(Deep Comparison)를 수행하여 `useEffect`를 실행하는 커스텀 훅입니다.
|
|
451
509
|
*
|
|
@@ -491,8 +549,9 @@ declare function useDebounceFn<T extends noop>(fn: T, options?: DebounceOptions)
|
|
|
491
549
|
*
|
|
492
550
|
* @returns 없음. 이 훅은 `useEffect`와 동일하게 부수 효과를 실행하며, 반환값은 없습니다.
|
|
493
551
|
*/
|
|
494
|
-
declare const useDeepCompareEffect: (effect: EffectCallback, deps: DependencyList) => void;
|
|
495
|
-
|
|
552
|
+
export declare const useDeepCompareEffect: (effect: EffectCallback, deps: DependencyList) => void;
|
|
553
|
+
//#endregion
|
|
554
|
+
//#region src/hooks/useDeepCompareMemo.d.ts
|
|
496
555
|
/**
|
|
497
556
|
* Like useMemo but validates dependency changes using deep equality check instead of reference check.
|
|
498
557
|
*
|
|
@@ -501,10 +560,12 @@ declare const useDeepCompareEffect: (effect: EffectCallback, deps: DependencyLis
|
|
|
501
560
|
* @returns Initially returns the result of calling `factory`. On subsequent renders, it will return
|
|
502
561
|
* the same value, if dependencies haven't changed, or the result of calling `factory` again, if they have changed.
|
|
503
562
|
*/
|
|
504
|
-
declare function useDeepCompareMemo<T, Deps extends DependencyList>(factory: () => T, deps: Deps): T;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
563
|
+
export declare function useDeepCompareMemo<T, Deps extends DependencyList>(factory: () => T, deps: Deps): T;
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region src/hooks/useDidUpdate.d.ts
|
|
566
|
+
export declare function useDidUpdate(fn: EffectCallback, dependencies?: DependencyList): void;
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/hooks/useEffectOnce.d.ts
|
|
508
569
|
/**
|
|
509
570
|
* 컴포넌트가 마운트될 때 한 번만 실행되는 `useEffect`를 구현하기 위한 커스텀 훅입니다.
|
|
510
571
|
*
|
|
@@ -528,8 +589,9 @@ declare function useDidUpdate(fn: EffectCallback, dependencies?: DependencyList)
|
|
|
528
589
|
* ```
|
|
529
590
|
* @returns 없음. `useEffect`와 동일하게 동작하며, 반환값은 없습니다.
|
|
530
591
|
*/
|
|
531
|
-
declare const useEffectOnce: (effect: EffectCallback) => void;
|
|
532
|
-
|
|
592
|
+
export declare const useEffectOnce: (effect: EffectCallback) => void;
|
|
593
|
+
//#endregion
|
|
594
|
+
//#region src/hooks/useElementSize.d.ts
|
|
533
595
|
/**
|
|
534
596
|
* 요소의 참조(ref)와 해당 요소의 너비(width) 및 높이(height)를 제공하는 커스텀 React 훅.
|
|
535
597
|
* `useResizeObserver` 훅을 활용하여 요소의 크기를 관찰합니다.
|
|
@@ -552,14 +614,16 @@ declare const useEffectOnce: (effect: EffectCallback) => void;
|
|
|
552
614
|
* );
|
|
553
615
|
* ```
|
|
554
616
|
*/
|
|
555
|
-
declare function useElementSize<T extends HTMLElement = HTMLElement>(options?: ResizeObserverOptions): {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
617
|
+
export declare function useElementSize<T extends HTMLElement = HTMLElement>(options?: ResizeObserverOptions): {
|
|
618
|
+
ref: import("react").RefObject<T | null>;
|
|
619
|
+
width: number;
|
|
620
|
+
height: number;
|
|
559
621
|
};
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
622
|
+
//#endregion
|
|
623
|
+
//#region src/hooks/useEventListener.d.ts
|
|
624
|
+
export declare function useEventListener<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLElement>(type: K, listener: (this: T, ev: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): import("react").RefObject<T | undefined>;
|
|
625
|
+
//#endregion
|
|
626
|
+
//#region src/hooks/useId.d.ts
|
|
563
627
|
/**
|
|
564
628
|
* React 19 네이티브 `useId`를 사용해 안정적인 고유 id를 생성한다.
|
|
565
629
|
*
|
|
@@ -569,8 +633,9 @@ declare function useEventListener<K extends keyof HTMLElementEventMap, T extends
|
|
|
569
633
|
* @param staticId 고정 id. string이면 그대로 반환된다.
|
|
570
634
|
* @returns 고정 id 또는 네이티브 id.
|
|
571
635
|
*/
|
|
572
|
-
declare function useId(staticId?: string): string;
|
|
573
|
-
|
|
636
|
+
export declare function useId(staticId?: string): string;
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/hooks/useIdle.d.ts
|
|
574
639
|
/**
|
|
575
640
|
* 사용자의 비활성 상태를 감지하고, 비활성 여부를 반환하는 커스텀 훅입니다.
|
|
576
641
|
*
|
|
@@ -616,8 +681,9 @@ declare function useId(staticId?: string): string;
|
|
|
616
681
|
*
|
|
617
682
|
* @returns `boolean` 값으로 비활성 상태(`true`) 또는 활성 상태(`false`)를 나타냅니다.
|
|
618
683
|
*/
|
|
619
|
-
declare const useIdle: (ms?: number, initialState?: boolean, events?: string[]) => boolean;
|
|
620
|
-
|
|
684
|
+
export declare const useIdle: (ms?: number, initialState?: boolean, events?: string[]) => boolean;
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region src/hooks/useImageLoadCallback.d.ts
|
|
621
687
|
/**
|
|
622
688
|
* 이미지 로드 상태를 감지하고 로드 또는 실패 시 콜백을 호출하는 React 훅입니다.
|
|
623
689
|
*
|
|
@@ -653,43 +719,44 @@ declare const useIdle: (ms?: number, initialState?: boolean, events?: string[])
|
|
|
653
719
|
* - React: `useEffect`, `useState`
|
|
654
720
|
* - DOM API: `addEventListener`, `removeEventListener`, `MutationObserver`
|
|
655
721
|
*/
|
|
656
|
-
declare function useImageLoadCallback(img: HTMLImageElement | null, options: {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
}, deps?:
|
|
661
|
-
|
|
722
|
+
export declare function useImageLoadCallback(img: HTMLImageElement | null, options: {
|
|
723
|
+
keepListening?: boolean;
|
|
724
|
+
onLoaded: (img: HTMLImageElement) => void;
|
|
725
|
+
onError?: (img: HTMLImageElement, error: unknown) => void;
|
|
726
|
+
}, deps?: React$1.DependencyList): void;
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region src/hooks/useImageUpload.d.ts
|
|
662
729
|
/**
|
|
663
730
|
* 파일 업로드의 결과를 나타내는 데이터 구조.
|
|
664
731
|
*
|
|
665
732
|
* 파일 업로드가 성공적으로 완료된 후 반환되는 정보를 정의합니다.
|
|
666
733
|
*/
|
|
667
|
-
interface FileUploadResult {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
734
|
+
export interface FileUploadResult {
|
|
735
|
+
/**
|
|
736
|
+
* 업로드된 파일의 고유 ID.
|
|
737
|
+
* 서버 또는 데이터베이스에서 파일을 식별하는 데 사용됩니다.
|
|
738
|
+
*/
|
|
739
|
+
id: string;
|
|
740
|
+
/**
|
|
741
|
+
* 업로드된 파일의 URL.
|
|
742
|
+
* 업로드된 파일에 접근하거나 다운로드할 수 있는 경로를 제공합니다.
|
|
743
|
+
*/
|
|
744
|
+
url: string;
|
|
745
|
+
/**
|
|
746
|
+
* 업로드된 파일의 총 크기(바이트 단위).
|
|
747
|
+
* 선택적 속성으로, 서버가 파일 크기를 반환하지 않는 경우 undefined일 수 있습니다.
|
|
748
|
+
*/
|
|
749
|
+
totalBytes?: number;
|
|
750
|
+
/**
|
|
751
|
+
* 업로드된 파일의 이름.
|
|
752
|
+
* 파일의 원래 이름 또는 서버에서 생성한 이름일 수 있습니다.
|
|
753
|
+
*/
|
|
754
|
+
fileName?: string;
|
|
755
|
+
/**
|
|
756
|
+
* 업로드된 파일의 MIME 타입.
|
|
757
|
+
* 예: `image/jpeg`, `application/pdf` 등 파일의 유형을 나타냅니다.
|
|
758
|
+
*/
|
|
759
|
+
contentType?: string;
|
|
693
760
|
}
|
|
694
761
|
/**
|
|
695
762
|
* React 커스텀 훅으로 이미지를 업로드하고 업로드 상태를 관리합니다.
|
|
@@ -747,11 +814,12 @@ interface FileUploadResult {
|
|
|
747
814
|
* }
|
|
748
815
|
* ```
|
|
749
816
|
*/
|
|
750
|
-
declare function useImageUpload(file: Blob | null | undefined, handleFileUpload: (file: Blob) => Promise<FileUploadResult>, callback: (imageUrl: FileUploadResult | null) => void): boolean;
|
|
751
|
-
|
|
817
|
+
export declare function useImageUpload(file: Blob | null | undefined, handleFileUpload: (file: Blob) => Promise<FileUploadResult>, callback: (imageUrl: FileUploadResult | null) => void): boolean;
|
|
818
|
+
//#endregion
|
|
819
|
+
//#region src/hooks/useInterval.d.ts
|
|
752
820
|
interface UseIntervalOptions {
|
|
753
|
-
|
|
754
|
-
|
|
821
|
+
/** If set, the interval will start automatically when the component is mounted, `false` by default */
|
|
822
|
+
autoInvoke?: boolean;
|
|
755
823
|
}
|
|
756
824
|
/**
|
|
757
825
|
* 특정 작업을 주어진 간격으로 실행할 수 있는 React Hook입니다.
|
|
@@ -792,13 +860,14 @@ interface UseIntervalOptions {
|
|
|
792
860
|
* - `autoInvoke`가 `true`로 설정되면, 컴포넌트가 마운트될 때 자동으로 interval이 시작됩니다.
|
|
793
861
|
* - 컴포넌트가 언마운트될 때 interval은 자동으로 정리됩니다.
|
|
794
862
|
*/
|
|
795
|
-
declare function useInterval(fn: () => void, interval: number, { autoInvoke }?: UseIntervalOptions): {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
863
|
+
export declare function useInterval(fn: () => void, interval: number, { autoInvoke }?: UseIntervalOptions): {
|
|
864
|
+
start: () => void;
|
|
865
|
+
stop: () => void;
|
|
866
|
+
toggle: () => void;
|
|
867
|
+
active: boolean;
|
|
800
868
|
};
|
|
801
|
-
|
|
869
|
+
//#endregion
|
|
870
|
+
//#region src/hooks/useIsomorphicEffect.d.ts
|
|
802
871
|
/**
|
|
803
872
|
* 브라우저와 서버 환경 모두에서 안전하게 사용할 수 있는 React 효과 훅.
|
|
804
873
|
*
|
|
@@ -820,20 +889,24 @@ declare function useInterval(fn: () => void, interval: number, { autoInvoke }?:
|
|
|
820
889
|
* };
|
|
821
890
|
* ```
|
|
822
891
|
*/
|
|
823
|
-
declare const useIsomorphicEffect: typeof useEffect;
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
892
|
+
export declare const useIsomorphicEffect: typeof useEffect;
|
|
893
|
+
//#endregion
|
|
894
|
+
//#region src/hooks/useLatest.d.ts
|
|
895
|
+
export declare function useLatest<T>(value: T): import("react").RefObject<T>;
|
|
896
|
+
//#endregion
|
|
897
|
+
//#region src/hooks/useLgOrUp.d.ts
|
|
898
|
+
export declare function useLgOrUp(options?: UseMediaQueryOptions): boolean;
|
|
899
|
+
//#endregion
|
|
900
|
+
//#region src/hooks/useLifecycleLogger.d.ts
|
|
829
901
|
/**
|
|
830
902
|
* This hook provides a console log when the component mounts, updates and unmounts.
|
|
831
903
|
*
|
|
832
904
|
* @param componentName Provides the name of the component in which the life cycle is being logged
|
|
833
905
|
* @param deps Dependencies list, as for `useEffect` hook
|
|
834
906
|
*/
|
|
835
|
-
declare function useLifecycleLogger(componentName: string, deps?: DependencyList): void;
|
|
836
|
-
|
|
907
|
+
export declare function useLifecycleLogger(componentName: string, deps?: DependencyList): void;
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region src/hooks/useLoadingVisible.d.ts
|
|
837
910
|
/**
|
|
838
911
|
* 로딩 지연 훅
|
|
839
912
|
* 용도: 예를 들어, 100ms내로 작업이 빠르게 완료되는 경우
|
|
@@ -859,83 +932,90 @@ declare function useLifecycleLogger(componentName: string, deps?: DependencyList
|
|
|
859
932
|
* 500ms: 로딩중 UI 감춤
|
|
860
933
|
*/
|
|
861
934
|
interface Options$1 {
|
|
862
|
-
|
|
863
|
-
|
|
935
|
+
minVisibleTime?: number;
|
|
936
|
+
postponeTime?: number;
|
|
864
937
|
}
|
|
865
|
-
declare function useLoadingVisible(paramLoading: boolean, opts?: Options$1): boolean;
|
|
866
|
-
|
|
938
|
+
export declare function useLoadingVisible(paramLoading: boolean, opts?: Options$1): boolean;
|
|
939
|
+
//#endregion
|
|
940
|
+
//#region src/hooks/useLocalStorage.d.ts
|
|
867
941
|
type parserOptions$1<T> = {
|
|
868
|
-
|
|
942
|
+
raw: true;
|
|
869
943
|
} | {
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
944
|
+
raw: false;
|
|
945
|
+
serializer: (value: T) => string;
|
|
946
|
+
deserializer: (value: string) => T;
|
|
873
947
|
};
|
|
874
|
-
declare const useLocalStorage: <T>(key: string, initialValue?: T, options?: parserOptions$1<T>) => [T | undefined, Dispatch<SetStateAction<T | undefined>>, () => void];
|
|
875
|
-
|
|
948
|
+
export declare const useLocalStorage: <T>(key: string, initialValue?: T, options?: parserOptions$1<T>) => [T | undefined, Dispatch<SetStateAction<T | undefined>>, () => void];
|
|
949
|
+
//#endregion
|
|
950
|
+
//#region src/persistence/codec.d.ts
|
|
876
951
|
/**
|
|
877
952
|
* A codec that can encode and decode values of type V to and from strings.
|
|
878
953
|
* @typeParam V The type of values that can be encoded and decoded.
|
|
879
954
|
*/
|
|
880
955
|
interface Codec<V> {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
956
|
+
/**
|
|
957
|
+
* Decodes a string value into a value of type V.
|
|
958
|
+
* @param value The value to decode.
|
|
959
|
+
* @returns The decoded value.
|
|
960
|
+
*/
|
|
961
|
+
parse: (value: string) => V;
|
|
962
|
+
/**
|
|
963
|
+
* Encodes a value of type V into a string.
|
|
964
|
+
* @param value The value to encode.
|
|
965
|
+
* @returns The encoded value.
|
|
966
|
+
*/
|
|
967
|
+
stringify: (value: V) => string;
|
|
893
968
|
}
|
|
894
|
-
|
|
969
|
+
//#endregion
|
|
970
|
+
//#region src/persistence/useStorageState.d.ts
|
|
895
971
|
type StorageStateInitializer<T> = () => T | null;
|
|
896
972
|
type UseStorageStateHookResult<T> = [T | null, Dispatch<SetStateAction<T | null>>];
|
|
897
973
|
interface DefaultStorageStateoptions<T = string> {
|
|
898
|
-
|
|
974
|
+
codec?: Codec<T>;
|
|
899
975
|
}
|
|
900
976
|
interface StorageStateOptions<T> extends DefaultStorageStateoptions<T> {
|
|
901
|
-
|
|
977
|
+
codec: Codec<T>;
|
|
902
978
|
}
|
|
903
979
|
interface UseStorageState {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
980
|
+
/**
|
|
981
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
982
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
983
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
984
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
985
|
+
* @param options Additional options for the storage state.
|
|
986
|
+
*/
|
|
987
|
+
(key: string | null, initializer?: string | null | StorageStateInitializer<string>, options?: DefaultStorageStateoptions): UseStorageStateHookResult<string>;
|
|
988
|
+
/**
|
|
989
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
990
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
991
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
992
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
993
|
+
* @param options Additional options for the storage state.
|
|
994
|
+
*/
|
|
995
|
+
<T>(key: string | null, initializer: T | null | StorageStateInitializer<T>, options: StorageStateOptions<T>): UseStorageStateHookResult<T>;
|
|
996
|
+
/**
|
|
997
|
+
* Sync state to local or session storage so that it persists through a page refresh. Usage is
|
|
998
|
+
* similar to useState except we pass in a storage key that uniquely identifies the value.
|
|
999
|
+
* @param key The key to use for storing the value in local or session storage.
|
|
1000
|
+
* @param initializer The initial value to use if the key is not present in storage.
|
|
1001
|
+
* @param options Additional options for the storage state.
|
|
1002
|
+
*/
|
|
1003
|
+
<T>(key: string | null, initializer?: T | null | StorageStateInitializer<T>, options?: StorageStateOptions<T>): UseStorageStateHookResult<T>;
|
|
928
1004
|
}
|
|
929
|
-
|
|
1005
|
+
//#endregion
|
|
1006
|
+
//#region src/hooks/useLocalStorageState.d.ts
|
|
930
1007
|
/**
|
|
931
1008
|
* @deprecated use useLocalStorage()
|
|
932
1009
|
*/
|
|
933
|
-
declare const useLocalStorageState: UseStorageState;
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1010
|
+
export declare const useLocalStorageState: UseStorageState;
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region src/hooks/useMdOrDown.d.ts
|
|
1013
|
+
export declare function useMdOrDown(options?: UseMediaQueryOptions): boolean;
|
|
1014
|
+
//#endregion
|
|
1015
|
+
//#region src/hooks/useMdOrUp.d.ts
|
|
1016
|
+
export declare function useMdOrUp(options?: UseMediaQueryOptions): boolean;
|
|
1017
|
+
//#endregion
|
|
1018
|
+
//#region src/hooks/useMount.d.ts
|
|
939
1019
|
/**
|
|
940
1020
|
* 컴포넌트가 마운트될 때 한 번만 실행되는 로직을 처리하기 위한 커스텀 훅입니다.
|
|
941
1021
|
*
|
|
@@ -959,8 +1039,9 @@ declare function useMdOrUp(options?: UseMediaQueryOptions): boolean;
|
|
|
959
1039
|
* ```
|
|
960
1040
|
* @returns 없음. 이 훅은 단지 전달된 콜백 함수를 실행하며 반환값은 없습니다.
|
|
961
1041
|
*/
|
|
962
|
-
declare const useMount: (fn: () => void) => void;
|
|
963
|
-
|
|
1042
|
+
export declare const useMount: (fn: () => void) => void;
|
|
1043
|
+
//#endregion
|
|
1044
|
+
//#region src/hooks/useMounted.d.ts
|
|
964
1045
|
/**
|
|
965
1046
|
* 컴포넌트가 마운트되었는지 여부를 반환하는 React 훅입니다.
|
|
966
1047
|
*
|
|
@@ -981,8 +1062,9 @@ declare const useMount: (fn: () => void) => void;
|
|
|
981
1062
|
* }
|
|
982
1063
|
* ```
|
|
983
1064
|
*/
|
|
984
|
-
declare function useMounted(): boolean;
|
|
985
|
-
|
|
1065
|
+
export declare function useMounted(): boolean;
|
|
1066
|
+
//#endregion
|
|
1067
|
+
//#region src/hooks/useMountedState.d.ts
|
|
986
1068
|
/**
|
|
987
1069
|
* 컴포넌트가 마운트 상태인지 여부를 반환하는 커스텀 훅입니다.
|
|
988
1070
|
*
|
|
@@ -1017,8 +1099,9 @@ declare function useMounted(): boolean;
|
|
|
1017
1099
|
* - `useEffect`는 컴포넌트가 마운트되면 `true`, 언마운트되면 `false`로 설정합니다.
|
|
1018
1100
|
* - `useCallback`을 사용하여 `get` 함수가 항상 동일한 참조를 가지도록 보장합니다.
|
|
1019
1101
|
*/
|
|
1020
|
-
declare function useMountedState(): () => boolean;
|
|
1021
|
-
|
|
1102
|
+
export declare function useMountedState(): () => boolean;
|
|
1103
|
+
//#endregion
|
|
1104
|
+
//#region src/hooks/useMutationObserver.d.ts
|
|
1022
1105
|
/**
|
|
1023
1106
|
* DOM의 변화를 감지하고 콜백을 실행하는 React 훅
|
|
1024
1107
|
*
|
|
@@ -1043,28 +1126,34 @@ declare function useMountedState(): () => boolean;
|
|
|
1043
1126
|
* };
|
|
1044
1127
|
* ```
|
|
1045
1128
|
*/
|
|
1046
|
-
declare function useMutationObserver<T extends HTMLElement = HTMLElement>(callback: MutationCallback, options: MutationObserverInit, target?: HTMLElement | (() => HTMLElement) | null): React.RefObject<T | null>;
|
|
1047
|
-
|
|
1129
|
+
export declare function useMutationObserver<T extends HTMLElement = HTMLElement>(callback: MutationCallback, options: MutationObserverInit, target?: HTMLElement | (() => HTMLElement) | null): React.RefObject<T | null>;
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region src/hooks/useObservable.d.ts
|
|
1048
1132
|
declare function useObservable<T>(observable: null | undefined | Observable<T> | (() => Observable<T>)): T | undefined;
|
|
1049
1133
|
declare function useObservable<T>(observable: null | undefined | Observable<T> | (() => Observable<T>), initialValue: T): T;
|
|
1050
|
-
|
|
1134
|
+
//#endregion
|
|
1135
|
+
//#region src/hooks/useObservableLocalStorage.d.ts
|
|
1051
1136
|
type SetStateFn$1<T> = (value: T | undefined) => void;
|
|
1052
1137
|
type GetFn$1<T> = () => T;
|
|
1053
|
-
declare function useObservableLocalStorage<T>(key: string, initialValue: T | GetFn$1<T>): [T, SetStateFn$1<T | null>];
|
|
1054
|
-
|
|
1138
|
+
export declare function useObservableLocalStorage<T>(key: string, initialValue: T | GetFn$1<T>): [T, SetStateFn$1<T | null>];
|
|
1139
|
+
//#endregion
|
|
1140
|
+
//#region src/hooks/useObservableSessionStorage.d.ts
|
|
1055
1141
|
type SetStateFn<T> = (value: T | undefined) => void;
|
|
1056
1142
|
type GetFn<T> = () => T;
|
|
1057
|
-
declare function useObservableSessionStorage<T>(key: string, initialValue: T | GetFn<T>): [T, SetStateFn<T | null>];
|
|
1058
|
-
|
|
1059
|
-
|
|
1143
|
+
export declare function useObservableSessionStorage<T>(key: string, initialValue: T | GetFn<T>): [T, SetStateFn<T | null>];
|
|
1144
|
+
//#endregion
|
|
1145
|
+
//#region src/hooks/useOs.d.ts
|
|
1146
|
+
export type OS = 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux';
|
|
1060
1147
|
interface UseOsOptions {
|
|
1061
|
-
|
|
1148
|
+
getValueInEffect: boolean;
|
|
1062
1149
|
}
|
|
1063
|
-
declare function useOs(options?: UseOsOptions): OS;
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1150
|
+
export declare function useOs(options?: UseOsOptions): OS;
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region src/hooks/useRafState.d.ts
|
|
1153
|
+
export declare const useRafState: <S>(initialState: S | (() => S)) => [S, Dispatch<SetStateAction<S>>];
|
|
1154
|
+
//#endregion
|
|
1155
|
+
//#region src/hooks/useRefEffect.d.ts
|
|
1156
|
+
export type CleanupCallback = () => void;
|
|
1068
1157
|
/**
|
|
1069
1158
|
* DOM ref가 연결되거나 변경될 때 콜백을 실행하고, 이전 요소에 대한 정리 함수를 자동으로 호출하는 훅입니다.
|
|
1070
1159
|
*
|
|
@@ -1086,8 +1175,9 @@ type CleanupCallback = () => void;
|
|
|
1086
1175
|
* return <div ref={ref} />;
|
|
1087
1176
|
* ```
|
|
1088
1177
|
*/
|
|
1089
|
-
declare function useRefEffect<RefElement extends HTMLElement = HTMLElement>(callback: (element: RefElement) => CleanupCallback | undefined, deps: DependencyList): (element: RefElement | null) => void;
|
|
1090
|
-
|
|
1178
|
+
export declare function useRefEffect<RefElement extends HTMLElement = HTMLElement>(callback: (element: RefElement) => CleanupCallback | undefined, deps: DependencyList): (element: RefElement | null) => void;
|
|
1179
|
+
//#endregion
|
|
1180
|
+
//#region src/hooks/useResizeObserver.d.ts
|
|
1091
1181
|
type ObserverRect = Omit<DOMRectReadOnly, 'toJSON'>;
|
|
1092
1182
|
/**
|
|
1093
1183
|
* 요소에 대한 `ref`를 제공하고 크기 조정(resize) 이벤트를 관찰하는 커스텀 React 훅.
|
|
@@ -1110,19 +1200,21 @@ type ObserverRect = Omit<DOMRectReadOnly, 'toJSON'>;
|
|
|
1110
1200
|
* );
|
|
1111
1201
|
* ```
|
|
1112
1202
|
*/
|
|
1113
|
-
declare function useResizeObserver<T extends HTMLElement = HTMLElement>(options?: ResizeObserverOptions): readonly [react.RefObject<T | null>, ObserverRect];
|
|
1114
|
-
|
|
1203
|
+
export declare function useResizeObserver<T extends HTMLElement = HTMLElement>(options?: ResizeObserverOptions): readonly [import("react").RefObject<T | null>, ObserverRect];
|
|
1204
|
+
//#endregion
|
|
1205
|
+
//#region src/hooks/useScript.d.ts
|
|
1115
1206
|
type LoadingState = 'unknown' | 'loading' | 'ready' | 'error';
|
|
1116
|
-
declare function useScript(src: string, options?: {
|
|
1117
|
-
|
|
1207
|
+
export declare function useScript(src: string, options?: {
|
|
1208
|
+
removeOnUnmount?: boolean;
|
|
1118
1209
|
}): LoadingState;
|
|
1119
|
-
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region src/hooks/useSessionStorage.d.ts
|
|
1120
1212
|
type parserOptions<T> = {
|
|
1121
|
-
|
|
1213
|
+
raw: true;
|
|
1122
1214
|
} | {
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1215
|
+
raw: false;
|
|
1216
|
+
serializer: (value: T) => string;
|
|
1217
|
+
deserializer: (value: string) => T;
|
|
1126
1218
|
};
|
|
1127
1219
|
/**
|
|
1128
1220
|
* Persist state in sessionStorage.
|
|
@@ -1133,17 +1225,21 @@ type parserOptions<T> = {
|
|
|
1133
1225
|
*
|
|
1134
1226
|
* On SSR/non-browser environments the hook returns `initialValue` and the setter/remove are no-ops.
|
|
1135
1227
|
*/
|
|
1136
|
-
declare const useSessionStorage: <T>(key: string, initialValue?: T, options?: parserOptions<T>) => [T | undefined, Dispatch<SetStateAction<T | undefined>>, () => void];
|
|
1137
|
-
|
|
1228
|
+
export declare const useSessionStorage: <T>(key: string, initialValue?: T, options?: parserOptions<T>) => [T | undefined, Dispatch<SetStateAction<T | undefined>>, () => void];
|
|
1229
|
+
//#endregion
|
|
1230
|
+
//#region src/hooks/useSessionStorageState.d.ts
|
|
1138
1231
|
/**
|
|
1139
1232
|
* @deprecated use useSessionStorage()
|
|
1140
1233
|
*/
|
|
1141
|
-
declare const useSessionStorageState: UseStorageState;
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1234
|
+
export declare const useSessionStorageState: UseStorageState;
|
|
1235
|
+
//#endregion
|
|
1236
|
+
//#region src/hooks/useSmOrDown.d.ts
|
|
1237
|
+
export declare function useSmOrDown(options?: UseMediaQueryOptions): boolean;
|
|
1238
|
+
//#endregion
|
|
1239
|
+
//#region src/hooks/useSmOrUp.d.ts
|
|
1240
|
+
export declare function useSmOrUp(options?: UseMediaQueryOptions): boolean;
|
|
1241
|
+
//#endregion
|
|
1242
|
+
//#region src/hooks/useThrottledCallback.d.ts
|
|
1147
1243
|
/**
|
|
1148
1244
|
* 주어진 콜백 함수를 지정된 시간 간격(`wait`)으로 호출하도록 제한하는 간단한 쓰로틀링 React 훅.
|
|
1149
1245
|
*
|
|
@@ -1163,9 +1259,10 @@ declare function useSmOrUp(options?: UseMediaQueryOptions): boolean;
|
|
|
1163
1259
|
* return <button onClick={throttledClick}>클릭</button>;
|
|
1164
1260
|
* ```
|
|
1165
1261
|
*/
|
|
1166
|
-
declare function useThrottledCallback<T extends (...args: any[]) => any>(callback: T
|
|
1167
|
-
wait: number): (...args: Parameters<T>) => void;
|
|
1168
|
-
|
|
1262
|
+
export declare function useThrottledCallback<T extends (...args: any[]) => any>(callback: T // 쓰로틀링할 콜백 함수
|
|
1263
|
+
, wait: number): (...args: Parameters<T>) => void;
|
|
1264
|
+
//#endregion
|
|
1265
|
+
//#region src/hooks/useThrottledCallbackWithClearTimeout.d.ts
|
|
1169
1266
|
/**
|
|
1170
1267
|
* 주어진 콜백 함수를 지정된 시간 간격(`wait`)으로 호출하는 커스텀 React 훅.
|
|
1171
1268
|
*
|
|
@@ -1191,9 +1288,10 @@ wait: number): (...args: Parameters<T>) => void;
|
|
|
1191
1288
|
* );
|
|
1192
1289
|
* ```
|
|
1193
1290
|
*/
|
|
1194
|
-
declare function useThrottledCallbackWithClearTimeout<T extends (...args: any[]) => any>(callback: T
|
|
1195
|
-
wait: number): readonly [(...args: Parameters<T>) => void, () => void];
|
|
1196
|
-
|
|
1291
|
+
export declare function useThrottledCallbackWithClearTimeout<T extends (...args: any[]) => any>(callback: T // 쓰로틀링할 콜백 함수
|
|
1292
|
+
, wait: number): readonly [(...args: Parameters<T>) => void, () => void];
|
|
1293
|
+
//#endregion
|
|
1294
|
+
//#region src/hooks/useThrottledState.d.ts
|
|
1197
1295
|
/**
|
|
1198
1296
|
* 쓰로틀링된 상태(state)와 상태를 업데이트하는 함수를 제공하는 React 커스텀 훅.
|
|
1199
1297
|
*
|
|
@@ -1220,9 +1318,10 @@ wait: number): readonly [(...args: Parameters<T>) => void, () => void];
|
|
|
1220
1318
|
* );
|
|
1221
1319
|
* ```
|
|
1222
1320
|
*/
|
|
1223
|
-
declare function useThrottledState<T>(defaultValue: T
|
|
1224
|
-
wait: number): readonly [T, (value: react.SetStateAction<T>) => void];
|
|
1225
|
-
|
|
1321
|
+
export declare function useThrottledState<T>(defaultValue: T // 초기 상태 값
|
|
1322
|
+
, wait: number): readonly [T, (value: import("react").SetStateAction<T>) => void];
|
|
1323
|
+
//#endregion
|
|
1324
|
+
//#region src/hooks/useThrottledValue.d.ts
|
|
1226
1325
|
/**
|
|
1227
1326
|
* 주어진 값을 쓰로틀링하여 지정된 시간 간격(`wait`) 후에 최신 값을 반환하는 커스텀 React 훅.
|
|
1228
1327
|
*
|
|
@@ -1240,8 +1339,9 @@ wait: number): readonly [T, (value: react.SetStateAction<T>) => void];
|
|
|
1240
1339
|
* return <p>쓰로틀링된 값: {throttledValue}</p>;
|
|
1241
1340
|
* ```
|
|
1242
1341
|
*/
|
|
1243
|
-
declare function useThrottledValue<T>(value: T, wait: number): T;
|
|
1244
|
-
|
|
1342
|
+
export declare function useThrottledValue<T>(value: T, wait: number): T;
|
|
1343
|
+
//#endregion
|
|
1344
|
+
//#region src/hooks/useTimeout.d.ts
|
|
1245
1345
|
/**
|
|
1246
1346
|
* 특정 작업을 일정 시간 후 실행할 수 있는 타이머 훅
|
|
1247
1347
|
*
|
|
@@ -1269,42 +1369,44 @@ declare function useThrottledValue<T>(value: T, wait: number): T;
|
|
|
1269
1369
|
* );
|
|
1270
1370
|
* ```
|
|
1271
1371
|
*/
|
|
1272
|
-
declare function useTimeout(callback: (...callbackParams: unknown[]) => void
|
|
1273
|
-
delay: number
|
|
1274
|
-
options?: {
|
|
1275
|
-
|
|
1372
|
+
export declare function useTimeout(callback: (...callbackParams: unknown[]) => void // 지연 시간이 지난 후 실행할 함수
|
|
1373
|
+
, delay: number // 타이머 지연 시간 (밀리초)
|
|
1374
|
+
, options?: {
|
|
1375
|
+
autoInvoke: boolean;
|
|
1276
1376
|
}): {
|
|
1277
|
-
|
|
1278
|
-
|
|
1377
|
+
start: (...callbackParams: unknown[]) => void;
|
|
1378
|
+
clear: () => void;
|
|
1279
1379
|
};
|
|
1280
|
-
|
|
1380
|
+
//#endregion
|
|
1381
|
+
//#region src/hooks/useTimeoutData.d.ts
|
|
1281
1382
|
/**
|
|
1282
1383
|
* 시간이 지나면 자동으로 사라지는 데이터
|
|
1283
1384
|
*/
|
|
1284
|
-
declare function useTimeoutData<T>(timeoutMs: number): [T | null, (t: T | null) => void];
|
|
1285
|
-
|
|
1385
|
+
export declare function useTimeoutData<T>(timeoutMs: number): [T | null, (t: T | null) => void];
|
|
1386
|
+
//#endregion
|
|
1387
|
+
//#region src/hooks/useUncontrolled.d.ts
|
|
1286
1388
|
interface UseUncontrolledInput<T> {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1389
|
+
/**
|
|
1390
|
+
* 제어 상태 값 (controlled state).
|
|
1391
|
+
* 값이 전달되면 해당 값이 항상 반환됩니다.
|
|
1392
|
+
*/
|
|
1393
|
+
value?: T;
|
|
1394
|
+
/**
|
|
1395
|
+
* 비제어 상태의 초기 값 (uncontrolled state).
|
|
1396
|
+
* `value`가 제공되지 않았을 때 사용됩니다.
|
|
1397
|
+
*/
|
|
1398
|
+
defaultValue?: T;
|
|
1399
|
+
/**
|
|
1400
|
+
* `value`와 `defaultValue`가 모두 제공되지 않을 때 사용되는 최종 기본 값.
|
|
1401
|
+
*/
|
|
1402
|
+
finalValue?: T;
|
|
1403
|
+
/**
|
|
1404
|
+
* 제어 상태 변화 시 호출되는 콜백 함수.
|
|
1405
|
+
*
|
|
1406
|
+
* @param value - 변경된 값
|
|
1407
|
+
* @param payload - 추가 데이터
|
|
1408
|
+
*/
|
|
1409
|
+
onChange?: (value: T, ...payload: unknown[]) => void;
|
|
1308
1410
|
}
|
|
1309
1411
|
/**
|
|
1310
1412
|
* 제어 상태와 비제어 상태를 동시에 지원하는 React 훅.
|
|
@@ -1326,16 +1428,21 @@ interface UseUncontrolledInput<T> {
|
|
|
1326
1428
|
* });
|
|
1327
1429
|
* ```
|
|
1328
1430
|
*/
|
|
1329
|
-
declare function useUncontrolled<T>({ value, defaultValue, finalValue, onChange
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
declare const
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1431
|
+
export declare function useUncontrolled<T>({ value, defaultValue, finalValue, onChange }: UseUncontrolledInput<T>): [T, (value: T, ...payload: unknown[]) => void, boolean];
|
|
1432
|
+
//#endregion
|
|
1433
|
+
//#region src/hooks/useUnmount.d.ts
|
|
1434
|
+
export declare const useUnmount: (fn: () => void) => void;
|
|
1435
|
+
//#endregion
|
|
1436
|
+
//#region src/hooks/useUpdate.d.ts
|
|
1437
|
+
export declare const useUpdate: () => () => void;
|
|
1438
|
+
//#endregion
|
|
1439
|
+
//#region src/hooks/useUpdateEffect.d.ts
|
|
1440
|
+
export declare const useUpdateEffect: (effect: EffectCallback, deps?: DependencyList) => void;
|
|
1441
|
+
//#endregion
|
|
1442
|
+
//#region src/hooks/useUpdateLayoutEffect.d.ts
|
|
1443
|
+
export declare const useUpdateLayoutEffect: (effect: EffectCallback, deps?: DependencyList) => void;
|
|
1444
|
+
//#endregion
|
|
1445
|
+
//#region src/hooks/useWindowEvent.d.ts
|
|
1339
1446
|
/**
|
|
1340
1447
|
* 지정된 타입의 윈도우 이벤트를 등록하고 관리하는 React 커스텀 훅.
|
|
1341
1448
|
*
|
|
@@ -1354,20 +1461,23 @@ declare const useUpdateLayoutEffect: (effect: EffectCallback, deps?: DependencyL
|
|
|
1354
1461
|
* });
|
|
1355
1462
|
* ```
|
|
1356
1463
|
*/
|
|
1357
|
-
declare function useWindowEvent<K extends string>(type: K
|
|
1358
|
-
listener: K extends keyof WindowEventMap ? (this: Window, ev: WindowEventMap[K]) => void : (this: Window, ev: CustomEvent) => void
|
|
1359
|
-
options?: boolean | AddEventListenerOptions): void;
|
|
1360
|
-
|
|
1464
|
+
export declare function useWindowEvent<K extends string>(type: K // 등록할 윈도우 이벤트의 타입
|
|
1465
|
+
, listener: K extends keyof WindowEventMap ? (this: Window, ev: WindowEventMap[K]) => void : (this: Window, ev: CustomEvent) => void // 사용자 정의 이벤트 리스너
|
|
1466
|
+
, options?: boolean | AddEventListenerOptions): void;
|
|
1467
|
+
//#endregion
|
|
1468
|
+
//#region src/hooks/useWindowSize.d.ts
|
|
1361
1469
|
interface Options {
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1470
|
+
initialWidth?: number;
|
|
1471
|
+
initialHeight?: number;
|
|
1472
|
+
onChange?: (width: number, height: number) => void;
|
|
1365
1473
|
}
|
|
1366
|
-
declare const useWindowSize: ({ initialWidth, initialHeight, onChange
|
|
1367
|
-
|
|
1368
|
-
|
|
1474
|
+
export declare const useWindowSize: ({ initialWidth, initialHeight, onChange }?: Options) => {
|
|
1475
|
+
width: number;
|
|
1476
|
+
height: number;
|
|
1369
1477
|
};
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1478
|
+
//#endregion
|
|
1479
|
+
//#region src/hooks/useXsOrDown.d.ts
|
|
1480
|
+
export declare function useXsOrDown(options?: UseMediaQueryOptions): boolean;
|
|
1481
|
+
//#endregion
|
|
1482
|
+
export { composeRefs, useComposedRefs, useObservable };
|
|
1483
|
+
//# sourceMappingURL=index.d.cts.map
|