Theemo / @theemo/tokens / TokenCollection
Class: TokenCollection<T>
Collection of tokens.
Well suited to manage tokens
Extends
Set
<T
>
Type parameters
Type parameter | Value |
---|---|
T | Token |
Constructors
new TokenCollection()
new TokenCollection<T>(values?): TokenCollection<T>
Parameters
Parameter | Type |
---|---|
values ? | null | readonly T [] |
Returns
Inherited from
Set<T>.constructor
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:116
new TokenCollection()
new TokenCollection<T>(iterable?): TokenCollection<T>
Parameters
Parameter | Type |
---|---|
iterable ? | null | Iterable <T > |
Returns
Inherited from
Set<T>.constructor
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:116
Properties
[toStringTag]
readonly [toStringTag]: string;
Inherited from
Set.[toStringTag]
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:145
size
readonly size: number;
Inherited from
Set.size
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:112
[species]
static readonly [species]: SetConstructor;
Inherited from
Set.[species]
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:322
Methods
[iterator]
()
iterator: IterableIterator<T>
Iterates over values in the set.
Returns
IterableIterator
<T
>
Inherited from
Set.[iterator]
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.iterable.d.ts:170
add()
add(value): this
Appends a new element with a specified value to the end of the Set.
Parameters
Parameter | Type |
---|---|
value | T |
Returns
this
Inherited from
Set.add
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:93
clear()
clear(): void
Returns
void
Inherited from
Set.clear
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:95
delete()
delete(value): boolean
Removes a specified value from the Set.
Parameters
Parameter | Type |
---|---|
value | T |
Returns
boolean
Returns true if an element in the Set existed and has been removed, or false if the element does not exist.
Inherited from
Set.delete
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:100
entries()
entries(): IterableIterator<[T, T]>
Returns an iterable of [v,v] pairs for every value v
in the set.
Returns
IterableIterator
<[T
, T
]>
Inherited from
Set.entries
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.iterable.d.ts:174
every()
every(callback): boolean
Parameters
Parameter | Type |
---|---|
callback | (token ) => boolean |
Returns
boolean
Source
packages/@theemo/tokens/src/token-collection.ts:39
filter()
filter(callback): TokenCollection<T>
Filters the list of tokens
Parameters
Parameter | Type | Description |
---|---|---|
callback | (token ) => boolean | your filter function |
Returns
a collection of tokens matched by your filter function
Source
packages/@theemo/tokens/src/token-collection.ts:27
find()
find(callback): undefined | T
Find a token
Parameters
Parameter | Type | Description |
---|---|---|
callback | (token ) => boolean | your search function |
Returns
undefined
| T
the first token matched by the provided callback
Source
packages/@theemo/tokens/src/token-collection.ts:17
forEach()
forEach(callbackfn, thisArg?): void
Executes a provided function once per each value in the Set object, in insertion order.
Parameters
Parameter | Type |
---|---|
callbackfn | (value , value2 , set ) => void |
thisArg ? | any |
Returns
void
Inherited from
Set.forEach
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:104
has()
has(value): boolean
Parameters
Parameter | Type |
---|---|
value | T |
Returns
boolean
a boolean indicating whether an element with the specified value exists in the Set or not.
Inherited from
Set.has
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:108
keys()
keys(): IterableIterator<T>
Despite its name, returns an iterable of the values in the set.
Returns
IterableIterator
<T
>
Inherited from
Set.keys
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.iterable.d.ts:178
map()
map<U>(callback): TokenCollection<U>
Type parameters
Type parameter |
---|
U |
Parameters
Parameter | Type |
---|---|
callback | (token ) => U |
Returns
Source
packages/@theemo/tokens/src/token-collection.ts:31
merge()
merge(tokens): TokenCollection<T>
Merges this collection with another token collection
Parameters
Parameter | Type | Description |
---|---|---|
tokens | TokenCollection <T > | the other token collection |
Returns
the merged token collection
Source
packages/@theemo/tokens/src/token-collection.ts:49
some()
some(callback): boolean
Parameters
Parameter | Type |
---|---|
callback | (token ) => boolean |
Returns
boolean
Source
packages/@theemo/tokens/src/token-collection.ts:35
values()
values(): IterableIterator<T>
Returns an iterable of values in the set.
Returns
IterableIterator
<T
>
Inherited from
Set.values
Source
node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.iterable.d.ts:183