@petezah-games/scramjet-controller 0.0.9
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/dist/controller.api.js +74 -0
- package/dist/controller.api.js.map +1 -0
- package/dist/controller.inject.js +33 -0
- package/dist/controller.inject.js.map +1 -0
- package/dist/controller.sw.js +2 -0
- package/dist/controller.sw.js.map +1 -0
- package/dist/types/index.d.ts +43 -0
- package/dist/types/inject.d.ts +14 -0
- package/dist/types/sw.d.ts +2 -0
- package/dist/types/typesEntry.d.ts +5 -0
- package/package.json +14 -0
- package/src/index.ts +437 -0
- package/src/inject.ts +245 -0
- package/src/sw.ts +159 -0
- package/src/types.d.ts +95 -0
- package/src/typesEntry.ts +6 -0
- package/tsconfig.json +24 -0
- package/tsconfig.types.json +16 -0
package/src/inject.ts
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import type { CookieJar, ScramjetConfig } from "@mercuryworkshop/scramjet";
|
|
2
|
+
import * as $scramjet from "@mercuryworkshop/scramjet";
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
RawHeaders,
|
|
6
|
+
ProxyTransport,
|
|
7
|
+
TransferrableResponse,
|
|
8
|
+
} from "@mercuryworkshop/proxy-transports";
|
|
9
|
+
|
|
10
|
+
import { RpcHelper } from "@mercuryworkshop/rpc";
|
|
11
|
+
import type {
|
|
12
|
+
ControllerToTransport,
|
|
13
|
+
TransportToController,
|
|
14
|
+
WebSocketData,
|
|
15
|
+
WebSocketMessage,
|
|
16
|
+
} from "./types";
|
|
17
|
+
|
|
18
|
+
const MessagePort_postMessage = MessagePort.prototype.postMessage;
|
|
19
|
+
const postMessage = (
|
|
20
|
+
port: MessagePort,
|
|
21
|
+
data: any,
|
|
22
|
+
transfer?: Transferable[]
|
|
23
|
+
) => {
|
|
24
|
+
MessagePort_postMessage.call(port, data, transfer as any);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
class RemoteTransport implements ProxyTransport {
|
|
28
|
+
private readyResolve!: () => void;
|
|
29
|
+
private readyPromise: Promise<void> = new Promise((resolve) => {
|
|
30
|
+
this.readyResolve = resolve;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
public ready = false;
|
|
34
|
+
async init() {
|
|
35
|
+
await this.readyPromise;
|
|
36
|
+
this.ready = true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private rpc: RpcHelper<ControllerToTransport, TransportToController>;
|
|
40
|
+
constructor(public port: MessagePort) {
|
|
41
|
+
this.rpc = new RpcHelper<ControllerToTransport, TransportToController>(
|
|
42
|
+
{
|
|
43
|
+
ready: async () => {
|
|
44
|
+
this.readyResolve();
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
"transport",
|
|
48
|
+
(data, transfer) => {
|
|
49
|
+
postMessage(port, data, transfer);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
port.onmessageerror = (ev) => {
|
|
53
|
+
console.error("onmessageerror (this should never happen!)", ev);
|
|
54
|
+
};
|
|
55
|
+
port.onmessage = (ev) => {
|
|
56
|
+
this.rpc.recieve(ev.data);
|
|
57
|
+
};
|
|
58
|
+
port.start();
|
|
59
|
+
}
|
|
60
|
+
connect(
|
|
61
|
+
url: URL,
|
|
62
|
+
protocols: string[],
|
|
63
|
+
requestHeaders: RawHeaders,
|
|
64
|
+
onopen: (protocol: string, extensions: string) => void,
|
|
65
|
+
onmessage: (data: Blob | ArrayBuffer | string) => void,
|
|
66
|
+
onclose: (code: number, reason: string) => void,
|
|
67
|
+
onerror: (error: string) => void
|
|
68
|
+
): [
|
|
69
|
+
(data: Blob | ArrayBuffer | string) => void,
|
|
70
|
+
(code: number, reason: string) => void,
|
|
71
|
+
] {
|
|
72
|
+
const channel = new MessageChannel();
|
|
73
|
+
let port = channel.port1;
|
|
74
|
+
console.warn("connecting");
|
|
75
|
+
this.rpc
|
|
76
|
+
.call(
|
|
77
|
+
"connect",
|
|
78
|
+
{
|
|
79
|
+
url: url.href,
|
|
80
|
+
protocols,
|
|
81
|
+
requestHeaders,
|
|
82
|
+
port: channel.port2,
|
|
83
|
+
},
|
|
84
|
+
[channel.port2]
|
|
85
|
+
)
|
|
86
|
+
.then((response) => {
|
|
87
|
+
console.log(response);
|
|
88
|
+
if (response.result === "success") {
|
|
89
|
+
onopen(response.protocol, response.extensions);
|
|
90
|
+
} else {
|
|
91
|
+
onerror(response.error);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
port.onmessage = (ev) => {
|
|
95
|
+
const message = ev.data as WebSocketMessage;
|
|
96
|
+
if (message.type === "data") {
|
|
97
|
+
onmessage(message.data);
|
|
98
|
+
} else if (message.type === "close") {
|
|
99
|
+
onclose(message.code, message.reason);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
port.onmessageerror = (ev) => {
|
|
103
|
+
console.error("onmessageerror (this should never happen!)", ev);
|
|
104
|
+
onerror("Message error in transport port");
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return [
|
|
108
|
+
(data) => {
|
|
109
|
+
postMessage(
|
|
110
|
+
port,
|
|
111
|
+
{
|
|
112
|
+
type: "data",
|
|
113
|
+
data: data,
|
|
114
|
+
},
|
|
115
|
+
data instanceof ArrayBuffer ? [data] : []
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
(code) => {
|
|
119
|
+
postMessage(port, {
|
|
120
|
+
type: "close",
|
|
121
|
+
code: code,
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async request(
|
|
128
|
+
remote: URL,
|
|
129
|
+
method: string,
|
|
130
|
+
body: BodyInit | null,
|
|
131
|
+
headers: RawHeaders,
|
|
132
|
+
signal: AbortSignal | undefined
|
|
133
|
+
): Promise<TransferrableResponse> {
|
|
134
|
+
return await this.rpc.call("request", {
|
|
135
|
+
remote: remote.href,
|
|
136
|
+
method,
|
|
137
|
+
body,
|
|
138
|
+
headers,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
meta() {
|
|
143
|
+
return {};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const sw = navigator.serviceWorker.controller;
|
|
148
|
+
const { SCRAMJETCLIENT, ScramjetClient, CookieJar, setWasm } = $scramjet;
|
|
149
|
+
|
|
150
|
+
type Config = any;
|
|
151
|
+
type Init = {
|
|
152
|
+
config: Config;
|
|
153
|
+
sjconfig: ScramjetConfig;
|
|
154
|
+
cookies: string;
|
|
155
|
+
prefix: URL;
|
|
156
|
+
yieldGetInjectScripts: (
|
|
157
|
+
cookieJar: CookieJar,
|
|
158
|
+
config: Config,
|
|
159
|
+
sjconfig: ScramjetConfig,
|
|
160
|
+
prefix: URL
|
|
161
|
+
) => any;
|
|
162
|
+
codecEncode: (input: string) => string;
|
|
163
|
+
codecDecode: (input: string) => string;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export function load({
|
|
167
|
+
config,
|
|
168
|
+
sjconfig,
|
|
169
|
+
cookies,
|
|
170
|
+
prefix,
|
|
171
|
+
yieldGetInjectScripts,
|
|
172
|
+
codecEncode,
|
|
173
|
+
codecDecode,
|
|
174
|
+
}: Init) {
|
|
175
|
+
let client;
|
|
176
|
+
if (SCRAMJETCLIENT in globalThis) {
|
|
177
|
+
client = globalThis[SCRAMJETCLIENT];
|
|
178
|
+
} else {
|
|
179
|
+
setWasm(Uint8Array.from(atob(self.WASM), (c) => c.charCodeAt(0)));
|
|
180
|
+
delete self.WASM;
|
|
181
|
+
|
|
182
|
+
const channel = new MessageChannel();
|
|
183
|
+
const transport = new RemoteTransport(channel.port1);
|
|
184
|
+
sw?.postMessage(
|
|
185
|
+
{
|
|
186
|
+
$sw$initRemoteTransport: {
|
|
187
|
+
port: channel.port2,
|
|
188
|
+
prefix: prefix.href,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
[channel.port2]
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
const cookieJar = new CookieJar();
|
|
195
|
+
cookieJar.load(cookies);
|
|
196
|
+
|
|
197
|
+
const context = {
|
|
198
|
+
interface: {
|
|
199
|
+
getInjectScripts: yieldGetInjectScripts(
|
|
200
|
+
cookieJar,
|
|
201
|
+
config,
|
|
202
|
+
sjconfig,
|
|
203
|
+
prefix
|
|
204
|
+
),
|
|
205
|
+
codecEncode,
|
|
206
|
+
codecDecode,
|
|
207
|
+
},
|
|
208
|
+
prefix,
|
|
209
|
+
cookieJar,
|
|
210
|
+
config: sjconfig,
|
|
211
|
+
};
|
|
212
|
+
function createFrameId() {
|
|
213
|
+
return `${Array(8)
|
|
214
|
+
.fill(0)
|
|
215
|
+
.map(() => Math.floor(Math.random() * 36).toString(36))
|
|
216
|
+
.join("")}`;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const frame = globalThis.frameElement as HTMLIFrameElement | null;
|
|
220
|
+
if (frame && !frame.name) {
|
|
221
|
+
frame.name = createFrameId();
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
client = new ScramjetClient(globalThis, {
|
|
225
|
+
context,
|
|
226
|
+
transport,
|
|
227
|
+
sendSetCookie: async (url, cookie) => {
|
|
228
|
+
// sw.postMessage({
|
|
229
|
+
// $controller$setCookie: {
|
|
230
|
+
// url,
|
|
231
|
+
// cookie
|
|
232
|
+
// }
|
|
233
|
+
// });
|
|
234
|
+
},
|
|
235
|
+
shouldPassthroughWebsocket: (url) => {
|
|
236
|
+
return url === "wss://anura.pro/";
|
|
237
|
+
},
|
|
238
|
+
shouldBlockMessageEvent(i) {
|
|
239
|
+
return false;
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
client.hook();
|
|
244
|
+
}
|
|
245
|
+
}
|
package/src/sw.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
declare var clients: Clients;
|
|
2
|
+
import { RpcHelper } from "@mercuryworkshop/rpc";
|
|
3
|
+
import type { Controllerbound, SWbound } from "./types";
|
|
4
|
+
import type { RawHeaders } from "@mercuryworkshop/proxy-transports";
|
|
5
|
+
import { ScramjetHeaders } from "@mercuryworkshop/scramjet";
|
|
6
|
+
|
|
7
|
+
function makeId(): string {
|
|
8
|
+
return Math.random().toString(36).substring(2, 10);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let cookieResolvers: Record<string, (value: void) => void> = {};
|
|
12
|
+
addEventListener("message", (e) => {
|
|
13
|
+
if (!e.data) return;
|
|
14
|
+
if (typeof e.data != "object") return;
|
|
15
|
+
if (e.data.$sw$setCookieDone && typeof e.data.$sw$setCookieDone == "object") {
|
|
16
|
+
const done = e.data.$sw$setCookieDone;
|
|
17
|
+
|
|
18
|
+
const resolver = cookieResolvers[done.id];
|
|
19
|
+
if (resolver) {
|
|
20
|
+
resolver();
|
|
21
|
+
delete cookieResolvers[done.id];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (
|
|
26
|
+
e.data.$sw$initRemoteTransport &&
|
|
27
|
+
typeof e.data.$sw$initRemoteTransport == "object"
|
|
28
|
+
) {
|
|
29
|
+
const { port, prefix } = e.data.$sw$initRemoteTransport;
|
|
30
|
+
|
|
31
|
+
const relevantcontroller = tabs.find((tab) =>
|
|
32
|
+
new URL(prefix).pathname.startsWith(tab.prefix)
|
|
33
|
+
);
|
|
34
|
+
if (!relevantcontroller) {
|
|
35
|
+
console.error("No relevant controller found for transport init");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
relevantcontroller.rpc.call("initRemoteTransport", port, [port]);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
class ControllerReference {
|
|
43
|
+
rpc: RpcHelper<SWbound, Controllerbound>;
|
|
44
|
+
|
|
45
|
+
constructor(
|
|
46
|
+
public prefix: string,
|
|
47
|
+
public id: string,
|
|
48
|
+
port: MessagePort
|
|
49
|
+
) {
|
|
50
|
+
this.rpc = new RpcHelper(
|
|
51
|
+
{
|
|
52
|
+
sendSetCookie: async ({ url, cookie }) => {
|
|
53
|
+
let clients = await self.clients.matchAll();
|
|
54
|
+
let promises = [];
|
|
55
|
+
|
|
56
|
+
for (const client of clients) {
|
|
57
|
+
let id = makeId();
|
|
58
|
+
client.postMessage({
|
|
59
|
+
$controller$setCookie: {
|
|
60
|
+
url,
|
|
61
|
+
cookie,
|
|
62
|
+
id,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
promises.push(
|
|
66
|
+
new Promise<void>((resolve) => {
|
|
67
|
+
cookieResolvers[id] = resolve;
|
|
68
|
+
})
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
await Promise.race([
|
|
72
|
+
new Promise<void>((resolve) =>
|
|
73
|
+
setTimeout(() => {
|
|
74
|
+
console.error(
|
|
75
|
+
"timed out waiting for set cookie response (deadlock?)"
|
|
76
|
+
);
|
|
77
|
+
resolve();
|
|
78
|
+
}, 1000)
|
|
79
|
+
),
|
|
80
|
+
promises,
|
|
81
|
+
]);
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
"tabchannel-" + id,
|
|
85
|
+
(data, transfer) => {
|
|
86
|
+
port.postMessage(data, transfer);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
port.addEventListener("message", (e) => {
|
|
90
|
+
this.rpc.recieve(e.data);
|
|
91
|
+
});
|
|
92
|
+
port.onmessageerror = console.error;
|
|
93
|
+
|
|
94
|
+
this.rpc.call("ready", null);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const tabs: ControllerReference[] = [];
|
|
99
|
+
|
|
100
|
+
addEventListener("message", (e) => {
|
|
101
|
+
if (!e.data) return;
|
|
102
|
+
if (typeof e.data != "object") return;
|
|
103
|
+
if (!e.data.$controller$init) return;
|
|
104
|
+
if (typeof e.data.$controller$init != "object") return;
|
|
105
|
+
const init = e.data.$controller$init;
|
|
106
|
+
|
|
107
|
+
tabs.push(new ControllerReference(init.prefix, init.id, e.ports[0]));
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export function shouldRoute(event: FetchEvent): boolean {
|
|
111
|
+
const url = new URL(event.request.url);
|
|
112
|
+
const tab = tabs.find((tab) => url.pathname.startsWith(tab.prefix));
|
|
113
|
+
return tab !== undefined;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export async function route(event: FetchEvent): Promise<Response> {
|
|
117
|
+
try {
|
|
118
|
+
const url = new URL(event.request.url);
|
|
119
|
+
const tab = tabs.find((tab) => url.pathname.startsWith(tab.prefix))!;
|
|
120
|
+
const client = await clients.get(event.clientId);
|
|
121
|
+
|
|
122
|
+
const rawheaders: RawHeaders = [...event.request.headers];
|
|
123
|
+
|
|
124
|
+
const response = await tab.rpc.call(
|
|
125
|
+
"request",
|
|
126
|
+
{
|
|
127
|
+
rawUrl: event.request.url,
|
|
128
|
+
destination: event.request.destination,
|
|
129
|
+
mode: event.request.mode,
|
|
130
|
+
referrer: event.request.referrer,
|
|
131
|
+
method: event.request.method,
|
|
132
|
+
body: event.request.body,
|
|
133
|
+
cache: event.request.cache,
|
|
134
|
+
forceCrossOriginIsolated: false,
|
|
135
|
+
initialHeaders: rawheaders,
|
|
136
|
+
rawClientUrl: client ? client.url : undefined,
|
|
137
|
+
},
|
|
138
|
+
event.request.body instanceof ReadableStream ||
|
|
139
|
+
// @ts-expect-error the types for fetchevent are messed up
|
|
140
|
+
event.request.body instanceof ArrayBuffer
|
|
141
|
+
? [event.request.body]
|
|
142
|
+
: undefined
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
return new Response(response.body, {
|
|
146
|
+
status: response.status,
|
|
147
|
+
statusText: response.statusText,
|
|
148
|
+
headers: response.headers,
|
|
149
|
+
});
|
|
150
|
+
} catch (e) {
|
|
151
|
+
console.error("Service Worker error:", e);
|
|
152
|
+
return new Response(
|
|
153
|
+
"Internal Service Worker Error: " + (e as Error).message,
|
|
154
|
+
{
|
|
155
|
+
status: 500,
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
}
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { RawHeaders } from "@mercuryworkshop/proxy-transports";
|
|
2
|
+
|
|
3
|
+
export type BodyType =
|
|
4
|
+
| string
|
|
5
|
+
| ArrayBuffer
|
|
6
|
+
| Blob
|
|
7
|
+
| ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
8
|
+
|
|
9
|
+
export type TransferRequest = {
|
|
10
|
+
rawUrl: string;
|
|
11
|
+
destination: RequestDestination;
|
|
12
|
+
mode: RequestMode;
|
|
13
|
+
referrer: string;
|
|
14
|
+
method: string;
|
|
15
|
+
body: BodyType | null;
|
|
16
|
+
cache: RequestCache;
|
|
17
|
+
forceCrossOriginIsolated: boolean;
|
|
18
|
+
initialHeaders: RawHeaders;
|
|
19
|
+
rawClientUrl?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type TransferResponse = {
|
|
23
|
+
body: BodyType;
|
|
24
|
+
headers: RawHeaders;
|
|
25
|
+
status: number;
|
|
26
|
+
statusText: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type Controllerbound = {
|
|
30
|
+
ready: [];
|
|
31
|
+
request: [TransferRequest, TransferResponse];
|
|
32
|
+
sendSetCookie: [
|
|
33
|
+
{
|
|
34
|
+
url: string;
|
|
35
|
+
cookie: string;
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
initRemoteTransport: [MessagePort];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type SWbound = {
|
|
42
|
+
sendSetCookie: [
|
|
43
|
+
{
|
|
44
|
+
url: string;
|
|
45
|
+
cookie: string;
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type TransportToController = {
|
|
51
|
+
request: [
|
|
52
|
+
{
|
|
53
|
+
remote: string;
|
|
54
|
+
method: string;
|
|
55
|
+
body: BodyInit | null;
|
|
56
|
+
headers: RawHeaders;
|
|
57
|
+
// signal: AbortSignal | undefined
|
|
58
|
+
},
|
|
59
|
+
TransferrableResponse,
|
|
60
|
+
];
|
|
61
|
+
connect: [
|
|
62
|
+
{
|
|
63
|
+
url: string;
|
|
64
|
+
protocols: string[];
|
|
65
|
+
requestHeaders: RawHeaders;
|
|
66
|
+
port: MessagePort;
|
|
67
|
+
},
|
|
68
|
+
(
|
|
69
|
+
| {
|
|
70
|
+
result: "success";
|
|
71
|
+
protocol: string;
|
|
72
|
+
extensions: string;
|
|
73
|
+
}
|
|
74
|
+
| {
|
|
75
|
+
result: "failure";
|
|
76
|
+
error: string;
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
];
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type ControllerToTransport = {
|
|
83
|
+
ready: [];
|
|
84
|
+
};
|
|
85
|
+
export type WebSocketData = string | ArrayBuffer | Blob;
|
|
86
|
+
export type WebSocketMessage =
|
|
87
|
+
| {
|
|
88
|
+
type: "data";
|
|
89
|
+
data: WebSocketData;
|
|
90
|
+
}
|
|
91
|
+
| {
|
|
92
|
+
type: "close";
|
|
93
|
+
code: number;
|
|
94
|
+
reason: string;
|
|
95
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2022", "webworker", "DOM", "DOM.Iterable"],
|
|
7
|
+
"types": [],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"verbatimModuleSyntax": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
/* Linting */
|
|
16
|
+
"strict": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": false,
|
|
19
|
+
"erasableSyntaxOnly": false,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedSideEffectImports": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["src"]
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"emitDeclarationOnly": true,
|
|
6
|
+
"declarationDir": "./dist/types",
|
|
7
|
+
"removeComments": false,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"noEmitOnError": false,
|
|
10
|
+
"noEmit": false,
|
|
11
|
+
"strict": false,
|
|
12
|
+
"noUnusedLocals": false,
|
|
13
|
+
"noUnusedParameters": false
|
|
14
|
+
},
|
|
15
|
+
"include": ["src"]
|
|
16
|
+
}
|