From a96c52b21e7e590bbdd70b80896780a446fa2e8b Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Mon, 13 Dec 2021 02:07:04 +0100 Subject: build: separate module for frontend This allows us to simplify the webpack configuration and the gradle build scripts. --- subprojects/frontend/src/xtext/xtextMessages.ts | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 subprojects/frontend/src/xtext/xtextMessages.ts (limited to 'subprojects/frontend/src/xtext/xtextMessages.ts') diff --git a/subprojects/frontend/src/xtext/xtextMessages.ts b/subprojects/frontend/src/xtext/xtextMessages.ts new file mode 100644 index 00000000..c4305fcf --- /dev/null +++ b/subprojects/frontend/src/xtext/xtextMessages.ts @@ -0,0 +1,40 @@ +import { z } from 'zod'; + +export const xtextWebRequest = z.object({ + id: z.string().nonempty(), + request: z.unknown(), +}); + +export type XtextWebRequest = z.infer; + +export const xtextWebOkResponse = z.object({ + id: z.string().nonempty(), + response: z.unknown(), +}); + +export type XtextWebOkResponse = z.infer; + +export const xtextWebErrorKind = z.enum(['request', 'server']); + +export type XtextWebErrorKind = z.infer; + +export const xtextWebErrorResponse = z.object({ + id: z.string().nonempty(), + error: xtextWebErrorKind, + message: z.string(), +}); + +export type XtextWebErrorResponse = z.infer; + +export const xtextWebPushService = z.enum(['highlight', 'validate']); + +export type XtextWebPushService = z.infer; + +export const xtextWebPushMessage = z.object({ + resource: z.string().nonempty(), + stateId: z.string().nonempty(), + service: xtextWebPushService, + push: z.unknown(), +}); + +export type XtextWebPushMessage = z.infer; -- cgit v1.2.3-70-g09d2