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, | INIT: 1, | ||||
GENERATE_CRYPTO_KEY: 2, | |||||
tomek: Can we make this more explicit and tell that it is database encryption key? I guess there might… | |||||
kamilAuthorUnsubmitted Done Inline ActionsSure, good call kamil: Sure, good call | |||||
}); | }); | ||||
export type PingWorkerRequestMessage = { | export type PingWorkerRequestMessage = { | ||||
+type: 0, | +type: 0, | ||||
+text: string, | +text: string, | ||||
}; | }; | ||||
export type InitWorkerRequestMessage = { | export type InitWorkerRequestMessage = { | ||||
+type: 1, | +type: 1, | ||||
}; | }; | ||||
export type GenerateCryptoKeyRequestMessage = { | |||||
+type: 2, | |||||
}; | |||||
export type WorkerRequestMessage = | export type WorkerRequestMessage = | ||||
| PingWorkerRequestMessage | | PingWorkerRequestMessage | ||||
| InitWorkerRequestMessage; | | InitWorkerRequestMessage | ||||
| GenerateCryptoKeyRequestMessage; | |||||
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 20 Lines |
Can we make this more explicit and tell that it is database encryption key? I guess there might be some other crypto keys in the future.