Skip to content

@vttforge/types / WorldCollection

Interface: WorldCollection<V> ​

A world-level collection, as game.actors and game.items are. It adds document creation and compendium import on top of a plain collection.

Extends ​

Type Parameters ​

V ​

V

Properties ​

contents ​

readonly contents: V[]

The values as an array.

Inherited from ​

FoundryCollection.contents


directory ​

readonly directory: unknown


documentName ​

readonly documentName: string


name ​

readonly name: string


size ​

readonly size: number

Inherited from ​

FoundryCollection.size

Methods ​

[iterator]() ​

[iterator](): Iterator<V, any, any>

Returns ​

Iterator<V, any, any>

Inherited from ​

FoundryCollection.[iterator]


entries() ​

entries(): IterableIterator<[string, V]>

Returns ​

IterableIterator<[string, V]>

Inherited from ​

FoundryCollection.entries


every() ​

every(condition): boolean

Parameters ​

condition ​

(entry) => boolean

Returns ​

boolean

Inherited from ​

FoundryCollection.every


filter() ​

filter(condition): V[]

Parameters ​

condition ​

(entry) => boolean

Returns ​

V[]

Inherited from ​

FoundryCollection.filter


find() ​

find(condition): V | undefined

Parameters ​

condition ​

(entry) => boolean

Returns ​

V | undefined

Inherited from ​

FoundryCollection.find


forEach() ​

forEach(fn): void

Parameters ​

fn ​

(entry) => void

Returns ​

void

Inherited from ​

FoundryCollection.forEach


get() ​

get(key, options?): V | undefined

Parameters ​

key ​

string

options? ​
strict? ​

boolean

Returns ​

V | undefined

Inherited from ​

FoundryCollection.get


getName() ​

getName(name, options?): V | undefined

Look one up by name rather than by id.

Parameters ​

name ​

string

options? ​
strict? ​

boolean

Returns ​

V | undefined

Inherited from ​

FoundryCollection.getName


importFromCompendium() ​

importFromCompendium(pack, id, updateData?, options?): Promise<V>

Parameters ​

pack ​

CompendiumCollection

id ​

string

updateData? ​

Record<string, unknown>

options? ​

Record<string, unknown>

Returns ​

Promise<V>


keys() ​

keys(): IterableIterator<string>

Returns ​

IterableIterator<string>

Inherited from ​

FoundryCollection.keys


map() ​

map<U>(transformer): U[]

Type Parameters ​

U ​

U

Parameters ​

transformer ​

(entry) => U

Returns ​

U[]

Inherited from ​

FoundryCollection.map


reduce() ​

reduce<U>(reducer, initial): U

Type Parameters ​

U ​

U

Parameters ​

reducer ​

(carry, entry) => U

initial ​

U

Returns ​

U

Inherited from ​

FoundryCollection.reduce


some() ​

some(condition): boolean

Parameters ​

condition ​

(entry) => boolean

Returns ​

boolean

Inherited from ​

FoundryCollection.some


toJSON() ​

toJSON(): Record<string, unknown>[]

Returns ​

Record<string, unknown>[]

Inherited from ​

FoundryCollection.toJSON


values() ​

values(): IterableIterator<V>

Returns ​

IterableIterator<V>

Inherited from ​

FoundryCollection.values

MIT licensed.