Skip to content

Commit 899eea0

Browse files
docs(spark_web): update README with implemented but undocumented APIs
Mark Notification, Blob/File/FileList, CanvasRenderingContext2D, TextMetrics, and ImageData as Done (were incorrectly listed as TODO). Add missing files to the architecture diagram (canvas, file, geolocation, notification, permissions). Expand notes for Geolocation, Permissions, Event, and MouseEvent with previously unlisted properties.
1 parent 25ba555 commit 899eea0

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

packages/spark_web/README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,33 @@ spark_web/lib/
8484
├── dom.dart # Element, HTMLElement, Document, ShadowRoot, Text, Comment
8585
├── collections.dart # DOMTokenList, NamedNodeMap, Attr
8686
├── css.dart # CSSStyleSheet, CSSStyleDeclaration
87+
├── canvas.dart # CanvasRenderingContext2D, TextMetrics, ImageData
88+
├── file.dart # Blob, File, FileList
89+
├── geolocation.dart # Geolocation, GeolocationPosition, GeolocationCoordinates
90+
├── notification.dart # Notification, NotificationOptions, NotificationAction
91+
├── permissions.dart # Permissions, PermissionStatus, PermissionDescriptor
8792
├── window.dart # Window, Storage, Location, History, Navigator, Console, ...
8893
├── server/ # Server implementations (no-ops / Dart-native fallbacks)
8994
│ ├── factory.dart
9095
│ ├── dom.dart
9196
│ ├── collections.dart
9297
│ ├── css.dart
98+
│ ├── canvas.dart
99+
│ ├── file.dart
100+
│ ├── geolocation.dart
101+
│ ├── notification.dart
102+
│ ├── permissions.dart
93103
│ └── window.dart
94104
└── browser/ # Browser implementations (wrap package:web)
95105
├── factory.dart
96106
├── dom.dart
97107
├── collections.dart
98108
├── css.dart
109+
├── canvas.dart
110+
├── file.dart
111+
├── geolocation.dart
112+
├── notification.dart
113+
├── permissions.dart
99114
└── window.dart
100115
```
101116

@@ -108,8 +123,8 @@ The table below tracks what percentage of the [MDN Web API](https://developer.mo
108123
| API | Status | Notes |
109124
|-----|--------|-------|
110125
| `EventTarget` | ✅ Done | `addEventListener`, `removeEventListener`, `dispatchEvent` |
111-
| `Event` | ✅ Done | `type`, `target`, `currentTarget`, `preventDefault`, `stopPropagation` |
112-
| `MouseEvent` | ✅ Done | `clientX/Y`, `pageX/Y`, `screenX/Y`, `button`, modifier keys |
126+
| `Event` | ✅ Done | `type`, `target`, `currentTarget`, `bubbles`, `cancelable`, `preventDefault`, `stopPropagation`, `stopImmediatePropagation` |
127+
| `MouseEvent` | ✅ Done | `clientX/Y`, `pageX/Y`, `screenX/Y`, `button`, `buttons`, modifier keys |
113128
| `KeyboardEvent` | ✅ Done | `key`, `code`, `repeat`, `location`, modifier keys |
114129
| `InputEvent` | ✅ Done | `data`, `inputType`, `isComposing` |
115130
| `FocusEvent` | ✅ Done | `relatedTarget` |
@@ -243,8 +258,9 @@ The table below tracks what percentage of the [MDN Web API](https://developer.mo
243258
| `EventSource` | ❌ TODO | Server-sent events |
244259
| `XMLHttpRequest` | ❌ TODO | Legacy — consider skipping |
245260
| `FormData` | ❌ TODO | `append`, `get`, `set`, `entries` |
246-
| `Blob` | ❌ TODO | `size`, `type`, `text()`, `arrayBuffer()`, `slice()` |
247-
| `File` | ❌ TODO | `name`, `lastModified`, `size`, `type` |
261+
| `Blob` | ✅ Done | `size`, `type`, `text()`, `arrayBuffer()`, `slice()`, `stream()` |
262+
| `File` | ✅ Done | `name`, `lastModified` (extends Blob) |
263+
| `FileList` | ✅ Done | `length`, `item()` |
248264
| `FileReader` | ❌ TODO | `readAsText()`, `readAsDataURL()`, `result` |
249265

250266
### Observers
@@ -260,9 +276,10 @@ The table below tracks what percentage of the [MDN Web API](https://developer.mo
260276

261277
| API | Status | Notes |
262278
|-----|--------|-------|
263-
| `CanvasRenderingContext2D` | ❌ TODO | Drawing primitives |
279+
| `CanvasRenderingContext2D` | ✅ Done | Full 2D drawing: rect, path, arc, bezier, text, image, pixel manipulation, transforms, state save/restore, line dash, compositing |
280+
| `TextMetrics` | ✅ Done | `width`, `actualBoundingBoxLeft/Right/Ascent/Descent`, `fontBoundingBoxAscent/Descent` |
281+
| `ImageData` | ✅ Done | `width`, `height`, `data` |
264282
| `OffscreenCanvas` | ❌ TODO | |
265-
| `ImageData` | ❌ TODO | |
266283
| `Path2D` | ❌ TODO | |
267284
| `WebGLRenderingContext` | ❌ TODO | Consider out of scope |
268285
| `WebGL2RenderingContext` | ❌ TODO | Consider out of scope |
@@ -309,9 +326,9 @@ The table below tracks what percentage of the [MDN Web API](https://developer.mo
309326
| `TextDecoder` | ❌ TODO | `decode()` |
310327
| `structuredClone()` | ❌ TODO | |
311328
| `queueMicrotask()` | ❌ TODO | |
312-
| `Notification` | ❌ TODO | |
313-
| `Geolocation` | ✅ Done | |
314-
| `Permissions` | ✅ Done | `query()`, `PermissionStatus`, `PermissionDescriptor` |
329+
| `Notification` | ✅ Done | `title`, `body`, `icon`, `tag`, `close()`, `NotificationOptions`, `NotificationAction`, `requestPermission()` |
330+
| `Geolocation` | ✅ Done | `getCurrentPosition`, `watchPosition`, `clearWatch`, `GeolocationPosition`, `GeolocationCoordinates`, `PositionOptions` |
331+
| `Permissions` | ✅ Done | `query()`, `PermissionStatus`, `PermissionState`, `PermissionName`, `PermissionDescriptor` (+ Push, Midi, Device variants) |
315332
| `FullScreen API` | ❌ TODO | `requestFullscreen()`, `exitFullscreen()` |
316333

317334
---

0 commit comments

Comments
 (0)