diff --git a/src/mol-util/type-helpers.ts b/src/mol-util/type-helpers.ts index 22e9b6ae51afe0c1832ccafc3d2db7ef09f09e85..85b68218d63460d2e7b4de89a791cca0e1f0ea1a 100644 --- a/src/mol-util/type-helpers.ts +++ b/src/mol-util/type-helpers.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2018-2019 mol* contributors, licensed under MIT, See LICENSE file for more info. + * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> * @author David Sehnal <david.sehnal@gmail.com> @@ -17,4 +17,6 @@ export type UintArray = Uint8Array | Uint16Array | Uint32Array | number[] export type ValueOf<T> = T[keyof T] export type ArrayCtor<T> = { new(size: number): { [i: number]: T, length: number } } /** assignable ArrayLike version */ -export type AssignableArrayLike<T> = { [i: number]: T, length: number } \ No newline at end of file +export type AssignableArrayLike<T> = { [i: number]: T, length: number } + +export type NonNullableArray<T extends any[] | ReadonlyArray<any>> = T extends any[] ? NonNullable<T[0]>[] : ReadonlyArray<NonNullable<T[0]>>