Creates player state and uses it to get and set values from local storage
This commit is contained in:
@@ -10,6 +10,7 @@ export const isGameStateEvent = new tg.IsInterface()
|
||||
tags: tg.isArray(tg.isString),
|
||||
variables: tg.isObject,
|
||||
userRoomToken: tg.isUnion(tg.isString, tg.isUndefined),
|
||||
playerVariables: tg.isObject,
|
||||
})
|
||||
.get();
|
||||
/**
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import * as tg from "generic-type-guard";
|
||||
|
||||
export const isPlayerPropertyEvent = new tg.IsInterface()
|
||||
.withProperties({
|
||||
propertyName: tg.isString,
|
||||
propertyValue: tg.isUnknown,
|
||||
})
|
||||
.get();
|
||||
|
||||
/**
|
||||
* A message sent from the iFrame to set player-related properties.
|
||||
*/
|
||||
export type PlayerPropertyEvent = tg.GuardedType<typeof isPlayerPropertyEvent>;
|
||||
@@ -4,6 +4,7 @@ export const isSetVariableEvent = new tg.IsInterface()
|
||||
.withProperties({
|
||||
key: tg.isString,
|
||||
value: tg.isUnknown,
|
||||
target: tg.isSingletonStringUnion("global", "player"),
|
||||
})
|
||||
.get();
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user