StaticArray
@algorandfoundation/algorand-typescript
@algorandfoundation/algorand-typescript / arc4 / StaticArray
Class: StaticArray<TItem, TLength>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:307
A fixed sized array of arc4 items
Extends
Arc4ArrayBase
<TItem
>
Type Parameters
• TItem extends ARC4Encoded
The type of a single item in the array
• TLength extends number
The fixed length of the array
Indexable
[index
: uint64
]: TItem
Constructors
new StaticArray()
new StaticArray<
TItem
,TLength
>():StaticArray
<TItem
,TLength
>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:314
Create a new StaticArray instance
Returns
StaticArray
<TItem
, TLength
>
Overrides
new StaticArray()
new StaticArray<
TItem
,TLength
>(…items
):StaticArray
<TItem
,TLength
>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:319
Create a new StaticArray instance with the specified items
Parameters
items
…TItem
[] & object
The initial items for the array
Returns
StaticArray
<TItem
, TLength
>
Overrides
Arc4ArrayBase<TItem>.constructor
Accessors
bytes
Get Signature
get bytes():
bytes
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:97
Retrieve the encoded bytes for this type
Returns
Inherited from
length
Get Signature
get length():
uint64
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:240
Returns the current length of this array
Returns
Inherited from
Methods
[iterator]()
[iterator]():
IterableIterator
<TItem
>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:277
Returns an iterator for the items in this array
Returns
IterableIterator
<TItem
>
Inherited from
at()
at(
index
):TItem
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:249
Returns the item at the given index. Negative indexes are taken from the end.
Parameters
index
The index of the item to retrieve
Returns
TItem
Inherited from
concat()
concat(
other
):DynamicArray
<TItem
>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:335
Returns a new array containing all items from this array, and other array
Parameters
other
Arc4ArrayBase
<TItem
>
Another array to concat with this one
Returns
DynamicArray
<TItem
>
copy()
copy():
StaticArray
<TItem
,TLength
>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:327
Returns a copy of this array
Returns
StaticArray
<TItem
, TLength
>
entries()
entries():
IterableIterator
<readonly [uint64
,TItem
]>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:284
Returns an iterator for a tuple of the indexes and items in this array
Returns
IterableIterator
<readonly [uint64
, TItem
]>
Inherited from
keys()
keys():
IterableIterator
<uint64
>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:291
Returns an iterator for the indexes in this array
Returns
Inherited from
slice()
Call Signature
slice():
DynamicArray
<TItem
>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:256
Internal
Create a new Dynamic array with all items from this array
Returns
DynamicArray
<TItem
>
Inherited from
Call Signature
slice(
end
):DynamicArray
<TItem
>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:262
Internal
Create a new DynamicArray with all items up till end
.
Negative indexes are taken from the end.
Parameters
end
An index in which to stop copying items.
Returns
DynamicArray
<TItem
>
Inherited from
Call Signature
slice(
start
,end
):DynamicArray
<TItem
>
Defined in: packages/algo-ts/src/arc4/encoded-types.ts:269
Internal
Create a new DynamicArray with items from start
, up until end
Negative indexes are taken from the end.
Parameters
start
An index in which to start copying items.
end
An index in which to stop copying items
Returns
DynamicArray
<TItem
>