@ac-kit/browser 0.2.0 → 0.4.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/CHANGELOG.md +193 -0
- package/README.md +239 -11
- package/dist/animation-frame/frame-scheduler.d.ts +91 -0
- package/dist/animation-frame/frame-scheduler.d.ts.map +1 -0
- package/dist/animation-frame/frame-scheduler.js +181 -0
- package/dist/animation-frame/frame-scheduler.js.map +1 -0
- package/dist/canvas/canvas-backing-size.d.ts +58 -0
- package/dist/canvas/canvas-backing-size.d.ts.map +1 -0
- package/dist/canvas/canvas-backing-size.js +141 -0
- package/dist/canvas/canvas-backing-size.js.map +1 -0
- package/dist/canvas/image-data-pixels.d.ts +1 -1
- package/dist/canvas/image-data-pixels.d.ts.map +1 -1
- package/dist/canvas/image-data-pixels.js +2 -5
- package/dist/canvas/image-data-pixels.js.map +1 -1
- package/dist/canvas/read-image-data.d.ts.map +1 -1
- package/dist/canvas/read-image-data.js +2 -2
- package/dist/canvas/read-image-data.js.map +1 -1
- package/dist/dom/drag-and-drop/file-drop-zone.d.ts +71 -0
- package/dist/dom/drag-and-drop/file-drop-zone.d.ts.map +1 -0
- package/dist/dom/drag-and-drop/file-drop-zone.js +145 -0
- package/dist/dom/drag-and-drop/file-drop-zone.js.map +1 -0
- package/dist/dom/forms/get-form-input.d.ts +17 -0
- package/dist/dom/forms/get-form-input.d.ts.map +1 -0
- package/dist/dom/forms/get-form-input.js +35 -0
- package/dist/dom/forms/get-form-input.js.map +1 -0
- package/dist/dom/index.d.ts +5 -0
- package/dist/dom/index.d.ts.map +1 -1
- package/dist/dom/index.js +5 -0
- package/dist/dom/index.js.map +1 -1
- package/dist/dom/media-query/watch-media-query.d.ts +26 -0
- package/dist/dom/media-query/watch-media-query.d.ts.map +1 -0
- package/dist/dom/media-query/watch-media-query.js +42 -0
- package/dist/dom/media-query/watch-media-query.js.map +1 -0
- package/dist/dom/resize-observer/observe-canvas-size.d.ts +54 -0
- package/dist/dom/resize-observer/observe-canvas-size.d.ts.map +1 -0
- package/dist/dom/resize-observer/observe-canvas-size.js +189 -0
- package/dist/dom/resize-observer/observe-canvas-size.js.map +1 -0
- package/dist/dom/user-activation/user-activation.d.ts +54 -0
- package/dist/dom/user-activation/user-activation.d.ts.map +1 -0
- package/dist/dom/user-activation/user-activation.js +93 -0
- package/dist/dom/user-activation/user-activation.js.map +1 -0
- package/dist/dom/web-animations/wait-for-transitions.d.ts.map +1 -1
- package/dist/dom/web-animations/wait-for-transitions.js +2 -6
- package/dist/dom/web-animations/wait-for-transitions.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/indexeddb/open-indexed-db.d.ts +1 -1
- package/dist/indexeddb/open-indexed-db.d.ts.map +1 -1
- package/dist/indexeddb/open-indexed-db.js +3 -1
- package/dist/indexeddb/open-indexed-db.js.map +1 -1
- package/dist/media-capture/microphone-access.d.ts.map +1 -1
- package/dist/media-capture/microphone-access.js +4 -6
- package/dist/media-capture/microphone-access.js.map +1 -1
- package/dist/permissions/_untracked-permission-watch.d.ts +4 -0
- package/dist/permissions/_untracked-permission-watch.d.ts.map +1 -0
- package/dist/permissions/_untracked-permission-watch.js +5 -0
- package/dist/permissions/_untracked-permission-watch.js.map +1 -0
- package/dist/permissions/watch-permission.d.ts +38 -0
- package/dist/permissions/watch-permission.d.ts.map +1 -0
- package/dist/permissions/watch-permission.js +58 -0
- package/dist/permissions/watch-permission.js.map +1 -0
- package/dist/temporal/enable-temporal.d.ts +44 -0
- package/dist/temporal/enable-temporal.d.ts.map +1 -0
- package/dist/temporal/enable-temporal.js +70 -0
- package/dist/temporal/enable-temporal.js.map +1 -0
- package/dist/testing/fake-animation-frames.d.ts +31 -0
- package/dist/testing/fake-animation-frames.d.ts.map +1 -0
- package/dist/testing/fake-animation-frames.js +75 -0
- package/dist/testing/fake-animation-frames.js.map +1 -0
- package/dist/testing/fake-audio-context.js +2 -2
- package/dist/testing/fake-audio-context.js.map +1 -1
- package/dist/testing/fake-match-media.d.ts +19 -0
- package/dist/testing/fake-match-media.d.ts.map +1 -0
- package/dist/testing/fake-match-media.js +135 -0
- package/dist/testing/fake-match-media.js.map +1 -0
- package/dist/testing/fake-media-devices.js +2 -2
- package/dist/testing/fake-media-devices.js.map +1 -1
- package/dist/testing/fake-permissions.d.ts +48 -0
- package/dist/testing/fake-permissions.d.ts.map +1 -0
- package/dist/testing/fake-permissions.js +90 -0
- package/dist/testing/fake-permissions.js.map +1 -0
- package/dist/testing/fake-resize-observer.d.ts +58 -0
- package/dist/testing/fake-resize-observer.d.ts.map +1 -0
- package/dist/testing/fake-resize-observer.js +118 -0
- package/dist/testing/fake-resize-observer.js.map +1 -0
- package/dist/testing/fake-web-midi.d.ts +26 -3
- package/dist/testing/fake-web-midi.d.ts.map +1 -1
- package/dist/testing/fake-web-midi.js +62 -2
- package/dist/testing/fake-web-midi.js.map +1 -1
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/web-audio/audio-clock-mapping.d.ts +36 -14
- package/dist/web-audio/audio-clock-mapping.d.ts.map +1 -1
- package/dist/web-audio/audio-clock-mapping.js +147 -35
- package/dist/web-audio/audio-clock-mapping.js.map +1 -1
- package/dist/web-midi/_midi-port.d.ts +4 -0
- package/dist/web-midi/_midi-port.d.ts.map +1 -0
- package/dist/web-midi/_midi-port.js +12 -0
- package/dist/web-midi/_midi-port.js.map +1 -0
- package/dist/web-midi/web-midi-access.d.ts +20 -0
- package/dist/web-midi/web-midi-access.d.ts.map +1 -1
- package/dist/web-midi/web-midi-access.js +31 -0
- package/dist/web-midi/web-midi-access.js.map +1 -1
- package/dist/web-midi/web-midi-inputs.d.ts.map +1 -1
- package/dist/web-midi/web-midi-inputs.js +1 -11
- package/dist/web-midi/web-midi-inputs.js.map +1 -1
- package/dist/web-midi/web-midi-pinned-input.d.ts +124 -0
- package/dist/web-midi/web-midi-pinned-input.d.ts.map +1 -0
- package/dist/web-midi/web-midi-pinned-input.js +177 -0
- package/dist/web-midi/web-midi-pinned-input.js.map +1 -0
- package/dist/xhr/send-with-progress.d.ts.map +1 -1
- package/dist/xhr/send-with-progress.js +3 -0
- package/dist/xhr/send-with-progress.js.map +1 -1
- package/package.json +20 -7
- package/dist/_race-abort.d.ts +0 -2
- package/dist/_race-abort.d.ts.map +0 -1
- package/dist/_race-abort.js +0 -20
- package/dist/_race-abort.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,198 @@
|
|
|
1
1
|
# @ac-kit/browser
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0b4fe43: `AudioClockMapping` takes a step up in the offset under jitter. A step up is
|
|
8
|
+
now taken from a steady run of any length of at least `readyTicks` ticks, each
|
|
9
|
+
more than `jumpMs` above the least offset of the ticks before it, whose floor
|
|
10
|
+
is flat: the lower convex hull of the run's offsets falls by at most
|
|
11
|
+
`steadyMs / 4` per `readyTicks − 1` ticks over the run's middle half, and the
|
|
12
|
+
least offset of its later half is at most `steadyMs` above its earlier half's.
|
|
13
|
+
Ticks may jitter above that floor: the run then has to be long enough that the
|
|
14
|
+
least offset of half of it, for the jitter width the run and the ticks before it
|
|
15
|
+
show, lies on average within half the allowed fall. Clean ticks still give a
|
|
16
|
+
step in `readyTicks` ticks; ticks jittering by 8 ms or more, which never made a
|
|
17
|
+
step before and kept the old minimum until it left the window, now give one —
|
|
18
|
+
about 15 ticks at 8 ms, a tick every 50 ms and `steadyMs` 5. A backlog draining
|
|
19
|
+
after a freeze and jank are still refused.
|
|
20
|
+
|
|
21
|
+
Migration: `steadyMs` no longer bounds the spread of the run's offsets; it bounds
|
|
22
|
+
how far the floor of the run may move. A step whose ticks spread by more than
|
|
23
|
+
`steadyMs` above a flat floor, refused before, is taken now; a backlog whose
|
|
24
|
+
floor falls between `steadyMs / 4` and `steadyMs / 2` per `readyTicks − 1`
|
|
25
|
+
ticks, taken before when clean, is refused.
|
|
26
|
+
- 0b4fe43: New in `@ac-kit/browser/dom`:
|
|
27
|
+
|
|
28
|
+
- `bindFileDropZone(element, { onDrop, onActiveChange?, dropEffect?, signal? })`
|
|
29
|
+
makes an element take files dropped on it. A drag carrying files
|
|
30
|
+
(`dataTransfer.types` includes `"Files"`) over the element or any node inside
|
|
31
|
+
it is accepted with the cursor showing `dropEffect` (`"copy"` by default),
|
|
32
|
+
and the drop calls `onDrop(files, event)` (never with no file) with the page
|
|
33
|
+
kept; other drags are left alone. `onActiveChange(isActive)` tells when a
|
|
34
|
+
drag of files comes over the zone and when it leaves, is dropped or is given
|
|
35
|
+
up; moving over the zone's own nodes keeps it active, whether or not
|
|
36
|
+
`dragleave` names a `relatedTarget` (Safari does not) and when the node under
|
|
37
|
+
the drag leaves the document. The returned `FileDropZone` reads `isActive`;
|
|
38
|
+
disposing it, or aborting `signal`, stops the binding without a call.
|
|
39
|
+
- `preventFileDropNavigation(window, { signal? })` keeps a file dropped where
|
|
40
|
+
no zone takes it from replacing the page: such a drag shows the "no drop"
|
|
41
|
+
cursor and its drop is cancelled, while a zone's own drop effect is kept.
|
|
42
|
+
- `isFileDrag(event)` tells whether a drag event carries files, narrowing it
|
|
43
|
+
to `FileDragEvent`.
|
|
44
|
+
- `bindUserActivation(target, { onActivation, once?, navigator?, signal? })`
|
|
45
|
+
calls `onActivation(event)` synchronously inside each event that gives the
|
|
46
|
+
page a user activation, listening in the capture phase and passively, so a
|
|
47
|
+
handler stopping or cancelling the event hides nothing. Given `navigator`, it
|
|
48
|
+
calls `onActivation(undefined)` at once when `navigator.userActivation`
|
|
49
|
+
reports a transient activation. `isActivationTriggeringEvent(event)` is the
|
|
50
|
+
HTML standard's definition: a trusted `keydown` other than Escape,
|
|
51
|
+
`mousedown`, a mouse's `pointerdown`, another pointer's `pointerup`, or
|
|
52
|
+
`touchend`.
|
|
53
|
+
- `getFormInput(form.elements, name)` returns the named `<input>` of a form's
|
|
54
|
+
controls and throws a `TypeError` for a missing name, a name several controls
|
|
55
|
+
share, or another kind of control; it recognises an `<input>` by tag and
|
|
56
|
+
namespace, so forms of other windows work too.
|
|
57
|
+
|
|
58
|
+
New at the root:
|
|
59
|
+
|
|
60
|
+
- `enableTemporal(scope, { load, onWarning })` makes `scope.Temporal`
|
|
61
|
+
(`globalThis`, or a worker's `self`) a complete Temporal: a native one is
|
|
62
|
+
kept; when it is missing or lacks `ZonedDateTime.prototype.getTimeZoneTransition`,
|
|
63
|
+
the `Temporal` of the module `load()` resolves to (such as
|
|
64
|
+
`import("temporal-polyfill/implementation")`) is installed as a writable,
|
|
65
|
+
configurable, non-enumerable property. `load` runs only then. It resolves to
|
|
66
|
+
whether Temporal is complete afterwards; when not, `onWarning(message, cause)`
|
|
67
|
+
was told why (the module failed to load, is not a complete Temporal, or the
|
|
68
|
+
scope refused it). Overlapping calls install a single fallback.
|
|
69
|
+
|
|
70
|
+
The package gains `yarn test:browser`, its real-browser tests.
|
|
71
|
+
- 0b4fe43: Permissions followed, and a Web MIDI input opened and pinned.
|
|
72
|
+
|
|
73
|
+
- `watchPermission(navigator.permissions, descriptor, { onChange?, signal? })`
|
|
74
|
+
follows a permission through the browser's `PermissionStatus` and its
|
|
75
|
+
`change` events: `state` is the current one (the last known once disposed),
|
|
76
|
+
`onChange(state)` hears each change, and disposing the watch, or aborting
|
|
77
|
+
`signal`, stops it. Where the browser cannot query the permission the state
|
|
78
|
+
is `"prompt"` and `isTracked` is `false`. Aborting `signal` before the
|
|
79
|
+
browser answers rejects with its reason.
|
|
80
|
+
- `watchWebMidiPermission(navigator, { sysex?, onChange?, signal? })` is that
|
|
81
|
+
watch for the MIDI permission `queryWebMidiPermission` reads, `"unsupported"`
|
|
82
|
+
(untracked) without Web MIDI.
|
|
83
|
+
- `findWebMidiInput(access, selector)` finds the one connected input of
|
|
84
|
+
`{ id }` or `{ name, manufacturer? }` (any manufacturer when left out):
|
|
85
|
+
`{ status: "found", port }`, `{ status: "missing" }`, or
|
|
86
|
+
`{ status: "ambiguous", ports }`.
|
|
87
|
+
- `openWebMidiInput(access, selector, { signal? })` opens that input with
|
|
88
|
+
`MIDIPort.open()` and resolves to a `WebMidiPinnedInput` bound to that port
|
|
89
|
+
object: `message` events carry each `midimessage`'s bytes and `timeStamp`;
|
|
90
|
+
when the port is unplugged, leaves the list or is closed elsewhere, `lost`
|
|
91
|
+
fires once, `isOpen` becomes `false` and the port is closed — another port
|
|
92
|
+
of the same name is never taken up (`WebMidiInputs` keeps following by
|
|
93
|
+
identity). It rejects, without opening anything it refuses, with
|
|
94
|
+
`WebMidiInputNotFoundError` (no connected match, or the port went while
|
|
95
|
+
opening), `WebMidiInputAmbiguousError` (several matches, in `ports`), or
|
|
96
|
+
`WebMidiInputUnavailableError` (the browser refused to open it; its
|
|
97
|
+
`DOMException` as `cause`). Aborting `signal` rejects at once with its reason
|
|
98
|
+
and closes the port once the browser has opened it; after opening, it
|
|
99
|
+
disposes the input. Disposing closes the port without a `lost` event. It
|
|
100
|
+
takes the browser's `MIDIAccess` (`WebMidiOpenableAccess`).
|
|
101
|
+
|
|
102
|
+
`@ac-kit/browser/testing`:
|
|
103
|
+
|
|
104
|
+
- `FakePermissions` and `FakePermissionStatus`: `navigator.permissions` for the
|
|
105
|
+
names given, each `"prompt"` until `set(descriptor, state)` changes it and
|
|
106
|
+
fires `change` on every status queried for it; other names are refused with a
|
|
107
|
+
`TypeError`; `queries` records the descriptors.
|
|
108
|
+
- `FakeMidiInput` gains `connection`, `open()` (`"open"`, or `"pending"` while
|
|
109
|
+
unplugged), `close()` now setting `"closed"`, `openCount`, `holdOpen()` and a
|
|
110
|
+
one-shot `openFailure`; each connection change fires `statechange` on the
|
|
111
|
+
port and on its `FakeMidiAccess`, as a browser does. `FakeMidiAccess` moves
|
|
112
|
+
an open port to `"pending"` on `unplug` and back to `"open"` on `plug`.
|
|
113
|
+
|
|
114
|
+
### Patch Changes
|
|
115
|
+
|
|
116
|
+
- Updated dependencies [0b4fe43]
|
|
117
|
+
- Updated dependencies [0b4fe43]
|
|
118
|
+
- Updated dependencies [0b4fe43]
|
|
119
|
+
- Updated dependencies [0b4fe43]
|
|
120
|
+
- Updated dependencies [0b4fe43]
|
|
121
|
+
- Updated dependencies [0b4fe43]
|
|
122
|
+
- Updated dependencies [0b4fe43]
|
|
123
|
+
- Updated dependencies [0b4fe43]
|
|
124
|
+
- Updated dependencies [0b4fe43]
|
|
125
|
+
- Updated dependencies [0b4fe43]
|
|
126
|
+
- Updated dependencies [0b4fe43]
|
|
127
|
+
- Updated dependencies [0b4fe43]
|
|
128
|
+
- Updated dependencies [0b4fe43]
|
|
129
|
+
- Updated dependencies [0b4fe43]
|
|
130
|
+
- Updated dependencies [0b4fe43]
|
|
131
|
+
- Updated dependencies [0b4fe43]
|
|
132
|
+
- Updated dependencies [0b4fe43]
|
|
133
|
+
- @ac-kit/core@0.13.0
|
|
134
|
+
- @ac-kit/async@0.8.1
|
|
135
|
+
|
|
136
|
+
## 0.3.0
|
|
137
|
+
|
|
138
|
+
### Minor Changes
|
|
139
|
+
|
|
140
|
+
- 34e8cfa: `watchMediaQuery(window, query, { onChange?, signal? })` (from
|
|
141
|
+
`@ac-kit/browser/dom`) follows a media query such as `(prefers-reduced-motion:
|
|
142
|
+
reduce)`: its `matches` is the current value, `onChange` hears each change, and
|
|
143
|
+
disposing it, or aborting `signal`, stops the listening. It throws a
|
|
144
|
+
`TypeError` for a window without `matchMedia`. `./testing` gains
|
|
145
|
+
`FakeMatchMedia`, a `matchMedia` whose queries the test flips.
|
|
146
|
+
- 34e8cfa: Adds canvas sizing and frame scheduling. `canvasBackingSize(box, caps)` gives
|
|
147
|
+
the whole-pixel backing size of a canvas: the device-pixel size exactly when the
|
|
148
|
+
browser reports it and no cap applies, else the CSS size times the ratio,
|
|
149
|
+
rounded, and floored under `maxPixelRatio`, `maxPixels` or `maxSide` so the cap
|
|
150
|
+
holds; a worker takes the sizes the page sends. `observeCanvasSize` (from
|
|
151
|
+
`@ac-kit/browser/dom`) keeps a canvas at that size, follows ratio changes with
|
|
152
|
+
or without `devicePixelContentBoxSize`, assigns the canvas only when its size
|
|
153
|
+
differs, ignores a hidden canvas, and calls `onResize` after layout and before
|
|
154
|
+
paint. `FrameScheduler` renders on animation frames at most once each, on
|
|
155
|
+
`invalidate()` or every frame while `continuous`, with a capped frame delta,
|
|
156
|
+
`renderNow()` and `AbortSignal` or `Symbol.dispose` stop. `./testing` gains
|
|
157
|
+
`FakeAnimationFrames` and `FakeResizeObserver`.
|
|
158
|
+
|
|
159
|
+
### Patch Changes
|
|
160
|
+
|
|
161
|
+
- 34e8cfa: An error message that quotes an argument of the wrong kind or value describes
|
|
162
|
+
it with `@ac-kit/core`'s `describeValue`, so building the message can no
|
|
163
|
+
longer throw on a symbol. The text changes: `-0` keeps its sign (`got -0`), a
|
|
164
|
+
string is JSON-quoted and an object is named by its kind. Affected:
|
|
165
|
+
`bigIntParse`'s radix, `decodeFloat64Base64`'s counts, `formatDuration`'s
|
|
166
|
+
value, `RateLimiter`'s `maxKeys`, cost and clock time, `TokenBucket`'s
|
|
167
|
+
capacity, refill rate and cost, `getBackoffDelay`'s attempt, delays and
|
|
168
|
+
factor, `retry`'s `maxAttempts`, `maxElapsedMs` and `delayMs`, `BitSet` and
|
|
169
|
+
`BitVector`'s size and members, the LRU caches', `TtlMap`'s and the bounded
|
|
170
|
+
collections' capacity, `TtlMap`'s time to live, `MultiSet`'s occurrence
|
|
171
|
+
count, `BloomFilter`, `CountMinSketch`, `CuckooFilter`, `HyperLogLog` and
|
|
172
|
+
`TopK`'s sizing options, `RingVector`, `SegmentedRingVector` and
|
|
173
|
+
`TypedVector`'s capacities and indexes, `openIndexedDb`'s version and
|
|
174
|
+
`readImageData`'s size.
|
|
175
|
+
- Updated dependencies [34e8cfa]
|
|
176
|
+
- Updated dependencies [34e8cfa]
|
|
177
|
+
- Updated dependencies [34e8cfa]
|
|
178
|
+
- Updated dependencies [34e8cfa]
|
|
179
|
+
- Updated dependencies [34e8cfa]
|
|
180
|
+
- Updated dependencies [34e8cfa]
|
|
181
|
+
- Updated dependencies [34e8cfa]
|
|
182
|
+
- Updated dependencies [34e8cfa]
|
|
183
|
+
- Updated dependencies [34e8cfa]
|
|
184
|
+
- Updated dependencies [34e8cfa]
|
|
185
|
+
- Updated dependencies [34e8cfa]
|
|
186
|
+
- Updated dependencies [34e8cfa]
|
|
187
|
+
- Updated dependencies [34e8cfa]
|
|
188
|
+
- Updated dependencies [34e8cfa]
|
|
189
|
+
- Updated dependencies [34e8cfa]
|
|
190
|
+
- Updated dependencies [34e8cfa]
|
|
191
|
+
- Updated dependencies [34e8cfa]
|
|
192
|
+
- Updated dependencies [34e8cfa]
|
|
193
|
+
- @ac-kit/async@0.8.0
|
|
194
|
+
- @ac-kit/core@0.12.0
|
|
195
|
+
|
|
3
196
|
## 0.2.0
|
|
4
197
|
|
|
5
198
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Browser extensions and zero-dependency wrappers over browser APIs, the
|
|
4
4
|
browser's counterpart of `@ac-kit/node`: IndexedDB as promises, with versioned
|
|
5
|
-
upgrades; Web MIDI, with access asked for
|
|
6
|
-
followed by its name across reloads and hot-plugs
|
|
5
|
+
upgrades; Web MIDI, with access asked for, its permission followed, the input
|
|
6
|
+
port a person chose followed by its name across reloads and hot-plugs, or one
|
|
7
|
+
port opened and pinned; the microphone opened for
|
|
7
8
|
analysis, its permission and its devices; an audio clock mapped onto the
|
|
8
9
|
page's; requests over
|
|
9
10
|
`XMLHttpRequest` that report their upload progress, which `fetch` cannot; an
|
|
10
|
-
image's pixels read through a canvas, scaled down;
|
|
11
|
-
|
|
11
|
+
image's pixels read through a canvas, scaled down; a canvas's backing store
|
|
12
|
+
kept at its displayed size in device pixels; rendering on animation frames at
|
|
13
|
+
most once each; the wait for an element's CSS transitions to end; files
|
|
14
|
+
dropped on an element, with the page guarded; what a user activation allows,
|
|
15
|
+
called inside it; a form's inputs read checked; and a Temporal fallback
|
|
16
|
+
installed where the browser lacks one.
|
|
12
17
|
|
|
13
18
|
Every function takes the browser object it works through — `indexedDB`,
|
|
14
19
|
`navigator`, a `MIDIAccess`, `XMLHttpRequest`, a canvas factory, an element —
|
|
@@ -139,6 +144,54 @@ if ((await queryWebMidiPermission(navigator)) !== "unsupported") {
|
|
|
139
144
|
- `isSameMidiPort` — whether two port identities (name and manufacturer) are
|
|
140
145
|
the same device; a port's id changes between sessions, its identity does not.
|
|
141
146
|
|
|
147
|
+
```ts
|
|
148
|
+
import {
|
|
149
|
+
openWebMidiInput,
|
|
150
|
+
requestWebMidiAccess,
|
|
151
|
+
watchWebMidiPermission,
|
|
152
|
+
} from "@ac-kit/browser";
|
|
153
|
+
|
|
154
|
+
// Follow the permission: no snapshot, the user may answer or change it later.
|
|
155
|
+
using permission = await watchWebMidiPermission(navigator, {
|
|
156
|
+
onChange: (state) => showAccessButton(state === "prompt"),
|
|
157
|
+
signal,
|
|
158
|
+
});
|
|
159
|
+
const access = await requestWebMidiAccess(navigator, { software: true });
|
|
160
|
+
// Pin the one port of that name: refused when several match, lost for good
|
|
161
|
+
// when it goes.
|
|
162
|
+
using input = await openWebMidiInput(access, { name: "Bridge" }, { signal });
|
|
163
|
+
input.subscribe("message", (data, time) => relay(data, time));
|
|
164
|
+
input.subscribe("lost", () => fallBackToTheServer());
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
- `watchWebMidiPermission(navigator, { sysex?, onChange?, signal? })` — the
|
|
168
|
+
permission `queryWebMidiPermission` reads, followed through the browser's
|
|
169
|
+
`PermissionStatus` and its `change` events: `state` is the current one,
|
|
170
|
+
`onChange(state)` hears each change, disposing it (or aborting `signal`)
|
|
171
|
+
stops. `"unsupported"` without Web MIDI and `"prompt"` where the browser
|
|
172
|
+
cannot query it, both with `isTracked: false`, never change. Aborting
|
|
173
|
+
`signal` before the browser answers rejects with its reason.
|
|
174
|
+
- `findWebMidiInput(access, selector)` — the one connected input a selector
|
|
175
|
+
names (`{ id }`, or `{ name, manufacturer? }` with any manufacturer when
|
|
176
|
+
left out): `{ status: "found", port }`, `"missing"`, or `"ambiguous"` with
|
|
177
|
+
every match in `ports`. Disconnected ports never match.
|
|
178
|
+
- `openWebMidiInput(access, selector, { signal? })` — opens that input
|
|
179
|
+
explicitly (`MIDIPort.open()`) and pins it: `message` hands over its bytes
|
|
180
|
+
with their time of arrival, until the port is unplugged, leaves the list or
|
|
181
|
+
is closed by other code, when `lost` is told once and the input is closed
|
|
182
|
+
for good — a port of the same name plugged in later is never taken up, as
|
|
183
|
+
`WebMidiInputs` would. It rejects with `WebMidiInputNotFoundError` (none
|
|
184
|
+
connected, or gone while opening), `WebMidiInputAmbiguousError` (several,
|
|
185
|
+
listed in `ports`: the choice is the person's) or
|
|
186
|
+
`WebMidiInputUnavailableError` (the browser refused to open it, as when
|
|
187
|
+
another application holds it; its `DOMException` as `cause`), without
|
|
188
|
+
opening a port it refuses. Aborting `signal` rejects at once with its reason
|
|
189
|
+
(the port is closed once the browser opened it), or disposes the input once
|
|
190
|
+
open. Disposing it closes the port, telling no loss.
|
|
191
|
+
- `watchPermission(permissions, descriptor, { onChange?, signal? })` — the same
|
|
192
|
+
watch for any permission (`{ name: "microphone" }`, …), from
|
|
193
|
+
`navigator.permissions`.
|
|
194
|
+
|
|
142
195
|
## Microphone
|
|
143
196
|
|
|
144
197
|
```ts
|
|
@@ -217,14 +270,20 @@ if (mapping.isReady) {
|
|
|
217
270
|
slow drift is followed. It starts again, and is not ready until
|
|
218
271
|
`readyTicks` more ticks, on `reset()` (a context suspended and resumed, a
|
|
219
272
|
worklet restarted), when the audio clock goes backwards, on a tick more
|
|
220
|
-
than `jumpMs` below the window's least `page − audio`, or on
|
|
221
|
-
ticks
|
|
222
|
-
|
|
273
|
+
than `jumpMs` below the window's least `page − audio`, or on a steady run
|
|
274
|
+
of ticks more than `jumpMs` above it: at least `readyTicks` of them, whose
|
|
275
|
+
floor (the lower convex hull of their offsets) does not fall by
|
|
276
|
+
`steadyMs / 4` per `readyTicks − 1` ticks (a backlog draining after a
|
|
277
|
+
freeze does), and whose later half does not rise `steadyMs` above the
|
|
278
|
+
earlier one. Jitter above the floor is
|
|
279
|
+
tolerated: it lengthens the run needed, from the jitter the run and the
|
|
280
|
+
ticks before it show, so ticks jittering by 8 ms every 50 ms take a step
|
|
281
|
+
in about 15 ticks rather than when the old minimum leaves the window, while
|
|
282
|
+
jank, spread far above its floor, never makes a run. `toPageMs` and
|
|
223
283
|
`toAudioMs` convert either way once ready, and throw before; `resetCount`
|
|
224
284
|
counts the restarts. A tick arriving before the previous one, or a time not
|
|
225
|
-
finite, throws `RangeError`.
|
|
226
|
-
|
|
227
|
-
offset on its own once the older ticks leave it. It reads no clock: it runs
|
|
285
|
+
finite, throws `RangeError`. A step whose run never gets steady is taken
|
|
286
|
+
once the older ticks leave the window. It reads no clock: it runs
|
|
228
287
|
in a worker or under Node as well. O(n) per tick and per conversion, n the
|
|
229
288
|
ticks in the window, held in a ring buffer: a tick allocates nothing.
|
|
230
289
|
|
|
@@ -366,6 +425,159 @@ panel.classList.remove("is-hidden");
|
|
|
366
425
|
`AbortSignal.timeout()`, or `@ac-kit/async`'s `withTimeout`, where that
|
|
367
426
|
matters.
|
|
368
427
|
|
|
428
|
+
## Canvas size
|
|
429
|
+
|
|
430
|
+
```ts
|
|
431
|
+
import { FrameScheduler } from "@ac-kit/browser";
|
|
432
|
+
import { observeCanvasSize } from "@ac-kit/browser/dom";
|
|
433
|
+
|
|
434
|
+
const controller = new AbortController();
|
|
435
|
+
const scheduler = new FrameScheduler(window, () => draw(), {
|
|
436
|
+
signal: controller.signal,
|
|
437
|
+
});
|
|
438
|
+
observeCanvasSize(canvas, {
|
|
439
|
+
maxPixelRatio: 2,
|
|
440
|
+
// After layout, before paint: draw now rather than one stretched frame.
|
|
441
|
+
onResize: () => scheduler.renderNow(),
|
|
442
|
+
signal: controller.signal,
|
|
443
|
+
});
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
- `canvasBackingSize(box, { maxPixelRatio?, maxPixels?, maxSide? })` — the
|
|
447
|
+
whole-pixel size `canvas.width` and `canvas.height` must hold for a content
|
|
448
|
+
box: the device-pixel size exactly when the browser gives it
|
|
449
|
+
(`devicePixelContentBoxSize`, not Safari) and no cap applies, else the CSS
|
|
450
|
+
size times the page's ratio, rounded; where a cap binds it is floored, so
|
|
451
|
+
rounding never passes a cap. Pure, so a worker drawing on an
|
|
452
|
+
`OffscreenCanvas` takes the sizes the page sends. It throws a `RangeError`
|
|
453
|
+
for a negative or non-finite size, or one too large for whole pixels.
|
|
454
|
+
- `observeCanvasSize(canvas, { onResize, resizeCanvas?, signal?, …caps })`
|
|
455
|
+
(from `/dom`) — keeps the backing store at the displayed size. It uses the
|
|
456
|
+
canvas's own window's `ResizeObserver`, on `device-pixel-content-box` where
|
|
457
|
+
supported (that also fires when the ratio changes, on another screen),
|
|
458
|
+
else on `content-box` plus a `resolution` media query. `onResize` is
|
|
459
|
+
called at the first layout and whenever the backing size changes, never
|
|
460
|
+
for a hidden (empty) canvas. The canvas is assigned only when its size
|
|
461
|
+
differs, since assigning resets it; `resizeCanvas: false` leaves it to a
|
|
462
|
+
worker. The canvas's CSS size must not depend on its `width` and `height`
|
|
463
|
+
attributes, or the backing size feeds back into the layout. Returns a
|
|
464
|
+
`Disposable`.
|
|
465
|
+
|
|
466
|
+
## Frames
|
|
467
|
+
|
|
468
|
+
- `watchMediaQuery(window, query, { onChange?, signal? })` (from `/dom`) —
|
|
469
|
+
follows a media query such as `(prefers-reduced-motion: reduce)`: `matches`
|
|
470
|
+
is the current value, `onChange(matches)` hears each change, and disposing it
|
|
471
|
+
(or aborting `signal`) stops the listening. It throws a `TypeError` for a
|
|
472
|
+
window without `matchMedia`. `@ac-kit/browser/testing`'s `FakeMatchMedia`
|
|
473
|
+
stands in for `window.matchMedia` under Node: `set(query, matches)` flips a
|
|
474
|
+
query and fires `change`.
|
|
475
|
+
|
|
476
|
+
- `FrameScheduler(frames, render, { continuous?, maxDeltaSeconds?, clock?,
|
|
477
|
+
signal? })` — renders on animation frames, at most once each: after
|
|
478
|
+
`invalidate()` (calls before the frame coalesce), or every frame while
|
|
479
|
+
`continuous`. `FrameInfo` carries the frame's `time`, `deltaSeconds`
|
|
480
|
+
(0 on the first frame of a run, capped at `maxDeltaSeconds`, 0.1 by
|
|
481
|
+
default, so a tab back from the background does not jump) and `index`.
|
|
482
|
+
`renderNow()` renders at once and cancels a pending frame. Disposing, or
|
|
483
|
+
aborting `signal`, cancels the pending frame. `frames` is `window` or a
|
|
484
|
+
worker's global scope. A hidden page gets no frames, so a pending render
|
|
485
|
+
waits for it to be shown.
|
|
486
|
+
|
|
487
|
+
For a simulation stepped at a fixed rate under the frame rate, see
|
|
488
|
+
`FixedTimestep` in `@ac-kit/async`.
|
|
489
|
+
|
|
490
|
+
## File drop
|
|
491
|
+
|
|
492
|
+
```ts
|
|
493
|
+
import {
|
|
494
|
+
bindFileDropZone,
|
|
495
|
+
preventFileDropNavigation,
|
|
496
|
+
} from "@ac-kit/browser/dom";
|
|
497
|
+
|
|
498
|
+
using guard = preventFileDropNavigation(window, { signal });
|
|
499
|
+
using zone = bindFileDropZone(list, {
|
|
500
|
+
onDrop: (files) => importSongs(files),
|
|
501
|
+
onActiveChange: (isActive) => list.classList.toggle("drop-target", isActive),
|
|
502
|
+
signal,
|
|
503
|
+
});
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
- `bindFileDropZone(element, { onDrop, onActiveChange?, dropEffect?, signal? })`
|
|
507
|
+
(from `/dom`) — makes an element take files dropped on it: a drag of files
|
|
508
|
+
(`dataTransfer.types` has `"Files"`) over it or any node inside it is
|
|
509
|
+
accepted, the cursor showing `dropEffect` (`"copy"` by default), and the drop
|
|
510
|
+
hands `onDrop` its files (never none) with the page kept. A drag of text, a
|
|
511
|
+
link or an element of the page is left alone. `onActiveChange(isActive)`
|
|
512
|
+
tells when the drag comes over the zone and when it leaves, is dropped or is
|
|
513
|
+
given up; moving over the zone's own nodes keeps it active, whichever node
|
|
514
|
+
`dragleave` names (Safari gives it no `relatedTarget`) and even when the node
|
|
515
|
+
under the drag leaves the document. `isActive` reads it. Disposing (or
|
|
516
|
+
aborting `signal`) stops the binding without telling.
|
|
517
|
+
- `preventFileDropNavigation(window, { signal? })` (from `/dom`) — keeps a file
|
|
518
|
+
dropped where no zone takes it from replacing the page, as a browser does by
|
|
519
|
+
opening it: such a drag shows the "no drop" cursor and its drop is
|
|
520
|
+
cancelled; a zone's own drop effect is kept.
|
|
521
|
+
- `isFileDrag(event)` (from `/dom`) — whether a drag event carries files.
|
|
522
|
+
|
|
523
|
+
## User activation
|
|
524
|
+
|
|
525
|
+
```ts
|
|
526
|
+
import { bindUserActivation } from "@ac-kit/browser/dom";
|
|
527
|
+
|
|
528
|
+
using unlock = bindUserActivation(window, {
|
|
529
|
+
onActivation: () => void audioContext.resume(),
|
|
530
|
+
navigator,
|
|
531
|
+
signal,
|
|
532
|
+
});
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
- `bindUserActivation(target, { onActivation, once?, navigator?, signal? })`
|
|
536
|
+
(from `/dom`) — calls `onActivation(event)` synchronously inside each event
|
|
537
|
+
that gives the page a user activation, so it may start audio, enter full
|
|
538
|
+
screen or open a window even where the browser allows it only during the
|
|
539
|
+
event (Safari). It listens on `target` (the page's `window`, or an element)
|
|
540
|
+
in the capture phase and passively, so a handler stopping or cancelling the
|
|
541
|
+
event hides nothing. With `navigator`, it is called at once (with
|
|
542
|
+
`undefined`) when `navigator.userActivation.isActive` says the page has a
|
|
543
|
+
transient activation already, as when bound from a click's handler. One
|
|
544
|
+
press can be two activating events (a tap's `pointerup` and `touchend`):
|
|
545
|
+
make it idempotent, or pass `once`.
|
|
546
|
+
- `isActivationTriggeringEvent(event)` (from `/dom`) — the HTML standard's
|
|
547
|
+
definition: a trusted `keydown` but Escape, `mousedown`, a mouse's
|
|
548
|
+
`pointerdown`, a touch's or a pen's `pointerup`, `touchend`. A `click`
|
|
549
|
+
follows one of those; a script's event is none.
|
|
550
|
+
|
|
551
|
+
## Form inputs
|
|
552
|
+
|
|
553
|
+
- `getFormInput(form.elements, name)` (from `/dom`) — the `<input>` a form's
|
|
554
|
+
controls name, checked rather than cast: a missing name, one several
|
|
555
|
+
controls share (a `RadioNodeList`, as a radio group is), or another control
|
|
556
|
+
(`<select>`, `<textarea>`, …) throw a `TypeError`. It reads the tag and
|
|
557
|
+
namespace, not `instanceof`, so a form of an `<iframe>` is read alike.
|
|
558
|
+
|
|
559
|
+
## Temporal
|
|
560
|
+
|
|
561
|
+
```ts
|
|
562
|
+
import { enableTemporal } from "@ac-kit/browser";
|
|
563
|
+
|
|
564
|
+
const hasTemporal = await enableTemporal(globalThis, {
|
|
565
|
+
load: () => import("temporal-polyfill/implementation"),
|
|
566
|
+
onWarning: (message, cause) => console.warn(`Heliotrope: ${message}`, cause),
|
|
567
|
+
});
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
- `enableTemporal(scope, { load, onWarning })` — makes sure `scope.Temporal`
|
|
571
|
+
(`globalThis`, or a worker's `self`) is a complete Temporal: a native one is
|
|
572
|
+
kept, and where it is missing or of the shape before the finished proposal
|
|
573
|
+
(no `ZonedDateTime.prototype.getTimeZoneTransition`), the one `load` gives is
|
|
574
|
+
installed as a built-in would be. `load` runs only then, so the bundler puts
|
|
575
|
+
the fallback in a chunk only those browsers fetch; this package depends on no
|
|
576
|
+
polyfill and reimplements nothing. It answers whether Temporal is complete
|
|
577
|
+
now; when not — the fallback failed to load, is not complete, or the scope
|
|
578
|
+
refused it — `onWarning(message, cause)` was told why. Overlapping calls
|
|
579
|
+
install one fallback.
|
|
580
|
+
|
|
369
581
|
## Testing
|
|
370
582
|
|
|
371
583
|
```ts
|
|
@@ -413,7 +625,19 @@ helpers, and code built on them, take — for tests under Node, not for a page:
|
|
|
413
625
|
hands it to `port.onPostMessage` where the test runs the processor's logic,
|
|
414
626
|
and delivers what the test `emit`s.
|
|
415
627
|
- `FakeMidiAccess` and `FakeMidiInput` — ports plugged in and out, messages
|
|
416
|
-
sent with their time stamps
|
|
628
|
+
sent with their time stamps; `open()` and `close()` move `connection`
|
|
629
|
+
(`"open"`, `"pending"` while unplugged, `"closed"`) with a `statechange`,
|
|
630
|
+
counted (`openCount`, `closeCount`), held (`holdOpen`) or refused once
|
|
631
|
+
(`openFailure`).
|
|
632
|
+
- `FakePermissions` — `navigator.permissions` for the names it is given, each
|
|
633
|
+
`"prompt"` until `set(descriptor, state)` changes it and fires `change` on
|
|
634
|
+
every `FakePermissionStatus` queried for it; another name is refused with a
|
|
635
|
+
`TypeError`, as a browser refuses one it cannot query. `queries` records
|
|
636
|
+
each descriptor.
|
|
637
|
+
- `FakeAnimationFrames` — `requestAnimationFrame` queueing, `runFrame(time)`
|
|
638
|
+
running what was queued before the call.
|
|
639
|
+
- `FakeResizeObserver` — records what is observed, delivers `resize(size)`
|
|
640
|
+
entries, and can refuse `device-pixel-content-box` as Safari does.
|
|
417
641
|
|
|
418
642
|
They import no test runner: calls are recorded as data (`requests`,
|
|
419
643
|
`posted`, `modules`, `connections`, `stopCount`, `closeCount`…), and a
|
|
@@ -440,3 +664,7 @@ for the full reference.
|
|
|
440
664
|
- [HTML Standard: the 2D rendering context](https://html.spec.whatwg.org/multipage/canvas.html#2dcontext)
|
|
441
665
|
- [Web Animations](https://www.w3.org/TR/web-animations-1/)
|
|
442
666
|
- [CSS Transitions](https://www.w3.org/TR/css-transitions-1/)
|
|
667
|
+
- [HTML Standard: drag and drop](https://html.spec.whatwg.org/multipage/dnd.html)
|
|
668
|
+
- [HTML Standard: user activation](https://html.spec.whatwg.org/multipage/interaction.html#tracking-user-activation)
|
|
669
|
+
- [Permissions](https://www.w3.org/TR/permissions/)
|
|
670
|
+
- [Temporal](https://tc39.es/proposal-temporal/)
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type Callable, type Clock } from "@ac-kit/core";
|
|
2
|
+
/** `window` or a dedicated worker's global scope. */
|
|
3
|
+
export type AnimationFrames = Pick<AnimationFrameProvider, "requestAnimationFrame" | "cancelAnimationFrame">;
|
|
4
|
+
export type FrameInfo = {
|
|
5
|
+
/** The frame's time, ms on `performance.now()`'s time line. */
|
|
6
|
+
readonly time: number;
|
|
7
|
+
/**
|
|
8
|
+
* Seconds since the previous frame when it rendered too, else 0; at most
|
|
9
|
+
* `maxDeltaSeconds`. 0 for a non-finite `time`, which the next frame's delta
|
|
10
|
+
* does not count from.
|
|
11
|
+
*/
|
|
12
|
+
readonly deltaSeconds: number;
|
|
13
|
+
/** Frames rendered before this one. */
|
|
14
|
+
readonly index: number;
|
|
15
|
+
};
|
|
16
|
+
export type FrameSchedulerOptions = {
|
|
17
|
+
/**
|
|
18
|
+
* Render every frame (playback, an animation) instead of on `invalidate()`.
|
|
19
|
+
* Default false.
|
|
20
|
+
*/
|
|
21
|
+
readonly continuous?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Cap on `deltaSeconds`, so a tab back from the background does not jump.
|
|
24
|
+
* Default 0.1.
|
|
25
|
+
*/
|
|
26
|
+
readonly maxDeltaSeconds?: number;
|
|
27
|
+
/** `renderNow`'s time source. Default `SYSTEM_CLOCK`. */
|
|
28
|
+
readonly clock?: Clock;
|
|
29
|
+
/** Disposes the scheduler when it aborts. */
|
|
30
|
+
readonly signal?: AbortSignal;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Renders on animation frames, at most once each: on demand after
|
|
34
|
+
* `invalidate()`, or every frame while `continuous`. A throwing `render` is
|
|
35
|
+
* reported by the host like any frame callback; the next frame is already
|
|
36
|
+
* requested in continuous mode, and `invalidate()` keeps working.
|
|
37
|
+
*
|
|
38
|
+
* A frame with a delta of 0 starts a run: the first after idle, after
|
|
39
|
+
* `renderNow` or after a frame that rendered nothing. A hidden page gets no
|
|
40
|
+
* frames, so a pending render waits for it to be shown.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const scheduler = new FrameScheduler(
|
|
44
|
+
* window,
|
|
45
|
+
* ({ deltaSeconds }) => {
|
|
46
|
+
* draw(deltaSeconds);
|
|
47
|
+
* },
|
|
48
|
+
* { signal },
|
|
49
|
+
* );
|
|
50
|
+
* scheduler.invalidate();
|
|
51
|
+
*/
|
|
52
|
+
export declare class FrameScheduler implements Disposable {
|
|
53
|
+
private readonly frames_;
|
|
54
|
+
private readonly render_;
|
|
55
|
+
private readonly maxDeltaSeconds_;
|
|
56
|
+
private readonly clock_;
|
|
57
|
+
private readonly lifetime_;
|
|
58
|
+
private continuous_;
|
|
59
|
+
private handle_;
|
|
60
|
+
private invalidated_;
|
|
61
|
+
private rendering_;
|
|
62
|
+
private disposed_;
|
|
63
|
+
private index_;
|
|
64
|
+
/** The time of the last frame, `undefined` when the run is over. */
|
|
65
|
+
private lastTime_;
|
|
66
|
+
/** @throws {RangeError} When `maxDeltaSeconds` is not positive. */
|
|
67
|
+
constructor(frames: AnimationFrames, render: Callable<[frame: FrameInfo]>, options?: FrameSchedulerOptions);
|
|
68
|
+
/** Whether every frame renders. Changing it takes effect at the next frame. */
|
|
69
|
+
get continuous(): boolean;
|
|
70
|
+
set continuous(value: boolean);
|
|
71
|
+
/** Whether a frame is requested and not run yet. */
|
|
72
|
+
get isPending(): boolean;
|
|
73
|
+
get isDisposed(): boolean;
|
|
74
|
+
/** Requests one render at the next frame; calls before it coalesce. O(1). */
|
|
75
|
+
invalidate(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Renders now, at `clock.now()`, and cancels a pending frame: for
|
|
78
|
+
* `observeCanvasSize`'s `onResize`. Called from within a render it is an
|
|
79
|
+
* `invalidate()` instead, as rendering inside a render would nest frames. In
|
|
80
|
+
* continuous mode the next frame is requested again.
|
|
81
|
+
*/
|
|
82
|
+
renderNow(): void;
|
|
83
|
+
[Symbol.dispose](): void;
|
|
84
|
+
private release_;
|
|
85
|
+
private request_;
|
|
86
|
+
private cancel_;
|
|
87
|
+
private onFrame_;
|
|
88
|
+
private finishRun_;
|
|
89
|
+
private renderAt_;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=frame-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-scheduler.d.ts","sourceRoot":"","sources":["../../src/animation-frame/frame-scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,KAAK,EAIV,MAAM,cAAc,CAAC;AAEtB,qDAAqD;AACrD,MAAM,MAAM,eAAe,GAAG,IAAI,CACjC,sBAAsB,EACtB,uBAAuB,GAAG,sBAAsB,CAChD,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,yDAAyD;IACzD,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC9B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,cAAe,YAAW,UAAU;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IACvD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAK;IACnB,oEAAoE;IACpE,OAAO,CAAC,SAAS,CAAqB;IAEtC,mEAAmE;IACnE,YACC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,QAAQ,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,EACpC,OAAO,GAAE,qBAA0B,EAiCnC;IAED,+EAA+E;IAC/E,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,OAAO,EAK5B;IAED,oDAAoD;IACpD,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,6EAA6E;IAC7E,UAAU,IAAI,IAAI,CAGjB;IAED;;;;;OAKG;IACH,SAAS,IAAI,IAAI,CAmBhB;IAED,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAEvB;IAED,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,QAAQ;IAuBhB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,SAAS;CAuBjB"}
|