Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.89 KB

types.array.md

File metadata and controls

27 lines (18 loc) · 1.89 KB

Home > @skunkteam/types > array

array() function

Create a type that checks whether the input is an array and all elements conform to the given elementType.

Signature:

export declare function array<Element>(
    ...args:
        | [name: string, elementType: BaseTypeImpl<Element>, typeConfig?: ArrayTypeConfig]
        | [elementType: BaseTypeImpl<Element>, typeConfig?: ArrayTypeConfig]
): TypeImpl<ArrayType<BaseTypeImpl<Element>, Element, Element[]>>;

Parameters

Parameter Type Description
args [name: string, elementType: BaseTypeImpl<Element>, typeConfig?: ArrayTypeConfig] | [elementType: BaseTypeImpl<Element>, typeConfig?: ArrayTypeConfig] optional name and element-type

Returns:

TypeImpl<ArrayType<BaseTypeImpl<Element>, Element, Element[]>>