Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

list

list<Item>(item, maxLength): ListCommandField<Item>

Up to maxLength values of one kind, such as a stroke’s points, list(vector3(), 64), or a hand of chosen cards, list(integer(0, 51), 5). A list of entities is entities, and a list of lists is none.

In a trait’s schema, item is a default, as every trait field is: a primitive, list(0, 52), or a factory, list((): Slot | null => null, 40), whose type is the item’s. The list starts empty; item is what a new slot holds as resize grows it. Its changes travel as operations, one push one operation on the wire, and editList writes it. An item is plain data: no entity, vector or other class.

Type Parameter
Item extends ListItemField
Parameter Type
item Item
maxLength number

ListCommandField<Item>

list(item, maxLength): ListSchemaField<number>

Up to maxLength values of one kind, such as a stroke’s points, list(vector3(), 64), or a hand of chosen cards, list(integer(0, 51), 5). A list of entities is entities, and a list of lists is none.

In a trait’s schema, item is a default, as every trait field is: a primitive, list(0, 52), or a factory, list((): Slot | null => null, 40), whose type is the item’s. The list starts empty; item is what a new slot holds as resize grows it. Its changes travel as operations, one push one operation on the wire, and editList writes it. An item is plain data: no entity, vector or other class.

Parameter Type
item number
maxLength number

ListSchemaField<number>

list(item, maxLength): ListSchemaField<string>

Up to maxLength values of one kind, such as a stroke’s points, list(vector3(), 64), or a hand of chosen cards, list(integer(0, 51), 5). A list of entities is entities, and a list of lists is none.

In a trait’s schema, item is a default, as every trait field is: a primitive, list(0, 52), or a factory, list((): Slot | null => null, 40), whose type is the item’s. The list starts empty; item is what a new slot holds as resize grows it. Its changes travel as operations, one push one operation on the wire, and editList writes it. An item is plain data: no entity, vector or other class.

Parameter Type
item string
maxLength number

ListSchemaField<string>

list(item, maxLength): ListSchemaField<boolean>

Up to maxLength values of one kind, such as a stroke’s points, list(vector3(), 64), or a hand of chosen cards, list(integer(0, 51), 5). A list of entities is entities, and a list of lists is none.

In a trait’s schema, item is a default, as every trait field is: a primitive, list(0, 52), or a factory, list((): Slot | null => null, 40), whose type is the item’s. The list starts empty; item is what a new slot holds as resize grows it. Its changes travel as operations, one push one operation on the wire, and editList writes it. An item is plain data: no entity, vector or other class.

Parameter Type
item boolean
maxLength number

ListSchemaField<boolean>

list<Item>(item, maxLength): ListSchemaField<Item>

Up to maxLength values of one kind, such as a stroke’s points, list(vector3(), 64), or a hand of chosen cards, list(integer(0, 51), 5). A list of entities is entities, and a list of lists is none.

In a trait’s schema, item is a default, as every trait field is: a primitive, list(0, 52), or a factory, list((): Slot | null => null, 40), whose type is the item’s. The list starts empty; item is what a new slot holds as resize grows it. Its changes travel as operations, one push one operation on the wire, and editList writes it. An item is plain data: no entity, vector or other class.

Type Parameter
Item
Parameter Type
item () => Item & RefuseUnplainItem<Item>
maxLength number

ListSchemaField<Item>