@cardsgame/client
Classes
Interfaces
Type Aliases
ArraySchemaDefinition
Ƭ ArraySchemaDefinition: ArrayOfPrimitivesDefinition | ArrayOfSchemaObjectsDefinition
ClientGameState
Ƭ ClientGameState<MoreProps>: ObjectSchema<ClientGameStateProps & MoreProps> & EntityParentNode
Type parameters
| Name | Type |
|---|---|
MoreProps | Record<string, any> |
ClientGameStateProps
Ƭ ClientGameStateProps: Object
Root game state
Type declaration
| Name | Type |
|---|---|
clients | GameClientDefinition[] |
currentPlayerIdx? | number |
isGameOver | boolean |
isGameStarted | boolean |
playerViewPosition | IPlayerViewPosition |
players | PlayerDefinition[] |
round | number |
tableHeight | number |
tableWidth | number |
turnBased | boolean |
ui? | Map<string, string> |
CollectionCallback
Ƭ CollectionCallback<T, K>: (instance: T, key: K) => void
Type parameters
| Name | Type |
|---|---|
T | T |
K | string |
Type declaration
▸ (instance, key): void
Parameters
| Name | Type |
|---|---|
instance | T |
key | K |
Returns
void
MapSchemaDefinition
Ƭ MapSchemaDefinition: MapOfPrimitivesDefinition | MapOfSchemaObjectsDefinition
ObjectSchema
Ƭ ObjectSchema<T>: ObjectSchemaColyBase<T> & DirectPrimitiveOrSchemaObject<T> & WithSchemaDefinition
Type parameters
| Name | Type |
|---|---|
T | Record<string, any> |
PrimitiveValue
Ƭ PrimitiveValue: string | boolean | number
Schema
Ƭ Schema<T, K>: ObjectSchema<T> | ObjectsCollectionSchema<T, K> | PrimitivesCollectionSchema<T, K>
Base for all fields in State in each schema.
Type parameters
| Name | Type |
|---|---|
T | any |
K | any |
SchemaChangeCallback
Ƭ SchemaChangeCallback: (changes: DataChange[]) => void
Type declaration
▸ (changes): void
Parameters
| Name | Type |
|---|---|
changes | DataChange[] |
Returns
void
SchemaDefinitionFieldTypes
Ƭ SchemaDefinitionFieldTypes: Record<string, SchemaDefinitionValue>
SchemaDefinitionValue
Ƭ SchemaDefinitionValue: string | ArraySchemaDefinition | MapSchemaDefinition | WithSchemaDefinition
Functions
isDefinitionOfArraySchema
▸ isDefinitionOfArraySchema(o): o is ArraySchemaDefinition
Parameters
| Name | Type |
|---|---|
o | unknown |
Returns
o is ArraySchemaDefinition
isDefinitionOfMapSchema
▸ isDefinitionOfMapSchema(o): o is MapSchemaDefinition
Parameters
| Name | Type |
|---|---|
o | unknown |
Returns
o is MapSchemaDefinition
isDefinitionOfObjectsCollection
▸ isDefinitionOfObjectsCollection(o): o is CollectionOfObjectsDefinition
Parameters
| Name | Type |
|---|---|
o | unknown |
Returns
o is CollectionOfObjectsDefinition
isDefinitionOfPrimitive
▸ isDefinitionOfPrimitive(o): o is string
Parameters
| Name | Type |
|---|---|
o | unknown |
Returns
o is string
isDefinitionOfPrimitivesCollection
▸ isDefinitionOfPrimitivesCollection(o): o is CollectionOfPrimitivesDefinition
Parameters
| Name | Type |
|---|---|
o | unknown |
Returns
o is CollectionOfPrimitivesDefinition
isDefinitionOfSchema
▸ isDefinitionOfSchema(o): o is WithSchemaDefinition
Parameters
| Name | Type |
|---|---|
o | unknown |
Returns
o is WithSchemaDefinition
isSchemaDefinition
▸ isSchemaDefinition(o): o is SchemaDefinition
Parameters
| Name | Type |
|---|---|
o | unknown |
Returns
o is SchemaDefinition
isSchemaObject
▸ isSchemaObject(o): o is Schema<any, any>
Parameters
| Name | Type |
|---|---|
o | unknown |
Returns
o is Schema<any, any>
isSchemaParent
▸ isSchemaParent(schema): boolean
Is given object a schema of entities container
Parameters
| Name | Type |
|---|---|
schema | ObjectSchema |
Returns
boolean
makeChildrenCollection
▸ makeChildrenCollection(schema): ChildrenDecorator
Creates new schema-like object containing all child entities in a Map.
You can subscribe to onAdd and onRemove the same way as with
any other collections.
Parameters
| Name | Type | Description |
|---|---|---|
schema | Schema | schema object of all child entities in given container entity |
Returns
ChildrenDecorator