Options
All
  • Public
  • Public/Protected
  • All
Menu

集合类

Type parameters

  • T: _.PartialShallow<T>

Hierarchy

  • CollectionBase

Index

Constructors

Properties

Methods

Constructors

constructor

  • Type parameters

    • T: PartialShallow<T>

    Returns CollectionBase<T>

Properties

Protected items

items: T[]

Methods

add

  • add(something: T): void
  • 增加元素

    Parameters

    • something: T

    Returns void

find

  • find(callback: (item: T) => void): number | T | (() => string) | { (...items: ConcatArray<T>[]): T[]; (...items: (T | ConcatArray<T>)[]): T[] } | ((searchElement: T, fromIndex?: number) => number) | ((searchElement: T, fromIndex?: number) => number) | ((start?: number, end?: number) => T[]) | (() => string) | (() => T) | ((...items: T[]) => number) | ((separator?: string) => string) | (() => T[]) | (() => T) | ((compareFn?: (a: T, b: T) => number) => T[]) | { (start: number, deleteCount?: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[] } | ((...items: T[]) => number) | ((callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any) => void) | (<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]) | { <S>(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[] } | { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U } | { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U } | { <S>(predicate: (value: T, index: number, obj: T[]) => value is S, thisArg?: any): S; (predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T } | ((predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any) => number) | ((value: T, start?: number, end?: number) => T[]) | ((target: number, start: number, end?: number) => T[]) | (() => IterableIterator<[number, T]>) | (() => IterableIterator<number>) | (() => IterableIterator<T>)
  • 查找元素

    Parameters

    • callback: (item: T) => void
        • (item: T): void
        • Parameters

          • item: T

          Returns void

    Returns number | T | (() => string) | { (...items: ConcatArray<T>[]): T[]; (...items: (T | ConcatArray<T>)[]): T[] } | ((searchElement: T, fromIndex?: number) => number) | ((searchElement: T, fromIndex?: number) => number) | ((start?: number, end?: number) => T[]) | (() => string) | (() => T) | ((...items: T[]) => number) | ((separator?: string) => string) | (() => T[]) | (() => T) | ((compareFn?: (a: T, b: T) => number) => T[]) | { (start: number, deleteCount?: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[] } | ((...items: T[]) => number) | ((callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any) => void) | (<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]) | { <S>(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[] } | { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U } | { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U } | { <S>(predicate: (value: T, index: number, obj: T[]) => value is S, thisArg?: any): S; (predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T } | ((predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any) => number) | ((value: T, start?: number, end?: number) => T[]) | ((target: number, start: number, end?: number) => T[]) | (() => IterableIterator<[number, T]>) | (() => IterableIterator<number>) | (() => IterableIterator<T>)

forEach

  • forEach(callback: (item: T, index: number) => void): void
  • 遍历

    Parameters

    • callback: (item: T, index: number) => void
        • (item: T, index: number): void
        • Parameters

          • item: T
          • index: number

          Returns void

    Returns void

get

  • get(index: number): T
  • 获取元素

    Parameters

    • index: number

    Returns T

remove

  • remove(something: T): void
  • 移除元素

    Parameters

    • something: T

    Returns void

sort

  • sort(callback: (item: T) => void): void
  • 排序

    Parameters

    • callback: (item: T) => void
        • (item: T): void
        • Parameters

          • item: T

          Returns void

    Returns void

Generated using TypeDoc