@simplysm/core-browser 13.0.100 → 14.0.4
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 +183 -65
- package/dist/extensions/element-ext.d.ts +36 -36
- package/dist/extensions/element-ext.d.ts.map +1 -1
- package/dist/extensions/element-ext.js +132 -111
- package/dist/extensions/element-ext.js.map +1 -6
- package/dist/extensions/html-element-ext.d.ts +22 -22
- package/dist/extensions/html-element-ext.js +50 -45
- package/dist/extensions/html-element-ext.js.map +1 -6
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -6
- package/dist/utils/IndexedDbStore.js +115 -112
- package/dist/utils/IndexedDbStore.js.map +1 -6
- package/dist/utils/IndexedDbVirtualFs.js +81 -83
- package/dist/utils/IndexedDbVirtualFs.js.map +1 -6
- package/dist/utils/download.d.ts +3 -3
- package/dist/utils/download.js +18 -14
- package/dist/utils/download.js.map +1 -6
- package/dist/utils/fetch.d.ts +1 -1
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js +46 -36
- package/dist/utils/fetch.js.map +1 -6
- package/dist/utils/file-dialog.d.ts +1 -1
- package/dist/utils/file-dialog.js +19 -19
- package/dist/utils/file-dialog.js.map +1 -6
- package/package.json +7 -10
- package/src/extensions/element-ext.ts +40 -40
- package/src/extensions/html-element-ext.ts +24 -24
- package/src/index.ts +3 -3
- package/src/utils/IndexedDbStore.ts +3 -3
- package/src/utils/download.ts +3 -3
- package/src/utils/fetch.ts +17 -5
- package/src/utils/file-dialog.ts +1 -1
- package/docs/classes.md +0 -184
- package/docs/element-extensions.md +0 -134
- package/docs/html-element-extensions.md +0 -56
- package/docs/utilities.md +0 -71
- package/tests/extensions/element-ext.spec.ts +0 -693
- package/tests/extensions/html-element-ext.spec.ts +0 -175
- package/tests/utils/IndexedDbStore.spec.ts +0 -103
- package/tests/utils/IndexedDbVirtualFs.spec.ts +0 -171
- package/tests/utils/download.spec.ts +0 -66
- package/tests/utils/fetch.spec.ts +0 -154
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @simplysm/core-browser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Core browser utilities -- DOM extensions, file operations, IndexedDB wrappers.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -8,99 +8,217 @@ Simplysm package - Core module (browser). Browser-only utilities including DOM e
|
|
|
8
8
|
npm install @simplysm/core-browser
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## API
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
### Extensions
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
| Export | Kind | Description |
|
|
16
|
+
|--------|------|-------------|
|
|
17
|
+
| `ElementBounds` | interface | Element bounding rectangle data |
|
|
18
|
+
| Element prototype extensions | side-effect import | DOM query/traversal helpers added to `Element.prototype` |
|
|
19
|
+
| HTMLElement prototype extensions | side-effect import | Repaint, relative offset, scroll helpers added to `HTMLElement.prototype` |
|
|
20
|
+
| `copyElement` | function | Copy element content to clipboard |
|
|
21
|
+
| `pasteToElement` | function | Paste clipboard content to element |
|
|
22
|
+
| `getBounds` | async function | Get element bounds via IntersectionObserver |
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
### Utils
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
| Export | Kind | Description |
|
|
27
|
+
|--------|------|-------------|
|
|
28
|
+
| `downloadBlob` | function | Download a Blob as a file |
|
|
29
|
+
| `DownloadProgress` | interface | Progress info for byte fetching |
|
|
30
|
+
| `fetchUrlBytes` | async function | Fetch URL content as `Uint8Array` with progress |
|
|
31
|
+
| `openFileDialog` | function | Open a native file picker dialog |
|
|
32
|
+
| `StoreConfig` | interface | IndexedDB store configuration |
|
|
33
|
+
| `IndexedDbStore` | class | IndexedDB key-value store wrapper |
|
|
34
|
+
| `VirtualFsEntry` | interface | Virtual filesystem entry descriptor |
|
|
35
|
+
| `IndexedDbVirtualFs` | class | Virtual filesystem backed by IndexedDB |
|
|
36
|
+
|
|
37
|
+
## Extensions
|
|
38
|
+
|
|
39
|
+
### ElementBounds (interface)
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
interface ElementBounds {
|
|
43
|
+
target: Element;
|
|
44
|
+
top: number;
|
|
45
|
+
left: number;
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
}
|
|
49
|
+
```
|
|
21
50
|
|
|
22
|
-
### Element
|
|
51
|
+
### Element prototype extensions (side-effect import)
|
|
23
52
|
|
|
24
|
-
|
|
25
|
-
|-----|------|-------------|
|
|
26
|
-
| `ElementBounds` | interface | Element bounds info (`target`, `top`, `left`, `width`, `height`) |
|
|
27
|
-
| `Element.findAll` | prototype method | Find all child elements matching a CSS selector |
|
|
28
|
-
| `Element.findFirst` | prototype method | Find first element matching a CSS selector |
|
|
29
|
-
| `Element.prependChild` | prototype method | Insert element as first child |
|
|
30
|
-
| `Element.getParents` | prototype method | Get all parent elements (closest to farthest) |
|
|
31
|
-
| `Element.findFocusableParent` | prototype method | Find first focusable parent element |
|
|
32
|
-
| `Element.findFirstFocusableChild` | prototype method | Find first focusable child element |
|
|
33
|
-
| `Element.isOffsetElement` | prototype method | Check if element has offset positioning |
|
|
34
|
-
| `Element.isVisible` | prototype method | Check if element is visible on screen |
|
|
35
|
-
| `copyElement` | function | Copy element content to clipboard via ClipboardEvent |
|
|
36
|
-
| `pasteToElement` | function | Paste clipboard content to element via ClipboardEvent |
|
|
37
|
-
| `getBounds` | function | Get bounds for multiple elements using IntersectionObserver |
|
|
53
|
+
Import `@simplysm/core-browser` to activate these extensions on `Element.prototype`.
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
| Method | Signature | Description |
|
|
56
|
+
|--------|-----------|-------------|
|
|
57
|
+
| `findAll` | `findAll<TEl>(selector: string): TEl[]` | Find all matching descendants |
|
|
58
|
+
| `findFirst` | `findFirst<TEl>(selector: string): TEl \| undefined` | Find first matching descendant |
|
|
59
|
+
| `prependChild` | `prependChild<TEl>(child: TEl): TEl` | Prepend a child element |
|
|
60
|
+
| `getParents` | `getParents(): Element[]` | Get all ancestor elements |
|
|
61
|
+
| `findFocusableParent` | `findFocusableParent(): HTMLElement \| undefined` | Find nearest focusable ancestor |
|
|
62
|
+
| `findFirstFocusableChild` | `findFirstFocusableChild(): HTMLElement \| undefined` | Find first focusable descendant |
|
|
63
|
+
| `isOffsetElement` | `isOffsetElement(): boolean` | Check if element is an offset parent |
|
|
64
|
+
| `isVisible` | `isVisible(): boolean` | Check if element is visible |
|
|
40
65
|
|
|
41
|
-
### HTMLElement
|
|
66
|
+
### HTMLElement prototype extensions (side-effect import)
|
|
42
67
|
|
|
43
|
-
|
|
|
44
|
-
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
68
|
+
| Method | Signature | Description |
|
|
69
|
+
|--------|-----------|-------------|
|
|
70
|
+
| `repaint` | `repaint(): void` | Force a repaint of the element |
|
|
71
|
+
| `getRelativeOffset` | `getRelativeOffset(parent: HTMLElement \| string): { top: number; left: number }` | Get position relative to a parent |
|
|
72
|
+
| `scrollIntoViewIfNeeded` | `scrollIntoViewIfNeeded(target: { top: number; left: number }, offset?: { top: number; left: number }): void` | Scroll to make target position visible |
|
|
48
73
|
|
|
49
|
-
|
|
74
|
+
### copyElement
|
|
50
75
|
|
|
51
|
-
|
|
76
|
+
```ts
|
|
77
|
+
function copyElement(event: ClipboardEvent): void
|
|
78
|
+
```
|
|
52
79
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
Copy the content of the focused element to the clipboard via a `ClipboardEvent`.
|
|
81
|
+
|
|
82
|
+
### pasteToElement
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
function pasteToElement(event: ClipboardEvent): void
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Paste clipboard content into the focused element via a `ClipboardEvent`.
|
|
89
|
+
|
|
90
|
+
### getBounds
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
async function getBounds(els: Element[], timeout?: number): Promise<ElementBounds[]>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Get bounding rectangles for multiple elements using `IntersectionObserver`. An optional `timeout` (ms) limits the observation duration.
|
|
97
|
+
|
|
98
|
+
## Utils
|
|
99
|
+
|
|
100
|
+
### downloadBlob
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
function downloadBlob(blob: Blob, fileName: string): void
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Trigger a browser download for the given `Blob` with the specified file name.
|
|
107
|
+
|
|
108
|
+
### DownloadProgress (interface)
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
interface DownloadProgress {
|
|
112
|
+
receivedLength: number;
|
|
113
|
+
contentLength: number;
|
|
114
|
+
}
|
|
115
|
+
```
|
|
59
116
|
|
|
60
|
-
|
|
117
|
+
### fetchUrlBytes
|
|
61
118
|
|
|
62
|
-
|
|
119
|
+
```ts
|
|
120
|
+
async function fetchUrlBytes(
|
|
121
|
+
url: string,
|
|
122
|
+
options?: { onProgress?: (progress: DownloadProgress) => void },
|
|
123
|
+
): Promise<Uint8Array>
|
|
124
|
+
```
|
|
63
125
|
|
|
64
|
-
|
|
65
|
-
|-----|------|-------------|
|
|
66
|
-
| `StoreConfig` | interface | IndexedDB store configuration (`name`, `keyPath`) |
|
|
67
|
-
| `IndexedDbStore` | class | IndexedDB wrapper for key-value storage |
|
|
68
|
-
| `VirtualFsEntry` | interface | Virtual file system entry (`kind`, `dataBase64`) |
|
|
69
|
-
| `IndexedDbVirtualFs` | class | IndexedDB-backed virtual file system |
|
|
126
|
+
Fetch URL content as a `Uint8Array`. Optionally reports download progress via `onProgress`.
|
|
70
127
|
|
|
71
|
-
|
|
128
|
+
### openFileDialog
|
|
72
129
|
|
|
73
|
-
|
|
130
|
+
```ts
|
|
131
|
+
function openFileDialog(options?: {
|
|
132
|
+
accept?: string;
|
|
133
|
+
multiple?: boolean;
|
|
134
|
+
}): Promise<File[] | undefined>
|
|
135
|
+
```
|
|
74
136
|
|
|
75
|
-
|
|
137
|
+
Open a native file picker dialog. Returns selected files, or `undefined` if cancelled.
|
|
76
138
|
|
|
77
|
-
|
|
78
|
-
import { downloadBlob } from "@simplysm/core-browser";
|
|
139
|
+
### StoreConfig (interface)
|
|
79
140
|
|
|
80
|
-
|
|
81
|
-
|
|
141
|
+
```ts
|
|
142
|
+
interface StoreConfig {
|
|
143
|
+
name: string;
|
|
144
|
+
keyPath: string;
|
|
145
|
+
}
|
|
82
146
|
```
|
|
83
147
|
|
|
84
|
-
###
|
|
148
|
+
### IndexedDbStore (class)
|
|
149
|
+
|
|
150
|
+
IndexedDB wrapper providing simple key-value operations.
|
|
85
151
|
|
|
86
|
-
|
|
87
|
-
import { openFileDialog } from "@simplysm/core-browser";
|
|
152
|
+
**Constructor:**
|
|
88
153
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
154
|
+
```ts
|
|
155
|
+
constructor(dbName: string, dbVersion: number, storeConfigs: StoreConfig[])
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Methods:**
|
|
159
|
+
|
|
160
|
+
| Method | Signature | Description |
|
|
161
|
+
|--------|-----------|-------------|
|
|
162
|
+
| `open` | `open(): Promise<IDBDatabase>` | Open the database connection |
|
|
163
|
+
| `withStore` | `withStore<T>(storeName: string, mode: IDBTransactionMode, fn: (store: IDBObjectStore) => IDBRequest<T>): Promise<T>` | Execute a single-store transaction |
|
|
164
|
+
| `get` | `get<T>(storeName: string, key: IDBValidKey): Promise<T \| undefined>` | Get a value by key |
|
|
165
|
+
| `put` | `put(storeName: string, value: unknown): Promise<void>` | Insert or update a value |
|
|
166
|
+
| `delete` | `delete(storeName: string, key: IDBValidKey): Promise<void>` | Delete a value by key |
|
|
167
|
+
| `getAll` | `getAll<T>(storeName: string): Promise<T[]>` | Get all values in a store |
|
|
168
|
+
| `close` | `close(): void` | Close the database connection |
|
|
169
|
+
|
|
170
|
+
### VirtualFsEntry (interface)
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
interface VirtualFsEntry {
|
|
174
|
+
kind: "file" | "dir";
|
|
175
|
+
dataBase64?: string;
|
|
94
176
|
}
|
|
95
177
|
```
|
|
96
178
|
|
|
97
|
-
###
|
|
179
|
+
### IndexedDbVirtualFs (class)
|
|
180
|
+
|
|
181
|
+
Virtual filesystem backed by an `IndexedDbStore`. Stores files and directories as entries in IndexedDB.
|
|
182
|
+
|
|
183
|
+
**Constructor:**
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
constructor(db: IndexedDbStore, storeName: string, keyField: string)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Methods:**
|
|
190
|
+
|
|
191
|
+
| Method | Signature | Description |
|
|
192
|
+
|--------|-----------|-------------|
|
|
193
|
+
| `getEntry` | `getEntry(fullKey: string): Promise<VirtualFsEntry \| undefined>` | Get a filesystem entry by key |
|
|
194
|
+
| `putEntry` | `putEntry(fullKey: string, kind: "file" \| "dir", dataBase64?: string): Promise<void>` | Create or update a filesystem entry |
|
|
195
|
+
| `deleteByPrefix` | `deleteByPrefix(keyPrefix: string): Promise<boolean>` | Delete all entries matching a key prefix |
|
|
196
|
+
| `listChildren` | `listChildren(prefix: string): Promise<{ name: string; isDirectory: boolean }[]>` | List immediate children of a directory |
|
|
197
|
+
| `ensureDir` | `ensureDir(fullKeyBuilder: (dir: string) => string, dirPath: string): Promise<void>` | Recursively ensure a directory path exists |
|
|
198
|
+
|
|
199
|
+
## Usage
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
import "@simplysm/core-browser"; // activate prototype extensions
|
|
203
|
+
|
|
204
|
+
// DOM extensions
|
|
205
|
+
const el = document.querySelector(".my-element")!;
|
|
206
|
+
const parents = el.getParents();
|
|
207
|
+
const child = el.findFirst<HTMLDivElement>(".child");
|
|
208
|
+
|
|
209
|
+
// File download
|
|
210
|
+
import { downloadBlob, fetchUrlBytes } from "@simplysm/core-browser";
|
|
211
|
+
|
|
212
|
+
const bytes = await fetchUrlBytes("/api/data.bin", {
|
|
213
|
+
onProgress: (p) => console.log(`${p.receivedLength}/${p.contentLength}`),
|
|
214
|
+
});
|
|
215
|
+
downloadBlob(new Blob([bytes]), "data.bin");
|
|
98
216
|
|
|
99
|
-
|
|
217
|
+
// IndexedDB store
|
|
100
218
|
import { IndexedDbStore } from "@simplysm/core-browser";
|
|
101
219
|
|
|
102
|
-
const store = new IndexedDbStore("
|
|
103
|
-
await store.put("
|
|
104
|
-
const item = await store.get
|
|
220
|
+
const store = new IndexedDbStore("myDb", 1, [{ name: "items", keyPath: "id" }]);
|
|
221
|
+
await store.put("items", { id: "1", value: "hello" });
|
|
222
|
+
const item = await store.get("items", "1");
|
|
105
223
|
store.close();
|
|
106
224
|
```
|
|
@@ -1,98 +1,98 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 요소 경계 정보 타입
|
|
3
3
|
*/
|
|
4
4
|
export interface ElementBounds {
|
|
5
|
-
/**
|
|
5
|
+
/** 측정 대상 요소 */
|
|
6
6
|
target: Element;
|
|
7
|
-
/**
|
|
7
|
+
/** 뷰포트 기준 상단 위치 */
|
|
8
8
|
top: number;
|
|
9
|
-
/**
|
|
9
|
+
/** 뷰포트 기준 좌측 위치 */
|
|
10
10
|
left: number;
|
|
11
|
-
/**
|
|
11
|
+
/** 요소 너비 */
|
|
12
12
|
width: number;
|
|
13
|
-
/**
|
|
13
|
+
/** 요소 높이 */
|
|
14
14
|
height: number;
|
|
15
15
|
}
|
|
16
16
|
declare global {
|
|
17
17
|
interface Element {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* 선택자와 일치하는 모든 하위 요소 검색
|
|
20
20
|
*
|
|
21
|
-
* @param selector - CSS
|
|
22
|
-
* @returns
|
|
21
|
+
* @param selector - CSS 선택자
|
|
22
|
+
* @returns 일치하는 요소 배열 (빈 선택자는 빈 배열 반환)
|
|
23
23
|
*/
|
|
24
24
|
findAll<TEl extends Element = Element>(selector: string): TEl[];
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* 선택자와 일치하는 첫 번째 요소 검색
|
|
27
27
|
*
|
|
28
|
-
* @param selector - CSS
|
|
29
|
-
* @returns
|
|
28
|
+
* @param selector - CSS 선택자
|
|
29
|
+
* @returns 첫 번째 일치 요소 또는 undefined (빈 선택자는 undefined 반환)
|
|
30
30
|
*/
|
|
31
31
|
findFirst<TEl extends Element = Element>(selector: string): TEl | undefined;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* 요소를 첫 번째 자식으로 삽입
|
|
34
34
|
*
|
|
35
|
-
* @param child -
|
|
36
|
-
* @returns
|
|
35
|
+
* @param child - 삽입할 자식 요소
|
|
36
|
+
* @returns 삽입된 자식 요소
|
|
37
37
|
*/
|
|
38
38
|
prependChild<TEl extends Element>(child: TEl): TEl;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* 모든 부모 요소 조회 (가까운 순서)
|
|
41
41
|
*
|
|
42
|
-
* @returns
|
|
42
|
+
* @returns 부모 요소 배열 (가장 가까운 것부터 먼 것 순)
|
|
43
43
|
*/
|
|
44
44
|
getParents(): Element[];
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* 첫 번째 포커스 가능한 부모 요소 검색 (tabbable 사용)
|
|
47
47
|
*
|
|
48
|
-
* @returns
|
|
48
|
+
* @returns 첫 번째 포커스 가능한 부모 요소 또는 undefined
|
|
49
49
|
*/
|
|
50
50
|
findFocusableParent(): HTMLElement | undefined;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* 첫 번째 포커스 가능한 자식 요소 검색 (tabbable 사용)
|
|
53
53
|
*
|
|
54
|
-
* @returns
|
|
54
|
+
* @returns 첫 번째 포커스 가능한 자식 요소 또는 undefined
|
|
55
55
|
*/
|
|
56
56
|
findFirstFocusableChild(): HTMLElement | undefined;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* 요소가 offset parent인지 확인 (position: relative/absolute/fixed/sticky)
|
|
59
59
|
*
|
|
60
|
-
* @returns
|
|
60
|
+
* @returns position 속성이 relative, absolute, fixed, sticky 중 하나이면 true
|
|
61
61
|
*/
|
|
62
62
|
isOffsetElement(): boolean;
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
64
|
+
* 요소가 화면에 보이는지 확인
|
|
65
65
|
*
|
|
66
66
|
* @remarks
|
|
67
|
-
*
|
|
67
|
+
* clientRects 존재 여부, visibility: hidden, opacity: 0을 확인합니다.
|
|
68
68
|
*
|
|
69
|
-
* @returns
|
|
69
|
+
* @returns 요소가 화면에 보이면 true
|
|
70
70
|
*/
|
|
71
71
|
isVisible(): boolean;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* 요소 내용을 클립보드에 복사 (copy 이벤트 핸들러와 함께 사용)
|
|
76
76
|
*
|
|
77
|
-
* @param event - copy
|
|
77
|
+
* @param event - copy 이벤트 객체
|
|
78
78
|
*/
|
|
79
79
|
export declare function copyElement(event: ClipboardEvent): void;
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* 클립보드 내용을 요소에 붙여넣기 (paste 이벤트 핸들러와 함께 사용)
|
|
82
82
|
*
|
|
83
83
|
* @remarks
|
|
84
|
-
*
|
|
85
|
-
*
|
|
84
|
+
* 대상 요소 내의 첫 번째 input/textarea를 찾아 전체 값을 클립보드 내용으로 교체합니다.
|
|
85
|
+
* 커서 위치나 선택 영역은 고려하지 않습니다.
|
|
86
86
|
*
|
|
87
|
-
* @param event - paste
|
|
87
|
+
* @param event - paste 이벤트 객체
|
|
88
88
|
*/
|
|
89
89
|
export declare function pasteToElement(event: ClipboardEvent): void;
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* IntersectionObserver를 사용하여 요소의 경계 정보 조회
|
|
92
92
|
*
|
|
93
|
-
* @param els -
|
|
94
|
-
* @param timeout -
|
|
95
|
-
* @throws {TimeoutError}
|
|
93
|
+
* @param els - 대상 요소 배열
|
|
94
|
+
* @param timeout - 타임아웃 밀리초 (기본값: 5000)
|
|
95
|
+
* @throws {TimeoutError} 타임아웃 시간 내에 응답이 없는 경우
|
|
96
96
|
*/
|
|
97
97
|
export declare function getBounds(els: Element[], timeout?: number): Promise<ElementBounds[]>;
|
|
98
98
|
//# sourceMappingURL=element-ext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-ext.d.ts","sourceRoot":"","sources":["..\\..\\src\\extensions\\element-ext.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,
|
|
1
|
+
{"version":3,"file":"element-ext.d.ts","sourceRoot":"","sources":["..\\..\\src\\extensions\\element-ext.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,eAAe;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,mBAAmB;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,OAAO;QACf;;;;;WAKG;QACH,OAAO,CAAC,GAAG,SAAS,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,EAAE,CAAC;QAEhE;;;;;WAKG;QACH,SAAS,CAAC,GAAG,SAAS,OAAO,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC;QAE5E;;;;;WAKG;QACH,YAAY,CAAC,GAAG,SAAS,OAAO,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG,CAAC;QAEnD;;;;WAIG;QACH,UAAU,IAAI,OAAO,EAAE,CAAC;QAExB;;;;WAIG;QACH,mBAAmB,IAAI,WAAW,GAAG,SAAS,CAAC;QAE/C;;;;WAIG;QACH,uBAAuB,IAAI,WAAW,GAAG,SAAS,CAAC;QAEnD;;;;WAIG;QACH,eAAe,IAAI,OAAO,CAAC;QAE3B;;;;;;;WAOG;QACH,SAAS,IAAI,OAAO,CAAC;KACtB;CACF;AAkED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAYvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAa1D;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,OAAO,GAAE,MAAa,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAoDhG"}
|