FuncType - v0.8.85
    Preparing search index...

    Interface CollectionOps<A, Self>

    Operations specific to collections (List, Set, etc.). These operations don't make sense for single-value containers.

    interface CollectionOps<A extends Type, Self> {
        get head(): undefined | A;
        get headOption(): Option<A>;
        drop(n: number): Self;
        dropRight(n: number): Self;
        dropWhile(p: (a: A) => boolean): Self;
        flatten<B>(): Self;
        toArray<B = A>(): B[];
    }

    Type Parameters

    • A extends Type

      The element type

    • Self

      The collection type itself for proper return types

    Hierarchy (View Summary)

    Index

    Accessors

    • get head(): undefined | A

      Gets the first element of the collection.

      Returns undefined | A

    • get headOption(): Option<A>

      Gets the first element wrapped in Option.

      Returns Option<A>

    Methods

    • Drops the first n elements from the collection.

      Parameters

      • n: number

      Returns Self

    • Drops the last n elements from the collection.

      Parameters

      • n: number

      Returns Self

    • Drops elements from the start while the predicate is true.

      Parameters

      • p: (a: A) => boolean

      Returns Self

    • Flattens a collection of collections into a single collection.

      Type Parameters

      • B

      Returns Self

    • Converts the collection to an array.

      Type Parameters

      • B = A

      Returns B[]