@vttforge/types / FoundryCollection
Interface: FoundryCollection<V> ​
Foundry's Collection, which every world collection and every embedded collection extends. Keyed by document id.
Extends ​
Iterable<V>
Extended by ​
Type Parameters ​
V ​
V
Properties ​
contents ​
readonlycontents:V[]
The values as an array.
size ​
readonlysize:number
Methods ​
[iterator]() ​
[iterator]():
Iterator<V,any,any>
Returns ​
Iterator<V, any, any>
Inherited from ​
Iterable.[iterator]
entries() ​
entries():
IterableIterator<[string,V]>
Returns ​
IterableIterator<[string, V]>
every() ​
every(
condition):boolean
Parameters ​
condition ​
(entry) => boolean
Returns ​
boolean
filter() ​
filter(
condition):V[]
Parameters ​
condition ​
(entry) => boolean
Returns ​
V[]
find() ​
find(
condition):V|undefined
Parameters ​
condition ​
(entry) => boolean
Returns ​
V | undefined
forEach() ​
forEach(
fn):void
Parameters ​
fn ​
(entry) => void
Returns ​
void
get() ​
get(
key,options?):V|undefined
Parameters ​
key ​
string
options? ​
strict? ​
boolean
Returns ​
V | undefined
getName() ​
getName(
name,options?):V|undefined
Look one up by name rather than by id.
Parameters ​
name ​
string
options? ​
strict? ​
boolean
Returns ​
V | undefined
keys() ​
keys():
IterableIterator<string>
Returns ​
IterableIterator<string>
map() ​
map<
U>(transformer):U[]
Type Parameters ​
U ​
U
Parameters ​
transformer ​
(entry) => U
Returns ​
U[]
reduce() ​
reduce<
U>(reducer,initial):U
Type Parameters ​
U ​
U
Parameters ​
reducer ​
(carry, entry) => U
initial ​
U
Returns ​
U
some() ​
some(
condition):boolean
Parameters ​
condition ​
(entry) => boolean
Returns ​
boolean
toJSON() ​
toJSON():
Record<string,unknown>[]
Returns ​
Record<string, unknown>[]
values() ​
values():
IterableIterator<V>
Returns ​
IterableIterator<V>