# CompactTypeVector

> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

[**@midnight-ntwrk/compact-runtime v0.21.0**](https://docs.midnight.network/api-reference/compact-runtime.md)

***

[@midnight-ntwrk/compact-runtime](https://docs.midnight.network/api-reference/compact-runtime/globals.md) / CompactTypeVector

# Class: CompactTypeVector\<A>

Runtime type of the builtin `Vector` types

## Type Parameters[​](#type-parameters "Direct link to Type Parameters")

### A[​](#a "Direct link to A")

`A`

## Implements[​](#implements "Direct link to Implements")

* [`CompactType`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/CompactType.md)<`A`\[]>

## Constructors[​](#constructors "Direct link to Constructors")

### Constructor[​](#constructor "Direct link to Constructor")

```
new CompactTypeVector<A>(length, type): CompactTypeVector<A>;
```

#### Parameters[​](#parameters "Direct link to Parameters")

##### length[​](#length "Direct link to length")

`number`

##### type[​](#type "Direct link to type")

[`CompactType`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/CompactType.md)<`A`>

#### Returns[​](#returns "Direct link to Returns")

`CompactTypeVector`<`A`>

## Properties[​](#properties "Direct link to Properties")

### length[​](#length-1 "Direct link to length")

```
readonly length: number;
```

***

### type[​](#type-1 "Direct link to type")

```
readonly type: CompactType<A>;
```

## Methods[​](#methods "Direct link to Methods")

### alignment()[​](#alignment "Direct link to alignment()")

```
alignment(): Alignment;
```

The field-aligned binary alignment of this type.

#### Returns[​](#returns-1 "Direct link to Returns")

[`Alignment`](https://docs.midnight.network/api-reference/compact-runtime/type-aliases/Alignment.md)

#### Implementation of[​](#implementation-of "Direct link to Implementation of")

[`CompactType`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/CompactType.md).[`alignment`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/CompactType.md#alignment)

***

### fromValue()[​](#fromvalue "Direct link to fromValue()")

```
fromValue(value): A[];
```

Converts this type's field-aligned binary representation to its TypeScript representation destructively; (partially) consuming the input, and ignoring superflous data for chaining.

#### Parameters[​](#parameters-1 "Direct link to Parameters")

##### value[​](#value "Direct link to value")

[`Value`](https://docs.midnight.network/api-reference/compact-runtime/type-aliases/Value.md)

#### Returns[​](#returns-2 "Direct link to Returns")

`A`\[]

#### Implementation of[​](#implementation-of-1 "Direct link to Implementation of")

[`CompactType`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/CompactType.md).[`fromValue`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/CompactType.md#fromvalue)

***

### toValue()[​](#tovalue "Direct link to toValue()")

```
toValue(value): Value;
```

Converts this type's TypeScript representation to its field-aligned binary representation

#### Parameters[​](#parameters-2 "Direct link to Parameters")

##### value[​](#value-1 "Direct link to value")

`A`\[]

#### Returns[​](#returns-3 "Direct link to Returns")

[`Value`](https://docs.midnight.network/api-reference/compact-runtime/type-aliases/Value.md)

#### Implementation of[​](#implementation-of-2 "Direct link to Implementation of")

[`CompactType`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/CompactType.md).[`toValue`](https://docs.midnight.network/api-reference/compact-runtime/interfaces/CompactType.md#tovalue)
