Skip to content

Theemo / @theemo/tokens / TokenCollection

Class: TokenCollection<T>

Collection of tokens.

Well suited to manage tokens

Extends

  • Set<T>

Type parameters

Type parameterValue
TToken

Constructors

new TokenCollection()

ts
new TokenCollection<T>(values?): TokenCollection<T>

Parameters

ParameterType
values?null | readonly T[]

Returns

TokenCollection<T>

Inherited from

Set<T>.constructor

Source

node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:116

new TokenCollection()

ts
new TokenCollection<T>(iterable?): TokenCollection<T>

Parameters

ParameterType
iterable?null | Iterable<T>

Returns

TokenCollection<T>

Inherited from

Set<T>.constructor

Source

node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:116

Properties

[toStringTag]

ts
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

ts
readonly size: number;

Inherited from

Set.size

Source

node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:112


[species]

ts
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]()

ts
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()

ts
add(value): this

Appends a new element with a specified value to the end of the Set.

Parameters

ParameterType
valueT

Returns

this

Inherited from

Set.add

Source

node_modules/.pnpm/[email protected]/node_modules/typescript/lib/lib.es2015.collection.d.ts:93


clear()

ts
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()

ts
delete(value): boolean

Removes a specified value from the Set.

Parameters

ParameterType
valueT

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()

ts
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()

ts
every(callback): boolean

Parameters

ParameterType
callback(token) => boolean

Returns

boolean

Source

packages/@theemo/tokens/src/token-collection.ts:39


filter()

ts
filter(callback): TokenCollection<T>

Filters the list of tokens

Parameters

ParameterTypeDescription
callback(token) => booleanyour filter function

Returns

TokenCollection<T>

a collection of tokens matched by your filter function

Source

packages/@theemo/tokens/src/token-collection.ts:27


find()

ts
find(callback): undefined | T

Find a token

Parameters

ParameterTypeDescription
callback(token) => booleanyour search function

Returns

undefined | T

the first token matched by the provided callback

Source

packages/@theemo/tokens/src/token-collection.ts:17


forEach()

ts
forEach(callbackfn, thisArg?): void

Executes a provided function once per each value in the Set object, in insertion order.

Parameters

ParameterType
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()

ts
has(value): boolean

Parameters

ParameterType
valueT

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()

ts
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()

ts
map<U>(callback): TokenCollection<U>

Type parameters

Type parameter
U

Parameters

ParameterType
callback(token) => U

Returns

TokenCollection<U>

Source

packages/@theemo/tokens/src/token-collection.ts:31


merge()

ts
merge(tokens): TokenCollection<T>

Merges this collection with another token collection

Parameters

ParameterTypeDescription
tokensTokenCollection<T>the other token collection

Returns

TokenCollection<T>

the merged token collection

Source

packages/@theemo/tokens/src/token-collection.ts:49


some()

ts
some(callback): boolean

Parameters

ParameterType
callback(token) => boolean

Returns

boolean

Source

packages/@theemo/tokens/src/token-collection.ts:35


values()

ts
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