Changeset View
Changeset View
Standalone View
Standalone View
web/types/worker-types.js
// @flow | // @flow | ||||
// The types of messages sent from app to worker | // The types of messages sent from app to worker | ||||
export const workerRequestMessageTypes = Object.freeze({ | export const workerRequestMessageTypes = Object.freeze({ | ||||
PING: 0, | PING: 0, | ||||
INIT: 1, | |||||
}); | }); | ||||
export type PingWorkerRequestMessage = { | export type PingWorkerRequestMessage = { | ||||
+type: 0, | +type: 0, | ||||
+text: string, | +text: string, | ||||
}; | }; | ||||
export type WorkerRequestMessage = PingWorkerRequestMessage; | export type InitWorkerRequestMessage = { | ||||
+type: 1, | |||||
+sqljsFilePath: string, | |||||
+sqljsFilename: ?string, | |||||
}; | |||||
export type WorkerRequestMessage = | |||||
| PingWorkerRequestMessage | |||||
| InitWorkerRequestMessage; | |||||
export type WorkerRequestProxyMessage = { | export type WorkerRequestProxyMessage = { | ||||
+id: number, | +id: number, | ||||
+message: WorkerRequestMessage, | +message: WorkerRequestMessage, | ||||
}; | }; | ||||
// The types of messages sent from worker to app | // The types of messages sent from worker to app | ||||
export const workerResponseMessageTypes = Object.freeze({ | export const workerResponseMessageTypes = Object.freeze({ | ||||
Show All 21 Lines |