-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ws' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { SCENE_UPDATE, SceneUpdate } from "./scene-update"; | ||
import { UPDATE, Update } from "./update"; | ||
|
||
export * from './scene-update' | ||
export * from './update' | ||
|
||
/** @public */ | ||
export type Actions = typeof SCENE_UPDATE | ||
| typeof UPDATE | ||
|
||
/** @public */ | ||
export type WsMessages = SceneUpdate | Update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { generateValidator, JSONSchema, ValidateFunction } from "../../validation"; | ||
|
||
/** @public */ | ||
export const SCENE_UPDATE = 'SCENE_UPDATE' | ||
|
||
/** @public */ | ||
export type SceneUpdate = { | ||
type: typeof SCENE_UPDATE; | ||
payload: { | ||
sceneId: string; | ||
sceneType: string; | ||
} | ||
}; | ||
|
||
/** @public */ | ||
export namespace SceneUpdate { | ||
export const schema: JSONSchema<SceneUpdate> = { | ||
type: "object", | ||
properties: { | ||
type: { | ||
type: "string", | ||
enum: [SCENE_UPDATE] | ||
}, | ||
payload: { | ||
type: "object", | ||
properties: { | ||
sceneId: { | ||
type: "string" | ||
}, | ||
sceneType: { | ||
type: "string" | ||
}, | ||
}, | ||
additionalProperties: false, | ||
required: ["sceneId", "sceneType"], | ||
}, | ||
}, | ||
required: ['payload', 'type'] | ||
}; | ||
|
||
export const validate: ValidateFunction<SceneUpdate> = generateValidator(schema); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { generateValidator, JSONSchema, ValidateFunction } from "../../validation"; | ||
|
||
/** @public @deprecated */ | ||
export const UPDATE = 'update' | ||
|
||
/** @public @deprecated */ | ||
export type Update = { | ||
type: typeof UPDATE; | ||
}; | ||
|
||
/** @public @deprecated */ | ||
export namespace Update { | ||
export const schema: JSONSchema<Update> = { | ||
type: "object", | ||
properties: { | ||
type: { | ||
type: "string", | ||
enum: [UPDATE] | ||
}, | ||
}, | ||
required: ['type'] | ||
}; | ||
|
||
export const validate: ValidateFunction<Update> = generateValidator(schema); | ||
} |