@gjsify/eventsource 0.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/README.md +28 -0
- package/globals.mjs +27 -0
- package/lib/esm/index.js +244 -0
- package/lib/types/index.d.ts +39 -0
- package/package.json +42 -0
- package/src/index.spec.ts +466 -0
- package/src/index.ts +319 -0
- package/src/test.mts +6 -0
- package/tsconfig.json +32 -0
- package/tsconfig.tsbuildinfo +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @gjsify/eventsource
|
|
2
|
+
|
|
3
|
+
GJS implementation of the Web EventSource (Server-Sent Events) API using Soup 3.0.
|
|
4
|
+
|
|
5
|
+
Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @gjsify/eventsource
|
|
11
|
+
# or
|
|
12
|
+
yarn add @gjsify/eventsource
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { EventSource } from '@gjsify/eventsource';
|
|
19
|
+
|
|
20
|
+
const source = new EventSource('https://example.com/events');
|
|
21
|
+
source.onmessage = (event) => {
|
|
22
|
+
console.log(event.data);
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## License
|
|
27
|
+
|
|
28
|
+
MIT
|
package/globals.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports native EventSource global for use in Node.js builds.
|
|
3
|
+
* On Node.js 22.3+, EventSource is available as a global (experimental).
|
|
4
|
+
* TextLineStream is a gjsify utility — re-exported from the package.
|
|
5
|
+
*/
|
|
6
|
+
export const EventSource = globalThis.EventSource;
|
|
7
|
+
|
|
8
|
+
// TextLineStream is not a Web standard — it's a utility class from @gjsify/eventsource.
|
|
9
|
+
// Re-implement minimally for Node.js test compatibility.
|
|
10
|
+
export class TextLineStream extends TransformStream {
|
|
11
|
+
constructor() {
|
|
12
|
+
let buffer = '';
|
|
13
|
+
super({
|
|
14
|
+
transform(chunk, controller) {
|
|
15
|
+
buffer += chunk;
|
|
16
|
+
const lines = buffer.split('\n');
|
|
17
|
+
buffer = lines.pop() || '';
|
|
18
|
+
for (const line of lines) {
|
|
19
|
+
controller.enqueue(line);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
flush(controller) {
|
|
23
|
+
if (buffer) controller.enqueue(buffer);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
package/lib/esm/index.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import "@gjsify/web-streams";
|
|
2
|
+
import {
|
|
3
|
+
Event as DomEvent,
|
|
4
|
+
EventTarget as DomEventTarget,
|
|
5
|
+
MessageEvent as DomMessageEvent
|
|
6
|
+
} from "@gjsify/dom-events";
|
|
7
|
+
const CONNECTING = 0;
|
|
8
|
+
const OPEN = 1;
|
|
9
|
+
const CLOSED = 2;
|
|
10
|
+
const _Event = typeof globalThis.Event === "function" ? globalThis.Event : DomEvent;
|
|
11
|
+
const _EventTarget = typeof globalThis.EventTarget === "function" ? globalThis.EventTarget : DomEventTarget;
|
|
12
|
+
const _MessageEvent = typeof globalThis.MessageEvent === "function" ? globalThis.MessageEvent : DomMessageEvent;
|
|
13
|
+
if (typeof globalThis.Event === "undefined") {
|
|
14
|
+
globalThis.Event = _Event;
|
|
15
|
+
}
|
|
16
|
+
if (typeof globalThis.EventTarget === "undefined") {
|
|
17
|
+
globalThis.EventTarget = _EventTarget;
|
|
18
|
+
}
|
|
19
|
+
if (typeof globalThis.MessageEvent === "undefined") {
|
|
20
|
+
globalThis.MessageEvent = _MessageEvent;
|
|
21
|
+
}
|
|
22
|
+
class TextLineStream extends TransformStream {
|
|
23
|
+
#buf = "";
|
|
24
|
+
constructor() {
|
|
25
|
+
super({
|
|
26
|
+
transform: (chunk, controller) => this.#handle(chunk, controller),
|
|
27
|
+
flush: (controller) => {
|
|
28
|
+
if (this.#buf.length > 0) {
|
|
29
|
+
controller.enqueue(this.#buf);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
#handle(chunk, controller) {
|
|
35
|
+
chunk = this.#buf + chunk;
|
|
36
|
+
for (; ; ) {
|
|
37
|
+
const lfIndex = chunk.indexOf("\n");
|
|
38
|
+
if (lfIndex !== -1) {
|
|
39
|
+
let crOrLfIndex = lfIndex;
|
|
40
|
+
if (chunk[lfIndex - 1] === "\r") {
|
|
41
|
+
crOrLfIndex--;
|
|
42
|
+
}
|
|
43
|
+
controller.enqueue(chunk.slice(0, crOrLfIndex));
|
|
44
|
+
chunk = chunk.slice(lfIndex + 1);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const crIndex = chunk.indexOf("\r");
|
|
48
|
+
if (crIndex !== -1 && crIndex !== chunk.length - 1) {
|
|
49
|
+
controller.enqueue(chunk.slice(0, crIndex));
|
|
50
|
+
chunk = chunk.slice(crIndex + 1);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
this.#buf = chunk;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
class EventSource extends _EventTarget {
|
|
59
|
+
static CONNECTING = CONNECTING;
|
|
60
|
+
static OPEN = OPEN;
|
|
61
|
+
static CLOSED = CLOSED;
|
|
62
|
+
CONNECTING = CONNECTING;
|
|
63
|
+
OPEN = OPEN;
|
|
64
|
+
CLOSED = CLOSED;
|
|
65
|
+
#abortController = new AbortController();
|
|
66
|
+
#reconnectionTimerId;
|
|
67
|
+
#reconnectionTime = 5e3;
|
|
68
|
+
#lastEventId = "";
|
|
69
|
+
#readyState = CONNECTING;
|
|
70
|
+
#url;
|
|
71
|
+
#withCredentials;
|
|
72
|
+
// Event handler attributes
|
|
73
|
+
onopen = null;
|
|
74
|
+
onmessage = null;
|
|
75
|
+
onerror = null;
|
|
76
|
+
constructor(url, eventSourceInitDict) {
|
|
77
|
+
super();
|
|
78
|
+
const urlStr = String(url);
|
|
79
|
+
try {
|
|
80
|
+
this.#url = new URL(urlStr).href;
|
|
81
|
+
} catch {
|
|
82
|
+
throw new DOMException(`Failed to construct 'EventSource': ${urlStr} is not a valid URL`, "SyntaxError");
|
|
83
|
+
}
|
|
84
|
+
this.#withCredentials = eventSourceInitDict?.withCredentials ?? false;
|
|
85
|
+
this.#loop();
|
|
86
|
+
}
|
|
87
|
+
get readyState() {
|
|
88
|
+
return this.#readyState;
|
|
89
|
+
}
|
|
90
|
+
get url() {
|
|
91
|
+
return this.#url;
|
|
92
|
+
}
|
|
93
|
+
get withCredentials() {
|
|
94
|
+
return this.#withCredentials;
|
|
95
|
+
}
|
|
96
|
+
close() {
|
|
97
|
+
this.#abortController.abort();
|
|
98
|
+
this.#readyState = CLOSED;
|
|
99
|
+
if (this.#reconnectionTimerId !== void 0) {
|
|
100
|
+
clearTimeout(this.#reconnectionTimerId);
|
|
101
|
+
this.#reconnectionTimerId = void 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
dispatchEvent(event) {
|
|
105
|
+
const type = event.type;
|
|
106
|
+
if (type === "open" && this.onopen) {
|
|
107
|
+
this.onopen.call(this, event);
|
|
108
|
+
} else if (type === "message" && this.onmessage) {
|
|
109
|
+
this.onmessage.call(this, event);
|
|
110
|
+
} else if (type === "error" && this.onerror) {
|
|
111
|
+
this.onerror.call(this, event);
|
|
112
|
+
}
|
|
113
|
+
return super.dispatchEvent(event);
|
|
114
|
+
}
|
|
115
|
+
async #loop() {
|
|
116
|
+
const headers = {
|
|
117
|
+
"Accept": "text/event-stream",
|
|
118
|
+
"Cache-Control": "no-cache"
|
|
119
|
+
};
|
|
120
|
+
if (this.#lastEventId) {
|
|
121
|
+
headers["Last-Event-ID"] = this.#lastEventId;
|
|
122
|
+
}
|
|
123
|
+
let res;
|
|
124
|
+
try {
|
|
125
|
+
res = await fetch(this.#url, {
|
|
126
|
+
headers,
|
|
127
|
+
signal: this.#abortController.signal
|
|
128
|
+
});
|
|
129
|
+
} catch {
|
|
130
|
+
this.#reestablishConnection();
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const contentType = res.headers.get("content-type") || "";
|
|
134
|
+
if (res.status !== 200 || !contentType.toLowerCase().includes("text/event-stream")) {
|
|
135
|
+
this.#failConnection();
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (this.#readyState === CLOSED) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.#readyState = OPEN;
|
|
142
|
+
this.dispatchEvent(new _Event("open"));
|
|
143
|
+
let data = "";
|
|
144
|
+
let eventType = "";
|
|
145
|
+
let lastEventId = this.#lastEventId;
|
|
146
|
+
try {
|
|
147
|
+
const body = res.body;
|
|
148
|
+
if (!body) {
|
|
149
|
+
this.#reestablishConnection();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const lineStream = body.pipeThrough(new TextDecoderStream()).pipeThrough(new TextLineStream());
|
|
153
|
+
const reader = lineStream.getReader();
|
|
154
|
+
while (true) {
|
|
155
|
+
const { value: line, done } = await reader.read();
|
|
156
|
+
if (done) break;
|
|
157
|
+
if (line === "") {
|
|
158
|
+
this.#lastEventId = lastEventId;
|
|
159
|
+
if (data === "") {
|
|
160
|
+
eventType = "";
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (data.endsWith("\n")) {
|
|
164
|
+
data = data.slice(0, -1);
|
|
165
|
+
}
|
|
166
|
+
const event = new _MessageEvent(eventType || "message", {
|
|
167
|
+
data,
|
|
168
|
+
origin: this.#url,
|
|
169
|
+
lastEventId: this.#lastEventId
|
|
170
|
+
});
|
|
171
|
+
data = "";
|
|
172
|
+
eventType = "";
|
|
173
|
+
if (this.#readyState !== CLOSED) {
|
|
174
|
+
this.dispatchEvent(event);
|
|
175
|
+
}
|
|
176
|
+
} else if (line.startsWith(":")) {
|
|
177
|
+
continue;
|
|
178
|
+
} else {
|
|
179
|
+
let field = line;
|
|
180
|
+
let value = "";
|
|
181
|
+
const colonIndex = line.indexOf(":");
|
|
182
|
+
if (colonIndex !== -1) {
|
|
183
|
+
field = line.slice(0, colonIndex);
|
|
184
|
+
value = line.slice(colonIndex + 1);
|
|
185
|
+
if (value.startsWith(" ")) {
|
|
186
|
+
value = value.slice(1);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
switch (field) {
|
|
190
|
+
case "event":
|
|
191
|
+
eventType = value;
|
|
192
|
+
break;
|
|
193
|
+
case "data":
|
|
194
|
+
data += value + "\n";
|
|
195
|
+
break;
|
|
196
|
+
case "id":
|
|
197
|
+
if (!value.includes("\0")) {
|
|
198
|
+
lastEventId = value;
|
|
199
|
+
}
|
|
200
|
+
break;
|
|
201
|
+
case "retry": {
|
|
202
|
+
const ms = Number(value);
|
|
203
|
+
if (!Number.isNaN(ms) && Number.isFinite(ms)) {
|
|
204
|
+
this.#reconnectionTime = ms;
|
|
205
|
+
}
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
} catch {
|
|
212
|
+
}
|
|
213
|
+
this.#reestablishConnection();
|
|
214
|
+
}
|
|
215
|
+
#reestablishConnection() {
|
|
216
|
+
if (this.#readyState === CLOSED) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this.#readyState = CONNECTING;
|
|
220
|
+
this.dispatchEvent(new _Event("error"));
|
|
221
|
+
this.#reconnectionTimerId = setTimeout(() => {
|
|
222
|
+
if (this.#readyState !== CONNECTING) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
this.#abortController = new AbortController();
|
|
226
|
+
this.#loop();
|
|
227
|
+
}, this.#reconnectionTime);
|
|
228
|
+
}
|
|
229
|
+
#failConnection() {
|
|
230
|
+
if (this.#readyState !== CLOSED) {
|
|
231
|
+
this.#readyState = CLOSED;
|
|
232
|
+
this.dispatchEvent(new _Event("error"));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (typeof globalThis.EventSource === "undefined") {
|
|
237
|
+
globalThis.EventSource = EventSource;
|
|
238
|
+
}
|
|
239
|
+
var index_default = EventSource;
|
|
240
|
+
export {
|
|
241
|
+
EventSource,
|
|
242
|
+
TextLineStream,
|
|
243
|
+
index_default as default
|
|
244
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import '@gjsify/web-streams';
|
|
2
|
+
/**
|
|
3
|
+
* TextLineStream splits a string stream into individual lines.
|
|
4
|
+
* Handles \n, \r\n, and standalone \r line endings.
|
|
5
|
+
*/
|
|
6
|
+
declare class TextLineStream extends TransformStream<string, string> {
|
|
7
|
+
#private;
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
10
|
+
export interface EventSourceInit {
|
|
11
|
+
withCredentials?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const EventSource_base: any;
|
|
14
|
+
/**
|
|
15
|
+
* EventSource — W3C Server-Sent Events API.
|
|
16
|
+
*
|
|
17
|
+
* Connects to an SSE endpoint via fetch, pipes the response through
|
|
18
|
+
* TextDecoderStream and TextLineStream, then parses SSE fields.
|
|
19
|
+
*/
|
|
20
|
+
export declare class EventSource extends EventSource_base {
|
|
21
|
+
#private;
|
|
22
|
+
static readonly CONNECTING = 0;
|
|
23
|
+
static readonly OPEN = 1;
|
|
24
|
+
static readonly CLOSED = 2;
|
|
25
|
+
readonly CONNECTING = 0;
|
|
26
|
+
readonly OPEN = 1;
|
|
27
|
+
readonly CLOSED = 2;
|
|
28
|
+
onopen: ((this: EventSource, ev: Event) => any) | null;
|
|
29
|
+
onmessage: ((this: EventSource, ev: MessageEvent) => any) | null;
|
|
30
|
+
onerror: ((this: EventSource, ev: Event) => any) | null;
|
|
31
|
+
constructor(url: string | URL, eventSourceInitDict?: EventSourceInit);
|
|
32
|
+
get readyState(): number;
|
|
33
|
+
get url(): string;
|
|
34
|
+
get withCredentials(): boolean;
|
|
35
|
+
close(): void;
|
|
36
|
+
dispatchEvent(event: Event): boolean;
|
|
37
|
+
}
|
|
38
|
+
export { TextLineStream };
|
|
39
|
+
export default EventSource;
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gjsify/eventsource",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "W3C EventSource (Server-Sent Events) for GJS",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "lib/esm/index.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"default": "./lib/esm/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./globals": "./globals.mjs"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo test.gjs.mjs test.node.mjs || exit 0",
|
|
17
|
+
"check": "tsc --noEmit",
|
|
18
|
+
"build": "yarn build:gjsify && yarn build:types",
|
|
19
|
+
"build:gjsify": "gjsify build --library 'src/**/*.{ts,js}' --exclude 'src/**/*.spec.{mts,ts}' 'src/test.{mts,ts}'",
|
|
20
|
+
"build:types": "tsc",
|
|
21
|
+
"build:test": "yarn build:test:gjs",
|
|
22
|
+
"build:test:gjs": "gjsify build src/test.mts --app gjs --outfile test.gjs.mjs",
|
|
23
|
+
"test": "yarn build:gjsify && yarn build:test && yarn test:gjs",
|
|
24
|
+
"test:gjs": "gjs -m test.gjs.mjs"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"gjs",
|
|
28
|
+
"eventsource",
|
|
29
|
+
"sse",
|
|
30
|
+
"server-sent-events"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@gjsify/dom-events": "^0.1.0",
|
|
34
|
+
"@gjsify/web-streams": "^0.1.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@gjsify/cli": "^0.1.0",
|
|
38
|
+
"@gjsify/unit": "^0.1.0",
|
|
39
|
+
"@types/node": "^25.5.0",
|
|
40
|
+
"typescript": "^6.0.2"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
// Tests for W3C EventSource (Server-Sent Events)
|
|
2
|
+
// Ported from refs/deno/tests/unit/ and refs/wpt/eventsource/
|
|
3
|
+
// Original: MIT license (Deno), 3-Clause BSD license (WPT)
|
|
4
|
+
|
|
5
|
+
import { describe, it, expect, on } from '@gjsify/unit';
|
|
6
|
+
import { EventSource, TextLineStream } from 'eventsource';
|
|
7
|
+
|
|
8
|
+
export default async () => {
|
|
9
|
+
|
|
10
|
+
// ==================== TextLineStream ====================
|
|
11
|
+
|
|
12
|
+
await describe('TextLineStream', async () => {
|
|
13
|
+
await it('should split lines on \\n', async () => {
|
|
14
|
+
const ts = new TextLineStream();
|
|
15
|
+
const writer = ts.writable.getWriter();
|
|
16
|
+
const reader = ts.readable.getReader();
|
|
17
|
+
|
|
18
|
+
const lines: string[] = [];
|
|
19
|
+
const [,] = await Promise.all([
|
|
20
|
+
(async () => {
|
|
21
|
+
await writer.write('hello\nworld\n');
|
|
22
|
+
await writer.close();
|
|
23
|
+
})(),
|
|
24
|
+
(async () => {
|
|
25
|
+
while (true) {
|
|
26
|
+
const { value, done } = await reader.read();
|
|
27
|
+
if (done) break;
|
|
28
|
+
lines.push(value);
|
|
29
|
+
}
|
|
30
|
+
})(),
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
expect(lines.length).toBe(2);
|
|
34
|
+
expect(lines[0]).toBe('hello');
|
|
35
|
+
expect(lines[1]).toBe('world');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
await it('should split lines on \\r\\n', async () => {
|
|
39
|
+
const ts = new TextLineStream();
|
|
40
|
+
const writer = ts.writable.getWriter();
|
|
41
|
+
const reader = ts.readable.getReader();
|
|
42
|
+
|
|
43
|
+
const lines: string[] = [];
|
|
44
|
+
await Promise.all([
|
|
45
|
+
(async () => {
|
|
46
|
+
await writer.write('foo\r\nbar\r\n');
|
|
47
|
+
await writer.close();
|
|
48
|
+
})(),
|
|
49
|
+
(async () => {
|
|
50
|
+
while (true) {
|
|
51
|
+
const { value, done } = await reader.read();
|
|
52
|
+
if (done) break;
|
|
53
|
+
lines.push(value);
|
|
54
|
+
}
|
|
55
|
+
})(),
|
|
56
|
+
]);
|
|
57
|
+
|
|
58
|
+
expect(lines.length).toBe(2);
|
|
59
|
+
expect(lines[0]).toBe('foo');
|
|
60
|
+
expect(lines[1]).toBe('bar');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
await it('should handle chunks split across writes', async () => {
|
|
64
|
+
const ts = new TextLineStream();
|
|
65
|
+
const writer = ts.writable.getWriter();
|
|
66
|
+
const reader = ts.readable.getReader();
|
|
67
|
+
|
|
68
|
+
const lines: string[] = [];
|
|
69
|
+
await Promise.all([
|
|
70
|
+
(async () => {
|
|
71
|
+
await writer.write('hel');
|
|
72
|
+
await writer.write('lo\nwor');
|
|
73
|
+
await writer.write('ld\n');
|
|
74
|
+
await writer.close();
|
|
75
|
+
})(),
|
|
76
|
+
(async () => {
|
|
77
|
+
while (true) {
|
|
78
|
+
const { value, done } = await reader.read();
|
|
79
|
+
if (done) break;
|
|
80
|
+
lines.push(value);
|
|
81
|
+
}
|
|
82
|
+
})(),
|
|
83
|
+
]);
|
|
84
|
+
|
|
85
|
+
expect(lines.length).toBe(2);
|
|
86
|
+
expect(lines[0]).toBe('hello');
|
|
87
|
+
expect(lines[1]).toBe('world');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
await it('should flush remaining buffer on close', async () => {
|
|
91
|
+
const ts = new TextLineStream();
|
|
92
|
+
const writer = ts.writable.getWriter();
|
|
93
|
+
const reader = ts.readable.getReader();
|
|
94
|
+
|
|
95
|
+
const lines: string[] = [];
|
|
96
|
+
await Promise.all([
|
|
97
|
+
(async () => {
|
|
98
|
+
await writer.write('no trailing newline');
|
|
99
|
+
await writer.close();
|
|
100
|
+
})(),
|
|
101
|
+
(async () => {
|
|
102
|
+
while (true) {
|
|
103
|
+
const { value, done } = await reader.read();
|
|
104
|
+
if (done) break;
|
|
105
|
+
lines.push(value);
|
|
106
|
+
}
|
|
107
|
+
})(),
|
|
108
|
+
]);
|
|
109
|
+
|
|
110
|
+
expect(lines.length).toBe(1);
|
|
111
|
+
expect(lines[0]).toBe('no trailing newline');
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// ==================== EventSource (static properties) ====================
|
|
116
|
+
|
|
117
|
+
await describe('EventSource (static)', async () => {
|
|
118
|
+
await it('should have CONNECTING, OPEN, CLOSED constants', async () => {
|
|
119
|
+
expect(EventSource.CONNECTING).toBe(0);
|
|
120
|
+
expect(EventSource.OPEN).toBe(1);
|
|
121
|
+
expect(EventSource.CLOSED).toBe(2);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
await it('should be a constructor', async () => {
|
|
125
|
+
expect(typeof EventSource).toBe('function');
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// ==================== EventSource (constructor + integration) ====================
|
|
130
|
+
// These tests create EventSource instances that connect via fetch,
|
|
131
|
+
// which requires a Node.js HTTP server. Skipped on GJS.
|
|
132
|
+
|
|
133
|
+
await on('Node.js', async () => {
|
|
134
|
+
|
|
135
|
+
await describe('EventSource (constructor)', async () => {
|
|
136
|
+
await it('should throw on invalid URL', async () => {
|
|
137
|
+
let threw = false;
|
|
138
|
+
try {
|
|
139
|
+
new EventSource('not a valid url');
|
|
140
|
+
} catch (e) {
|
|
141
|
+
threw = true;
|
|
142
|
+
}
|
|
143
|
+
expect(threw).toBe(true);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
await it('should set url property', async () => {
|
|
147
|
+
const es = new EventSource('http://localhost:9999/events');
|
|
148
|
+
expect(es.url).toBe('http://localhost:9999/events');
|
|
149
|
+
expect(es.readyState).toBe(EventSource.CONNECTING);
|
|
150
|
+
expect(es.withCredentials).toBe(false);
|
|
151
|
+
es.close();
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
await it('should have instance constants', async () => {
|
|
155
|
+
const es = new EventSource('http://localhost:9999/events');
|
|
156
|
+
expect(es.CONNECTING).toBe(0);
|
|
157
|
+
expect(es.OPEN).toBe(1);
|
|
158
|
+
expect(es.CLOSED).toBe(2);
|
|
159
|
+
es.close();
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
await it('should set readyState to CLOSED after close()', async () => {
|
|
163
|
+
const es = new EventSource('http://localhost:9999/events');
|
|
164
|
+
es.close();
|
|
165
|
+
expect(es.readyState).toBe(EventSource.CLOSED);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
await it('should accept withCredentials option', async () => {
|
|
169
|
+
const es = new EventSource('http://localhost:9999/events', { withCredentials: true });
|
|
170
|
+
expect(es.withCredentials).toBe(true);
|
|
171
|
+
es.close();
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// ==================== EventSource (event attributes) ====================
|
|
176
|
+
|
|
177
|
+
await describe('EventSource (event attributes)', async () => {
|
|
178
|
+
await it('should have null event handlers by default', async () => {
|
|
179
|
+
const es = new EventSource('http://localhost:9999/events');
|
|
180
|
+
expect(es.onopen).toBeNull();
|
|
181
|
+
expect(es.onmessage).toBeNull();
|
|
182
|
+
expect(es.onerror).toBeNull();
|
|
183
|
+
es.close();
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
await it('should accept onopen assignment', async () => {
|
|
187
|
+
const es = new EventSource('http://localhost:9999/events');
|
|
188
|
+
const handler = () => {};
|
|
189
|
+
es.onopen = handler;
|
|
190
|
+
expect(es.onopen).toBe(handler);
|
|
191
|
+
es.close();
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
await it('should accept onmessage assignment', async () => {
|
|
195
|
+
const es = new EventSource('http://localhost:9999/events');
|
|
196
|
+
const handler = () => {};
|
|
197
|
+
es.onmessage = handler;
|
|
198
|
+
expect(es.onmessage).toBe(handler);
|
|
199
|
+
es.close();
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
await it('should accept onerror assignment', async () => {
|
|
203
|
+
const es = new EventSource('http://localhost:9999/events');
|
|
204
|
+
const handler = () => {};
|
|
205
|
+
es.onerror = handler;
|
|
206
|
+
expect(es.onerror).toBe(handler);
|
|
207
|
+
es.close();
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// ==================== EventSource (integration with HTTP server) ====================
|
|
212
|
+
|
|
213
|
+
await describe('EventSource (SSE integration)', async () => {
|
|
214
|
+
|
|
215
|
+
// Helper to create a simple SSE server
|
|
216
|
+
async function createSSEServer(handler: (req: any, res: any) => void): Promise<{ port: number; close: () => void }> {
|
|
217
|
+
const http = await import('http');
|
|
218
|
+
return new Promise((resolve) => {
|
|
219
|
+
const server = http.createServer(handler);
|
|
220
|
+
server.listen(0, () => {
|
|
221
|
+
const addr = server.address() as any;
|
|
222
|
+
resolve({
|
|
223
|
+
port: addr.port,
|
|
224
|
+
close: () => server.close(),
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
await it('should receive a basic message', async () => {
|
|
231
|
+
const server = await createSSEServer((_req, res) => {
|
|
232
|
+
res.writeHead(200, {
|
|
233
|
+
'Content-Type': 'text/event-stream',
|
|
234
|
+
'Cache-Control': 'no-cache',
|
|
235
|
+
'Connection': 'close',
|
|
236
|
+
});
|
|
237
|
+
res.write('data: hello world\n\n');
|
|
238
|
+
res.end();
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
try {
|
|
242
|
+
const es = new EventSource(`http://localhost:${server.port}/events`);
|
|
243
|
+
const msg = await new Promise<MessageEvent>((resolve) => {
|
|
244
|
+
es.onmessage = (e) => {
|
|
245
|
+
resolve(e);
|
|
246
|
+
es.close();
|
|
247
|
+
};
|
|
248
|
+
es.onerror = () => es.close();
|
|
249
|
+
});
|
|
250
|
+
expect(msg.data).toBe('hello world');
|
|
251
|
+
} finally {
|
|
252
|
+
server.close();
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
await it('should receive named events', async () => {
|
|
257
|
+
const server = await createSSEServer((_req, res) => {
|
|
258
|
+
res.writeHead(200, {
|
|
259
|
+
'Content-Type': 'text/event-stream',
|
|
260
|
+
'Cache-Control': 'no-cache',
|
|
261
|
+
'Connection': 'close',
|
|
262
|
+
});
|
|
263
|
+
res.write('event: greeting\ndata: hi there\n\n');
|
|
264
|
+
res.end();
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
try {
|
|
268
|
+
const es = new EventSource(`http://localhost:${server.port}/events`);
|
|
269
|
+
const msg = await new Promise<MessageEvent>((resolve) => {
|
|
270
|
+
es.addEventListener('greeting', (e) => {
|
|
271
|
+
resolve(e as MessageEvent);
|
|
272
|
+
es.close();
|
|
273
|
+
});
|
|
274
|
+
es.onerror = () => es.close();
|
|
275
|
+
});
|
|
276
|
+
expect(msg.data).toBe('hi there');
|
|
277
|
+
} finally {
|
|
278
|
+
server.close();
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
await it('should receive multi-line data', async () => {
|
|
283
|
+
const server = await createSSEServer((_req, res) => {
|
|
284
|
+
res.writeHead(200, {
|
|
285
|
+
'Content-Type': 'text/event-stream',
|
|
286
|
+
'Cache-Control': 'no-cache',
|
|
287
|
+
'Connection': 'close',
|
|
288
|
+
});
|
|
289
|
+
res.write('data: line1\ndata: line2\ndata: line3\n\n');
|
|
290
|
+
res.end();
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
try {
|
|
294
|
+
const es = new EventSource(`http://localhost:${server.port}/events`);
|
|
295
|
+
const msg = await new Promise<MessageEvent>((resolve) => {
|
|
296
|
+
es.onmessage = (e) => {
|
|
297
|
+
resolve(e);
|
|
298
|
+
es.close();
|
|
299
|
+
};
|
|
300
|
+
es.onerror = () => es.close();
|
|
301
|
+
});
|
|
302
|
+
expect(msg.data).toBe('line1\nline2\nline3');
|
|
303
|
+
} finally {
|
|
304
|
+
server.close();
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
await it('should receive multiple messages', async () => {
|
|
309
|
+
const server = await createSSEServer((_req, res) => {
|
|
310
|
+
res.writeHead(200, {
|
|
311
|
+
'Content-Type': 'text/event-stream',
|
|
312
|
+
'Cache-Control': 'no-cache',
|
|
313
|
+
'Connection': 'close',
|
|
314
|
+
});
|
|
315
|
+
res.write('data: msg1\n\ndata: msg2\n\ndata: msg3\n\n');
|
|
316
|
+
res.end();
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
try {
|
|
320
|
+
const es = new EventSource(`http://localhost:${server.port}/events`);
|
|
321
|
+
const msgs: string[] = [];
|
|
322
|
+
await new Promise<void>((resolve) => {
|
|
323
|
+
es.onmessage = (e) => {
|
|
324
|
+
msgs.push(e.data);
|
|
325
|
+
if (msgs.length === 3) {
|
|
326
|
+
es.close();
|
|
327
|
+
resolve();
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
es.onerror = () => { es.close(); resolve(); };
|
|
331
|
+
});
|
|
332
|
+
expect(msgs.length).toBe(3);
|
|
333
|
+
expect(msgs[0]).toBe('msg1');
|
|
334
|
+
expect(msgs[1]).toBe('msg2');
|
|
335
|
+
expect(msgs[2]).toBe('msg3');
|
|
336
|
+
} finally {
|
|
337
|
+
server.close();
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
await it('should ignore comment lines', async () => {
|
|
342
|
+
const server = await createSSEServer((_req, res) => {
|
|
343
|
+
res.writeHead(200, {
|
|
344
|
+
'Content-Type': 'text/event-stream',
|
|
345
|
+
'Cache-Control': 'no-cache',
|
|
346
|
+
'Connection': 'close',
|
|
347
|
+
});
|
|
348
|
+
res.write(': this is a comment\ndata: actual data\n\n');
|
|
349
|
+
res.end();
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
try {
|
|
353
|
+
const es = new EventSource(`http://localhost:${server.port}/events`);
|
|
354
|
+
const msg = await new Promise<MessageEvent>((resolve) => {
|
|
355
|
+
es.onmessage = (e) => {
|
|
356
|
+
resolve(e);
|
|
357
|
+
es.close();
|
|
358
|
+
};
|
|
359
|
+
es.onerror = () => es.close();
|
|
360
|
+
});
|
|
361
|
+
expect(msg.data).toBe('actual data');
|
|
362
|
+
} finally {
|
|
363
|
+
server.close();
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
await it('should track lastEventId', async () => {
|
|
368
|
+
const server = await createSSEServer((_req, res) => {
|
|
369
|
+
res.writeHead(200, {
|
|
370
|
+
'Content-Type': 'text/event-stream',
|
|
371
|
+
'Cache-Control': 'no-cache',
|
|
372
|
+
'Connection': 'close',
|
|
373
|
+
});
|
|
374
|
+
res.write('id: 42\ndata: with id\n\n');
|
|
375
|
+
res.end();
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
try {
|
|
379
|
+
const es = new EventSource(`http://localhost:${server.port}/events`);
|
|
380
|
+
const msg = await new Promise<MessageEvent>((resolve) => {
|
|
381
|
+
es.onmessage = (e) => {
|
|
382
|
+
resolve(e);
|
|
383
|
+
es.close();
|
|
384
|
+
};
|
|
385
|
+
es.onerror = () => es.close();
|
|
386
|
+
});
|
|
387
|
+
expect(msg.data).toBe('with id');
|
|
388
|
+
expect(msg.lastEventId).toBe('42');
|
|
389
|
+
} finally {
|
|
390
|
+
server.close();
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
await it('should fire open event', async () => {
|
|
395
|
+
const server = await createSSEServer((_req, res) => {
|
|
396
|
+
res.writeHead(200, {
|
|
397
|
+
'Content-Type': 'text/event-stream',
|
|
398
|
+
'Cache-Control': 'no-cache',
|
|
399
|
+
'Connection': 'close',
|
|
400
|
+
});
|
|
401
|
+
res.write('data: hi\n\n');
|
|
402
|
+
res.end();
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
try {
|
|
406
|
+
const es = new EventSource(`http://localhost:${server.port}/events`);
|
|
407
|
+
const opened = await new Promise<boolean>((resolve) => {
|
|
408
|
+
es.onopen = () => {
|
|
409
|
+
resolve(true);
|
|
410
|
+
es.close();
|
|
411
|
+
};
|
|
412
|
+
es.onerror = () => { es.close(); resolve(false); };
|
|
413
|
+
});
|
|
414
|
+
expect(opened).toBe(true);
|
|
415
|
+
} finally {
|
|
416
|
+
server.close();
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
await it('should fire error on non-200 status', async () => {
|
|
421
|
+
const server = await createSSEServer((_req, res) => {
|
|
422
|
+
res.writeHead(404);
|
|
423
|
+
res.end();
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
try {
|
|
427
|
+
const es = new EventSource(`http://localhost:${server.port}/events`);
|
|
428
|
+
const gotError = await new Promise<boolean>((resolve) => {
|
|
429
|
+
es.onerror = () => {
|
|
430
|
+
resolve(true);
|
|
431
|
+
es.close();
|
|
432
|
+
};
|
|
433
|
+
setTimeout(() => { es.close(); resolve(false); }, 3000);
|
|
434
|
+
});
|
|
435
|
+
expect(gotError).toBe(true);
|
|
436
|
+
expect(es.readyState).toBe(EventSource.CLOSED);
|
|
437
|
+
} finally {
|
|
438
|
+
server.close();
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
await it('should fire error on wrong content-type', async () => {
|
|
443
|
+
const server = await createSSEServer((_req, res) => {
|
|
444
|
+
res.writeHead(200, { 'Content-Type': 'text/plain' });
|
|
445
|
+
res.write('data: nope\n\n');
|
|
446
|
+
res.end();
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
try {
|
|
450
|
+
const es = new EventSource(`http://localhost:${server.port}/events`);
|
|
451
|
+
const gotError = await new Promise<boolean>((resolve) => {
|
|
452
|
+
es.onerror = () => {
|
|
453
|
+
resolve(true);
|
|
454
|
+
es.close();
|
|
455
|
+
};
|
|
456
|
+
setTimeout(() => { es.close(); resolve(false); }, 3000);
|
|
457
|
+
});
|
|
458
|
+
expect(gotError).toBe(true);
|
|
459
|
+
} finally {
|
|
460
|
+
server.close();
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
}); // end on('Node.js')
|
|
466
|
+
};
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
// W3C EventSource (Server-Sent Events) for GJS
|
|
2
|
+
// Adapted from refs/deno/ext/fetch/27_eventsource.js
|
|
3
|
+
// Copyright (c) 2018-2026 the Deno authors. MIT license.
|
|
4
|
+
// Reimplemented for GJS — pure TypeScript using fetch + Web Streams.
|
|
5
|
+
|
|
6
|
+
// Ensure Web Streams are available (polyfill on GJS)
|
|
7
|
+
import '@gjsify/web-streams';
|
|
8
|
+
// Import DOM Events polyfill — provides Event, EventTarget, MessageEvent, etc. on GJS
|
|
9
|
+
import {
|
|
10
|
+
Event as DomEvent,
|
|
11
|
+
EventTarget as DomEventTarget,
|
|
12
|
+
MessageEvent as DomMessageEvent,
|
|
13
|
+
} from '@gjsify/dom-events';
|
|
14
|
+
|
|
15
|
+
const CONNECTING = 0;
|
|
16
|
+
const OPEN = 1;
|
|
17
|
+
const CLOSED = 2;
|
|
18
|
+
|
|
19
|
+
// Use native globals if available (Node.js, browser), polyfill otherwise (GJS)
|
|
20
|
+
const _Event: typeof Event = typeof globalThis.Event === 'function'
|
|
21
|
+
? globalThis.Event
|
|
22
|
+
: DomEvent as any;
|
|
23
|
+
const _EventTarget: { new(): EventTarget } = typeof globalThis.EventTarget === 'function'
|
|
24
|
+
? globalThis.EventTarget
|
|
25
|
+
: DomEventTarget as any;
|
|
26
|
+
const _MessageEvent: typeof MessageEvent = typeof globalThis.MessageEvent === 'function'
|
|
27
|
+
? globalThis.MessageEvent
|
|
28
|
+
: DomMessageEvent as any;
|
|
29
|
+
|
|
30
|
+
// Register globals on GJS if missing
|
|
31
|
+
if (typeof globalThis.Event === 'undefined') {
|
|
32
|
+
(globalThis as any).Event = _Event;
|
|
33
|
+
}
|
|
34
|
+
if (typeof globalThis.EventTarget === 'undefined') {
|
|
35
|
+
(globalThis as any).EventTarget = _EventTarget;
|
|
36
|
+
}
|
|
37
|
+
if (typeof globalThis.MessageEvent === 'undefined') {
|
|
38
|
+
(globalThis as any).MessageEvent = _MessageEvent;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* TextLineStream splits a string stream into individual lines.
|
|
43
|
+
* Handles \n, \r\n, and standalone \r line endings.
|
|
44
|
+
*/
|
|
45
|
+
class TextLineStream extends TransformStream<string, string> {
|
|
46
|
+
#buf = '';
|
|
47
|
+
|
|
48
|
+
constructor() {
|
|
49
|
+
super({
|
|
50
|
+
transform: (chunk: string, controller) => this.#handle(chunk, controller),
|
|
51
|
+
flush: (controller) => {
|
|
52
|
+
if (this.#buf.length > 0) {
|
|
53
|
+
controller.enqueue(this.#buf);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#handle(chunk: string, controller: TransformStreamDefaultController<string>) {
|
|
60
|
+
chunk = this.#buf + chunk;
|
|
61
|
+
|
|
62
|
+
for (;;) {
|
|
63
|
+
const lfIndex = chunk.indexOf('\n');
|
|
64
|
+
|
|
65
|
+
if (lfIndex !== -1) {
|
|
66
|
+
let crOrLfIndex = lfIndex;
|
|
67
|
+
if (chunk[lfIndex - 1] === '\r') {
|
|
68
|
+
crOrLfIndex--;
|
|
69
|
+
}
|
|
70
|
+
controller.enqueue(chunk.slice(0, crOrLfIndex));
|
|
71
|
+
chunk = chunk.slice(lfIndex + 1);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Handle standalone \r (not followed by \n)
|
|
76
|
+
const crIndex = chunk.indexOf('\r');
|
|
77
|
+
if (crIndex !== -1 && crIndex !== chunk.length - 1) {
|
|
78
|
+
controller.enqueue(chunk.slice(0, crIndex));
|
|
79
|
+
chunk = chunk.slice(crIndex + 1);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
this.#buf = chunk;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface EventSourceInit {
|
|
91
|
+
withCredentials?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* EventSource — W3C Server-Sent Events API.
|
|
96
|
+
*
|
|
97
|
+
* Connects to an SSE endpoint via fetch, pipes the response through
|
|
98
|
+
* TextDecoderStream and TextLineStream, then parses SSE fields.
|
|
99
|
+
*/
|
|
100
|
+
export class EventSource extends (_EventTarget as any) {
|
|
101
|
+
static readonly CONNECTING = CONNECTING;
|
|
102
|
+
static readonly OPEN = OPEN;
|
|
103
|
+
static readonly CLOSED = CLOSED;
|
|
104
|
+
|
|
105
|
+
readonly CONNECTING = CONNECTING;
|
|
106
|
+
readonly OPEN = OPEN;
|
|
107
|
+
readonly CLOSED = CLOSED;
|
|
108
|
+
|
|
109
|
+
#abortController = new AbortController();
|
|
110
|
+
#reconnectionTimerId: ReturnType<typeof setTimeout> | undefined;
|
|
111
|
+
#reconnectionTime = 5000;
|
|
112
|
+
#lastEventId = '';
|
|
113
|
+
#readyState = CONNECTING;
|
|
114
|
+
#url: string;
|
|
115
|
+
#withCredentials: boolean;
|
|
116
|
+
|
|
117
|
+
// Event handler attributes
|
|
118
|
+
onopen: ((this: EventSource, ev: Event) => any) | null = null;
|
|
119
|
+
onmessage: ((this: EventSource, ev: MessageEvent) => any) | null = null;
|
|
120
|
+
onerror: ((this: EventSource, ev: Event) => any) | null = null;
|
|
121
|
+
|
|
122
|
+
constructor(url: string | URL, eventSourceInitDict?: EventSourceInit) {
|
|
123
|
+
super();
|
|
124
|
+
|
|
125
|
+
const urlStr = String(url);
|
|
126
|
+
try {
|
|
127
|
+
this.#url = new URL(urlStr).href;
|
|
128
|
+
} catch {
|
|
129
|
+
throw new DOMException(`Failed to construct 'EventSource': ${urlStr} is not a valid URL`, 'SyntaxError');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
this.#withCredentials = eventSourceInitDict?.withCredentials ?? false;
|
|
133
|
+
this.#loop();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
get readyState(): number {
|
|
137
|
+
return this.#readyState;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
get url(): string {
|
|
141
|
+
return this.#url;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
get withCredentials(): boolean {
|
|
145
|
+
return this.#withCredentials;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
close(): void {
|
|
149
|
+
this.#abortController.abort();
|
|
150
|
+
this.#readyState = CLOSED;
|
|
151
|
+
if (this.#reconnectionTimerId !== undefined) {
|
|
152
|
+
clearTimeout(this.#reconnectionTimerId);
|
|
153
|
+
this.#reconnectionTimerId = undefined;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
dispatchEvent(event: Event): boolean {
|
|
158
|
+
// Wire up on* attribute handlers
|
|
159
|
+
const type = event.type;
|
|
160
|
+
if (type === 'open' && this.onopen) {
|
|
161
|
+
this.onopen.call(this, event);
|
|
162
|
+
} else if (type === 'message' && this.onmessage) {
|
|
163
|
+
this.onmessage.call(this, event as MessageEvent);
|
|
164
|
+
} else if (type === 'error' && this.onerror) {
|
|
165
|
+
this.onerror.call(this, event);
|
|
166
|
+
}
|
|
167
|
+
return super.dispatchEvent(event);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async #loop(): Promise<void> {
|
|
171
|
+
const headers: Record<string, string> = {
|
|
172
|
+
'Accept': 'text/event-stream',
|
|
173
|
+
'Cache-Control': 'no-cache',
|
|
174
|
+
};
|
|
175
|
+
if (this.#lastEventId) {
|
|
176
|
+
headers['Last-Event-ID'] = this.#lastEventId;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
let res: Response;
|
|
180
|
+
try {
|
|
181
|
+
res = await fetch(this.#url, {
|
|
182
|
+
headers,
|
|
183
|
+
signal: this.#abortController.signal,
|
|
184
|
+
});
|
|
185
|
+
} catch {
|
|
186
|
+
this.#reestablishConnection();
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Validate response
|
|
191
|
+
const contentType = res.headers.get('content-type') || '';
|
|
192
|
+
if (res.status !== 200 || !contentType.toLowerCase().includes('text/event-stream')) {
|
|
193
|
+
this.#failConnection();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (this.#readyState === CLOSED) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
this.#readyState = OPEN;
|
|
201
|
+
this.dispatchEvent(new _Event('open'));
|
|
202
|
+
|
|
203
|
+
let data = '';
|
|
204
|
+
let eventType = '';
|
|
205
|
+
let lastEventId = this.#lastEventId;
|
|
206
|
+
|
|
207
|
+
try {
|
|
208
|
+
const body = res.body;
|
|
209
|
+
if (!body) {
|
|
210
|
+
this.#reestablishConnection();
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const lineStream = body
|
|
215
|
+
.pipeThrough(new TextDecoderStream())
|
|
216
|
+
.pipeThrough(new TextLineStream());
|
|
217
|
+
|
|
218
|
+
const reader = lineStream.getReader();
|
|
219
|
+
while (true) {
|
|
220
|
+
const { value: line, done } = await reader.read();
|
|
221
|
+
if (done) break;
|
|
222
|
+
|
|
223
|
+
if (line === '') {
|
|
224
|
+
// Dispatch event
|
|
225
|
+
this.#lastEventId = lastEventId;
|
|
226
|
+
if (data === '') {
|
|
227
|
+
eventType = '';
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
// Remove trailing newline from data
|
|
231
|
+
if (data.endsWith('\n')) {
|
|
232
|
+
data = data.slice(0, -1);
|
|
233
|
+
}
|
|
234
|
+
const event = new _MessageEvent(eventType || 'message', {
|
|
235
|
+
data,
|
|
236
|
+
origin: this.#url,
|
|
237
|
+
lastEventId: this.#lastEventId,
|
|
238
|
+
});
|
|
239
|
+
data = '';
|
|
240
|
+
eventType = '';
|
|
241
|
+
if (this.#readyState !== CLOSED) {
|
|
242
|
+
this.dispatchEvent(event);
|
|
243
|
+
}
|
|
244
|
+
} else if (line.startsWith(':')) {
|
|
245
|
+
// Comment — ignore
|
|
246
|
+
continue;
|
|
247
|
+
} else {
|
|
248
|
+
// Parse field
|
|
249
|
+
let field = line;
|
|
250
|
+
let value = '';
|
|
251
|
+
const colonIndex = line.indexOf(':');
|
|
252
|
+
if (colonIndex !== -1) {
|
|
253
|
+
field = line.slice(0, colonIndex);
|
|
254
|
+
value = line.slice(colonIndex + 1);
|
|
255
|
+
if (value.startsWith(' ')) {
|
|
256
|
+
value = value.slice(1);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
switch (field) {
|
|
261
|
+
case 'event':
|
|
262
|
+
eventType = value;
|
|
263
|
+
break;
|
|
264
|
+
case 'data':
|
|
265
|
+
data += value + '\n';
|
|
266
|
+
break;
|
|
267
|
+
case 'id':
|
|
268
|
+
if (!value.includes('\0')) {
|
|
269
|
+
lastEventId = value;
|
|
270
|
+
}
|
|
271
|
+
break;
|
|
272
|
+
case 'retry': {
|
|
273
|
+
const ms = Number(value);
|
|
274
|
+
if (!Number.isNaN(ms) && Number.isFinite(ms)) {
|
|
275
|
+
this.#reconnectionTime = ms;
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
} catch {
|
|
283
|
+
// Connection lost — will reestablish below
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
this.#reestablishConnection();
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
#reestablishConnection(): void {
|
|
290
|
+
if (this.#readyState === CLOSED) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
this.#readyState = CONNECTING;
|
|
294
|
+
this.dispatchEvent(new _Event('error'));
|
|
295
|
+
this.#reconnectionTimerId = setTimeout(() => {
|
|
296
|
+
if (this.#readyState !== CONNECTING) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
this.#abortController = new AbortController();
|
|
300
|
+
this.#loop();
|
|
301
|
+
}, this.#reconnectionTime);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
#failConnection(): void {
|
|
305
|
+
if (this.#readyState !== CLOSED) {
|
|
306
|
+
this.#readyState = CLOSED;
|
|
307
|
+
this.dispatchEvent(new _Event('error'));
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Register as global on GJS
|
|
313
|
+
if (typeof globalThis.EventSource === 'undefined') {
|
|
314
|
+
(globalThis as any).EventSource = EventSource;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export { TextLineStream };
|
|
318
|
+
|
|
319
|
+
export default EventSource;
|
package/src/test.mts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "ESNext",
|
|
4
|
+
"types": [
|
|
5
|
+
"node"
|
|
6
|
+
],
|
|
7
|
+
"target": "ESNext",
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"emitDeclarationOnly": true,
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"outDir": "lib",
|
|
12
|
+
"rootDir": "src",
|
|
13
|
+
"declarationDir": "lib/types",
|
|
14
|
+
"composite": true,
|
|
15
|
+
"moduleResolution": "bundler",
|
|
16
|
+
"allowImportingTsExtensions": true,
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"allowJs": true,
|
|
19
|
+
"checkJs": false,
|
|
20
|
+
"strict": false
|
|
21
|
+
},
|
|
22
|
+
"reflection": false,
|
|
23
|
+
"include": [
|
|
24
|
+
"src/**/*.ts"
|
|
25
|
+
],
|
|
26
|
+
"exclude": [
|
|
27
|
+
"src/test.ts",
|
|
28
|
+
"src/test.mts",
|
|
29
|
+
"src/**/*.spec.ts",
|
|
30
|
+
"src/**/*.spec.mts"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/typescript/lib/lib.es2024.d.ts","../../../node_modules/typescript/lib/lib.es2025.d.ts","../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../../node_modules/typescript/lib/lib.es2025.collection.d.ts","../../../node_modules/typescript/lib/lib.es2025.float16.d.ts","../../../node_modules/typescript/lib/lib.es2025.intl.d.ts","../../../node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../../node_modules/typescript/lib/lib.es2025.promise.d.ts","../../../node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../node_modules/typescript/lib/lib.esnext.date.d.ts","../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.error.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../../node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/typescript/lib/lib.esnext.full.d.ts","../streams/lib/types/util.d.ts","../streams/lib/types/readable-stream.d.ts","../streams/lib/types/transform-stream.d.ts","../streams/lib/types/text-encoder-stream.d.ts","../streams/lib/types/writable-stream.d.ts","../streams/lib/types/index.d.ts","../dom-exception/lib/types/index.d.ts","../dom-events/lib/types/index.d.ts","./src/index.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/@types/node/web-globals/blob.d.ts","../../../node_modules/@types/node/web-globals/console.d.ts","../../../node_modules/@types/node/web-globals/crypto.d.ts","../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/@types/node/web-globals/encoding.d.ts","../../../node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/undici-types/utility.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client-stats.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/round-robin-pool.d.ts","../../../node_modules/undici-types/h2c-client.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-call-history.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/snapshot-agent.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cache-interceptor.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/@types/node/web-globals/importmeta.d.ts","../../../node_modules/@types/node/web-globals/messaging.d.ts","../../../node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/@types/node/web-globals/performance.d.ts","../../../node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/@types/node/web-globals/streams.d.ts","../../../node_modules/@types/node/web-globals/timers.d.ts","../../../node_modules/@types/node/web-globals/url.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/@types/node/inspector/promises.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/path/posix.d.ts","../../../node_modules/@types/node/path/win32.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/quic.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/test/reporters.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/util/types.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts"],"fileIdsList":[[105,165,166,168,176,180,183,185,186,187,200],[105,167,168,176,180,183,185,186,187,200],[168,176,180,183,185,186,187,200],[105,168,176,180,183,185,186,187,200,208],[105,168,169,174,176,179,180,183,185,186,187,189,200,205,217],[105,168,169,170,176,179,180,183,185,186,187,200],[105,168,176,180,183,185,186,187,200],[105,168,171,176,180,183,185,186,187,200,218],[105,168,172,173,176,180,183,185,186,187,191,200],[105,168,173,176,180,183,185,186,187,200,205,214],[105,168,174,176,179,180,183,185,186,187,189,200],[105,167,168,175,176,180,183,185,186,187,200],[105,168,176,177,180,183,185,186,187,200],[105,168,176,178,179,180,183,185,186,187,200],[105,167,168,176,179,180,183,185,186,187,200],[105,168,176,179,180,181,183,185,186,187,200,205,217],[105,168,176,179,180,181,183,185,186,187,200,205,208],[105,155,168,176,179,180,182,183,185,186,187,189,200,205,217],[105,168,176,179,180,182,183,185,186,187,189,200,205,214,217],[105,168,176,180,182,183,184,185,186,187,200,205,214,217],[103,104,105,106,107,108,109,110,111,112,113,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224],[105,168,176,179,180,183,185,186,187,200],[105,168,176,180,183,185,187,200],[105,168,176,180,183,185,186,187,188,200,217],[105,168,176,179,180,183,185,186,187,189,200,205],[105,168,176,180,183,185,186,187,191,200],[105,168,176,180,183,185,186,187,192,200],[105,168,176,179,180,183,185,186,187,195,200],[105,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224],[105,168,176,180,183,185,186,187,197,200],[105,168,176,180,183,185,186,187,198,200],[105,168,173,176,180,183,185,186,187,189,200,208],[105,168,176,179,180,183,185,186,187,200,201],[105,168,176,180,183,185,186,187,200,202,218,221],[105,168,176,179,180,183,185,186,187,200,205,207,208],[105,168,176,180,183,185,186,187,200,206,208],[105,168,176,180,183,185,186,187,200,208,218],[105,168,176,180,183,185,186,187,200,209],[105,165,168,176,180,183,185,186,187,200,205,211,217],[105,168,176,180,183,185,186,187,200,205,210],[105,168,176,179,180,183,185,186,187,200,212,213],[105,168,176,180,183,185,186,187,200,212,213],[105,168,173,176,180,183,185,186,187,189,200,205,214],[105,168,176,180,183,185,186,187,200,215],[105,168,176,180,183,185,186,187,189,200,216],[105,168,176,180,182,183,185,186,187,198,200,217],[105,168,176,180,183,185,186,187,200,218,219],[105,168,173,176,180,183,185,186,187,200,219],[105,168,176,180,183,185,186,187,200,205,220],[105,168,176,180,183,185,186,187,188,200,221],[105,168,176,180,183,185,186,187,200,222],[105,168,171,176,180,183,185,186,187,200],[105,168,173,176,180,183,185,186,187,200],[105,168,176,180,183,185,186,187,200,218],[105,155,168,176,180,183,185,186,187,200],[105,168,176,180,183,185,186,187,200,217],[105,168,176,180,183,185,186,187,200,223],[105,168,176,180,183,185,186,187,195,200],[105,168,176,180,183,185,186,187,200,213],[105,155,168,176,179,180,181,183,185,186,187,195,200,205,208,217,220,221,223],[105,168,176,180,183,185,186,187,200,205,224],[105,120,123,126,127,168,176,180,183,185,186,187,200,217],[105,123,168,176,180,183,185,186,187,200,205,217],[105,123,127,168,176,180,183,185,186,187,200,217],[105,168,176,180,183,185,186,187,200,205],[105,117,168,176,180,183,185,186,187,200],[105,121,168,176,180,183,185,186,187,200],[105,119,120,123,168,176,180,183,185,186,187,200,217],[105,168,176,180,183,185,186,187,189,200,214],[105,168,176,180,183,185,186,187,200,225],[105,117,168,176,180,183,185,186,187,200,225],[105,119,123,168,176,180,183,185,186,187,189,200,217],[105,114,115,116,118,122,168,176,179,180,183,185,186,187,200,205,217],[105,123,132,140,168,176,180,183,185,186,187,200],[105,115,121,168,176,180,183,185,186,187,200],[105,123,149,150,168,176,180,183,185,186,187,200],[105,115,118,123,168,176,180,183,185,186,187,200,208,217,225],[105,123,168,176,180,183,185,186,187,200],[105,119,123,168,176,180,183,185,186,187,200,217],[105,114,168,176,180,183,185,186,187,200],[105,117,118,119,121,122,123,124,125,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,153,154,168,176,180,183,185,186,187,200],[105,123,142,145,168,176,180,183,185,186,187,200],[105,123,132,133,134,168,176,180,183,185,186,187,200],[105,121,123,133,135,168,176,180,183,185,186,187,200],[105,122,168,176,180,183,185,186,187,200],[105,115,117,123,168,176,180,183,185,186,187,200],[105,123,127,133,135,168,176,180,183,185,186,187,200],[105,127,168,176,180,183,185,186,187,200],[105,121,123,126,168,176,180,183,185,186,187,200,217],[105,115,119,123,132,168,176,180,183,185,186,187,200],[105,123,142,168,176,180,183,185,186,187,200],[105,135,168,176,180,183,185,186,187,200],[105,117,123,149,168,176,180,183,185,186,187,200,208,223,225],[100,105,168,176,180,183,185,186,187,200],[99,101,105,168,176,180,183,185,186,187,200],[95,96,97,98,105,168,176,180,183,185,186,187,200],[94,105,168,176,180,183,185,186,187,200]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"2a2de5b9459b3fc44decd9ce6100b72f1b002ef523126c1d3d8b2a4a63d74d78","affectsGlobalScope":true,"impliedFormat":1},{"version":"f13f4b465c99041e912db5c44129a94588e1aafee35a50eab51044833f50b4ee","affectsGlobalScope":true,"impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"ef4a897cd2a3f91000c10264e400b3667c7e51e1b7365f03b62e8081dc53bde6","impliedFormat":1},"8f510fcb11c19dbfe11c0ee55d1dedd047b1624c6cf82effbb66a972b4c7bc82","6339704e8391f5e9ec81e6756e597106c54aba64e1c0ab59e66e14918ed114f8","1bfa4505ea0c714b825118c7f7a8b39938565233dbf12bef982f45c3b411d36e","cc1e80a9b3e4a9c4e4f575d139f87aa3086739a9adc054a139beb9519e8116f3","2e7e48ce3998628ceebfaa64c5a4e5e46cdb617e199202c543ad6369bd208b36","2de8e7f28ed15cd7ae53908053fb49dc6c35d25dda53ead9fc0bdd4ada5c0e39","e176cbd59020ce3184e68f10e5f286e027dd444e66d490fe3836118e17babf9c","cc32bfdd88ff505c3e6b8851bb85e0a8042c1d8a6950074a4a488eb6d8c0cb21",{"version":"ef80c134146fc3ca72f1ba4e5f194fe14f582dff1ea7b73c66880f9fc39435aa","signature":"607df58a8671d505c302767741845897cf02142193936933864dc72ed2520cc0"},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ccdaa19852d25ecd84eec365c3bfa16e7859cadecf6e9ca6d0dbbbee439743f","affectsGlobalScope":true,"impliedFormat":1},{"version":"438b41419b1df9f1fbe33b5e1b18f5853432be205991d1b19f5b7f351675541e","affectsGlobalScope":true,"impliedFormat":1},{"version":"096116f8fedc1765d5bd6ef360c257b4a9048e5415054b3bf3c41b07f8951b0b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5e01375c9e124a83b52ee4b3244ed1a4d214a6cfb54ac73e164a823a4a7860a","affectsGlobalScope":true,"impliedFormat":1},{"version":"f90ae2bbce1505e67f2f6502392e318f5714bae82d2d969185c4a6cecc8af2fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b58e207b93a8f1c88bbf2a95ddc686ac83962b13830fe8ad3f404ffc7051fb4","affectsGlobalScope":true,"impliedFormat":1},{"version":"1fefabcb2b06736a66d2904074d56268753654805e829989a46a0161cd8412c5","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"c18a99f01eb788d849ad032b31cafd49de0b19e083fe775370834c5675d7df8e","affectsGlobalScope":true,"impliedFormat":1},{"version":"5247874c2a23b9a62d178ae84f2db6a1d54e6c9a2e7e057e178cc5eea13757fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"cdcf9ea426ad970f96ac930cd176d5c69c6c24eebd9fc580e1572d6c6a88f62c","impliedFormat":1},{"version":"23cd712e2ce083d68afe69224587438e5914b457b8acf87073c22494d706a3d0","impliedFormat":1},{"version":"156a859e21ef3244d13afeeba4e49760a6afa035c149dda52f0c45ea8903b338","impliedFormat":1},{"version":"10ec5e82144dfac6f04fa5d1d6c11763b3e4dbbac6d99101427219ab3e2ae887","impliedFormat":1},{"version":"615754924717c0b1e293e083b83503c0a872717ad5aa60ed7f1a699eb1b4ea5c","impliedFormat":1},{"version":"074de5b2fdead0165a2757e3aaef20f27a6347b1c36adea27d51456795b37682","impliedFormat":1},{"version":"68834d631c8838c715f225509cfc3927913b9cc7a4870460b5b60c8dbdb99baf","impliedFormat":1},{"version":"24371e69a38fc33e268d4a8716dbcda430d6c2c414a99ff9669239c4b8f40dea","impliedFormat":1},{"version":"ccab02f3920fc75c01174c47fcf67882a11daf16baf9e81701d0a94636e94556","impliedFormat":1},{"version":"3e11fce78ad8c0e1d1db4ba5f0652285509be3acdd519529bc8fcef85f7dafd9","impliedFormat":1},{"version":"ea6bc8de8b59f90a7a3960005fd01988f98fd0784e14bc6922dde2e93305ec7d","impliedFormat":1},{"version":"36107995674b29284a115e21a0618c4c2751b32a8766dd4cb3ba740308b16d59","impliedFormat":1},{"version":"914a0ae30d96d71915fc519ccb4efbf2b62c0ddfb3a3fc6129151076bc01dc60","impliedFormat":1},{"version":"9c32412007b5662fd34a8eb04292fb5314ec370d7016d1c2fb8aa193c807fe22","impliedFormat":1},{"version":"7fd1b31fd35876b0aa650811c25ec2c97a3c6387e5473eb18004bed86cdd76b6","impliedFormat":1},{"version":"4d327f7d72ad0918275cea3eee49a6a8dc8114ae1d5b7f3f5d0774de75f7439a","impliedFormat":1},{"version":"6ebe8ebb8659aaa9d1acbf3710d7dae3e923e97610238b9511c25dc39023a166","impliedFormat":1},{"version":"e85d7f8068f6a26710bff0cc8c0fc5e47f71089c3780fbede05857331d2ddec9","impliedFormat":1},{"version":"7befaf0e76b5671be1d47b77fcc65f2b0aad91cc26529df1904f4a7c46d216e9","impliedFormat":1},{"version":"0a60a292b89ca7218b8616f78e5bbd1c96b87e048849469cccb4355e98af959a","impliedFormat":1},{"version":"0b6e25234b4eec6ed96ab138d96eb70b135690d7dd01f3dd8a8ab291c35a683a","impliedFormat":1},{"version":"9666f2f84b985b62400d2e5ab0adae9ff44de9b2a34803c2c5bd3c8325b17dc0","impliedFormat":1},{"version":"40cd35c95e9cf22cfa5bd84e96408b6fcbca55295f4ff822390abb11afbc3dca","impliedFormat":1},{"version":"b1616b8959bf557feb16369c6124a97a0e74ed6f49d1df73bb4b9ddf68acf3f3","impliedFormat":1},{"version":"5b03a034c72146b61573aab280f295b015b9168470f2df05f6080a2122f9b4df","impliedFormat":1},{"version":"40b463c6766ca1b689bfcc46d26b5e295954f32ad43e37ee6953c0a677e4ae2b","impliedFormat":1},{"version":"249b9cab7f5d628b71308c7d9bb0a808b50b091e640ba3ed6e2d0516f4a8d91d","impliedFormat":1},{"version":"80aae6afc67faa5ac0b32b5b8bc8cc9f7fa299cff15cf09cc2e11fd28c6ae29e","impliedFormat":1},{"version":"f473cd2288991ff3221165dcf73cd5d24da30391f87e85b3dd4d0450c787a391","impliedFormat":1},{"version":"499e5b055a5aba1e1998f7311a6c441a369831c70905cc565ceac93c28083d53","impliedFormat":1},{"version":"8aee8b6d4f9f62cf3776cda1305fb18763e2aade7e13cea5bbe699112df85214","impliedFormat":1},{"version":"c63b9ada8c72f95aac5db92aea07e5e87ec810353cdf63b2d78f49a58662cf6c","impliedFormat":1},{"version":"1cc2a09e1a61a5222d4174ab358a9f9de5e906afe79dbf7363d871a7edda3955","impliedFormat":1},{"version":"5d0375ca7310efb77e3ef18d068d53784faf62705e0ad04569597ae0e755c401","impliedFormat":1},{"version":"59af37caec41ecf7b2e76059c9672a49e682c1a2aa6f9d7dc78878f53aa284d6","impliedFormat":1},{"version":"addf417b9eb3f938fddf8d81e96393a165e4be0d4a8b6402292f9c634b1cb00d","impliedFormat":1},{"version":"b64d4d1c5f877f9c666e98e833f0205edb9384acc46e98a1fef344f64d6aba44","impliedFormat":1},{"version":"adf27937dba6af9f08a68c5b1d3fce0ca7d4b960c57e6d6c844e7d1a8e53adae","impliedFormat":1},{"version":"12950411eeab8563b349cb7959543d92d8d02c289ed893d78499a19becb5a8cc","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"c9381908473a1c92cb8c516b184e75f4d226dad95c3a85a5af35f670064d9a2f","impliedFormat":1},{"version":"c3f5289820990ab66b70c7fb5b63cb674001009ff84b13de40619619a9c8175f","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3275d55fac10b799c9546804126239baf020d220136163f763b55a74e50e750","affectsGlobalScope":true,"impliedFormat":1},{"version":"fa68a0a3b7cb32c00e39ee3cd31f8f15b80cac97dce51b6ee7fc14a1e8deb30b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1cf059eaf468efcc649f8cf6075d3cb98e9a35a0fe9c44419ec3d2f5428d7123","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c36e755bced82df7fb6ce8169265d0a7bb046ab4e2cb6d0da0cb72b22033e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"7a93de4ff8a63bafe62ba86b89af1df0ccb5e40bb85b0c67d6bbcfdcf96bf3d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"90e85f9bc549dfe2b5749b45fe734144e96cd5d04b38eae244028794e142a77e","affectsGlobalScope":true,"impliedFormat":1},{"version":"e0a5deeb610b2a50a6350bd23df6490036a1773a8a71d70f2f9549ab009e67ee","affectsGlobalScope":true,"impliedFormat":1},{"version":"3fad5618174d74a34ee006406d4eb37e8d07dd62eb1315dbf52f48d31a337547","impliedFormat":1},{"version":"7e49f52a159435fc8df4de9dc377ef5860732ca2dc9efec1640531d3cf5da7a3","impliedFormat":1},{"version":"dd4bde4bdc2e5394aed6855e98cf135dfdf5dd6468cad842e03116d31bbcc9bc","impliedFormat":1},{"version":"4d4e879009a84a47c05350b8dca823036ba3a29a3038efed1be76c9f81e45edf","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b50a819485ffe0d237bf0d131e92178d14d11e2aa873d73615a9ec578b341f5","impliedFormat":1},{"version":"9ba13b47cb450a438e3076c4a3f6afb9dc85e17eae50f26d4b2d72c0688c9251","impliedFormat":1},{"version":"b64cd4401633ea4ecadfd700ddc8323a13b63b106ac7127c1d2726f32424622c","impliedFormat":1},{"version":"37c6e5fe5715814412b43cc9b50b24c67a63c4e04e753e0d1305970d65417a60","impliedFormat":1},{"version":"1d024184fb57c58c5c91823f9d10b4915a4867b7934e89115fd0d861a9df27c8","impliedFormat":1},{"version":"ee0e4946247f842c6dd483cbb60a5e6b484fee07996e3a7bc7343dfb68a04c5d","impliedFormat":1},{"version":"ef051f42b7e0ef5ca04552f54c4552eac84099d64b6c5ad0ef4033574b6035b8","impliedFormat":1},{"version":"853a43154f1d01b0173d9cbd74063507ece57170bad7a3b68f3fa1229ad0a92f","impliedFormat":1},{"version":"56231e3c39a031bfb0afb797690b20ed4537670c93c0318b72d5180833d98b72","impliedFormat":1},{"version":"5cc7c39031bfd8b00ad58f32143d59eb6ffc24f5d41a20931269011dccd36c5e","impliedFormat":1},{"version":"12d602a8fe4c2f2ba4f7804f5eda8ba07e0c83bf5cf0cda8baffa2e9967bfb77","affectsGlobalScope":true,"impliedFormat":1},{"version":"a856ab781967b62b288dfd85b860bef0e62f005ed4b1b8fa25c53ce17856acaf","impliedFormat":1},{"version":"cc25940cfb27aa538e60d465f98bb5068d4d7d33131861ace43f04fe6947d68f","impliedFormat":1},{"version":"8db46b61a690f15b245cf16270db044dc047dce9f93b103a59f50262f677ea1f","impliedFormat":1},{"version":"01ff95aa1443e3f7248974e5a771f513cb2ac158c8898f470a1792f817bee497","impliedFormat":1},{"version":"757227c8b345c57d76f7f0e3bbad7a91ffca23f1b2547cbed9e10025816c9cb7","impliedFormat":1},{"version":"959d0327c96dd9bb5521f3ed6af0c435996504cc8dd46baa8e12cb3b3518cef1","impliedFormat":1},{"version":"e1c1a0b4d1ead0de9eca52203aeb1f771f21e6238d6fcd15aa56ac2a02f1b7bf","impliedFormat":1},{"version":"101f482fd48cb4c7c0468dcc6d62c843d842977aea6235644b1edd05e81fbf22","impliedFormat":1},{"version":"266bee0a41e9c3ba335583e21e9277ae03822402cf5e8e1d99f5196853613b98","affectsGlobalScope":true,"impliedFormat":1},{"version":"386606f8a297988535cb1401959041cfa7f59d54b8a9ed09738e65c98684c976","impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"3ef397f12387eff17f550bc484ea7c27d21d43816bbe609d495107f44b97e933","impliedFormat":1},{"version":"1023282e2ba810bc07905d3668349fbd37a26411f0c8f94a70ef3c05fe523fcf","impliedFormat":1},{"version":"b214ebcf76c51b115453f69729ee8aa7b7f8eccdae2a922b568a45c2d7ff52f7","impliedFormat":1},{"version":"429c9cdfa7d126255779efd7e6d9057ced2d69c81859bbab32073bad52e9ba76","impliedFormat":1},{"version":"e236b5eba291f51bdf32c231673e6cab81b5410850e61f51a7a524dddadc0f95","impliedFormat":1},{"version":"ce8653341224f8b45ff46d2a06f2cacb96f841f768a886c9d8dd8ec0878b11bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f2c62938251b45715fd2a9887060ec4fbc8724727029d1cbce373747252bdd7","impliedFormat":1},{"version":"e3ace08b6bbd84655d41e244677b474fd995923ffef7149ddb68af8848b60b05","impliedFormat":1},{"version":"132580b0e86c48fab152bab850fc57a4b74fe915c8958d2ccb052b809a44b61c","impliedFormat":1},{"version":"90a278f5fab7557e69e97056c0841adf269c42697194f0bd5c5e69152637d4b3","impliedFormat":1},{"version":"69c9a5a9392e8564bd81116e1ed93b13205201fb44cb35a7fde8c9f9e21c4b23","impliedFormat":1},{"version":"5f8fc37f8434691ffac1bfd8fc2634647da2c0e84253ab5d2dd19a7718915b35","impliedFormat":1},{"version":"5981c2340fd8b076cae8efbae818d42c11ffc615994cb060b1cd390795f1be2b","impliedFormat":1},{"version":"f263485c9ca90df9fe7bb3a906db9701997dc6cae86ace1f8106ac8d2f7f677b","impliedFormat":1},{"version":"1edcf2f36fc332615846bde6dcc71a8fe526065505bc5e3dcfd65a14becdf698","affectsGlobalScope":true,"impliedFormat":1},{"version":"0250da3eb85c99624f974e77ef355cdf86f43980251bc371475c2b397ba55bcd","impliedFormat":1},{"version":"f1c93e046fb3d9b7f8249629f4b63dc068dd839b824dd0aa39a5e68476dc9420","impliedFormat":1},{"version":"3d3a5f27ffbc06c885dd4d5f9ee20de61faf877fe2c3a7051c4825903d9a7fdc","impliedFormat":1},{"version":"12806f9f085598ef930edaf2467a5fa1789a878fba077cd27e85dc5851e11834","impliedFormat":1},{"version":"1dbca38aa4b0db1f4f9e6edacc2780af7e028b733d2a98dd3598cd235ca0c97d","impliedFormat":1},{"version":"a43fe41c33d0a192a0ecaf9b92e87bef3709c9972e6d53c42c49251ccb962d69","impliedFormat":1},{"version":"a177959203c017fad3ecc4f3d96c8757a840957a4959a3ae00dab9d35961ca6c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc727ccf9b36e257ff982ea0badeffbfc2c151802f741bddff00c6af3b784cf","impliedFormat":1},{"version":"19143c930aef7ccf248549f3e78992f2f1049118ec5d4622e95025057d8e392b","impliedFormat":1},{"version":"4844a4c9b4b1e812b257676ed8a80b3f3be0e29bf05e742cc2ea9c3c6865e6c6","impliedFormat":1},{"version":"064878a60367e0407c42fb7ba02a2ea4d83257357dc20088e549bd4d89433e9c","impliedFormat":1},{"version":"cca8917838a876e2d7016c9b6af57cbf11fdf903c5fdd8e613fa31840b2957bf","impliedFormat":1},{"version":"d91ae55e4282c22b9c21bc26bd3ef637d3fe132507b10529ae68bf76f5de785b","impliedFormat":1},{"version":"b484ec11ba00e3a2235562a41898d55372ccabe607986c6fa4f4aba72093749f","impliedFormat":1},{"version":"7e8a671604329e178bb479c8f387715ebd40a091fc4a7552a0a75c2f3a21c65c","impliedFormat":1},{"version":"41ef7992c555671a8fe54db302788adefa191ded810a50329b79d20a6772d14c","impliedFormat":1},{"version":"041a7781b9127ab568d2cdcce62c58fdea7c7407f40b8c50045d7866a2727130","impliedFormat":1},{"version":"4c5e90ddbcd177ad3f2ffc909ae217c87820f1e968f6959e4b6ba38a8cec935e","impliedFormat":1},{"version":"b70dd9a44e1ac42f030bb12e7d79117eac7cb74170d72d381a1e7913320af23a","impliedFormat":1},{"version":"55cdbeebe76a1fa18bbd7e7bf73350a2173926bd3085bb050cf5a5397025ee4e","impliedFormat":1}],"root":[102],"options":{"allowImportingTsExtensions":true,"allowJs":true,"checkJs":false,"composite":true,"declaration":true,"declarationDir":"./lib/types","emitDeclarationOnly":true,"experimentalDecorators":true,"module":99,"outDir":"./lib","rootDir":"./src","skipLibCheck":true,"strict":false,"target":99},"referencedMap":[[165,1],[166,1],[167,2],[105,3],[168,4],[169,5],[170,6],[103,7],[171,8],[172,9],[173,10],[174,11],[175,12],[176,13],[177,13],[178,14],[179,15],[180,16],[181,17],[106,7],[104,7],[182,18],[183,19],[184,20],[225,21],[185,22],[186,23],[187,22],[188,24],[189,25],[191,26],[192,27],[193,27],[194,27],[195,28],[196,29],[197,30],[198,31],[199,32],[200,33],[201,33],[202,34],[203,7],[204,7],[205,35],[206,36],[207,35],[208,37],[209,38],[210,39],[211,40],[212,41],[213,42],[214,43],[215,44],[216,45],[217,46],[218,47],[219,48],[220,49],[221,50],[222,51],[107,22],[108,7],[109,52],[110,53],[111,7],[112,54],[113,7],[156,55],[157,56],[158,57],[159,57],[160,58],[161,7],[162,4],[163,59],[164,56],[223,60],[224,61],[190,7],[91,7],[92,7],[16,7],[14,7],[15,7],[20,7],[19,7],[2,7],[21,7],[22,7],[23,7],[24,7],[25,7],[26,7],[27,7],[28,7],[3,7],[29,7],[30,7],[4,7],[31,7],[35,7],[32,7],[33,7],[34,7],[36,7],[37,7],[38,7],[5,7],[39,7],[40,7],[41,7],[42,7],[6,7],[46,7],[43,7],[44,7],[45,7],[47,7],[7,7],[48,7],[53,7],[54,7],[49,7],[50,7],[51,7],[52,7],[8,7],[58,7],[55,7],[56,7],[57,7],[59,7],[9,7],[60,7],[61,7],[62,7],[64,7],[63,7],[65,7],[66,7],[10,7],[67,7],[68,7],[69,7],[11,7],[70,7],[71,7],[72,7],[73,7],[74,7],[75,7],[12,7],[76,7],[77,7],[78,7],[79,7],[80,7],[1,7],[81,7],[82,7],[13,7],[83,7],[84,7],[85,7],[86,7],[93,7],[87,7],[88,7],[89,7],[90,7],[18,7],[17,7],[132,62],[144,63],[129,64],[145,65],[154,66],[120,67],[121,68],[119,69],[153,70],[148,71],[152,72],[123,73],[141,74],[122,75],[151,76],[117,77],[118,71],[124,78],[125,7],[131,79],[128,78],[115,80],[155,81],[146,82],[135,83],[134,78],[136,84],[139,85],[133,86],[137,87],[149,70],[126,88],[127,89],[140,90],[116,65],[143,91],[142,78],[130,89],[138,92],[147,7],[114,7],[150,93],[101,94],[100,7],[102,95],[99,96],[95,97],[97,7],[96,97],[94,7],[98,97]],"latestChangedDtsFile":"./lib/types/index.d.ts","version":"6.0.2"}
|