Theemo / @theemo/tokens / TokenCollection
Class: TokenCollection<T>
Defined in: packages/tokens/src/token-collection.ts:10
Collection of tokens.
Well suited to manage tokens
Extends
Set<T>
Type Parameters
| Type Parameter | Default type |
|---|---|
T | Token |
Methods
filter()
ts
filter(callback): TokenCollection<T>;Defined in: packages/tokens/src/token-collection.ts:27
Filters the list of tokens
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (token) => boolean | your filter function |
Returns
TokenCollection<T>
a collection of tokens matched by your filter function
find()
ts
find(callback): T | undefined;Defined in: packages/tokens/src/token-collection.ts:17
Find a token
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (token) => boolean | your search function |
Returns
T | undefined
the first token matched by the provided callback
merge()
ts
merge(tokens): TokenCollection<T>;Defined in: packages/tokens/src/token-collection.ts:49
Merges this collection with another token collection
Parameters
| Parameter | Type | Description |
|---|---|---|
tokens | TokenCollection<T> | the other token collection |
Returns
TokenCollection<T>
the merged token collection