Skip to content

arrayType

Import from @varavel/vdl-plugin-sdk/testing.

function arrayType(type, dims?): TypeRef;

Creates an array TypeRef wrapping the given element type.

Parameters

Parameter Type Default value Description
type TypeRef undefined Element type stored inside the array.
dims number 1 Number of array dimensions (defaults to 1).

Returns

TypeRef

An array TypeRef.

Example

arrayType(primitiveType("string"), 2);
// returns a two-dimensional array TypeRef