export namespace uiUtils { export interface IPartialList < T > extends Array < T > { nextLink ? : string ; } export async function listAll < T > ( client , first ) { const all = [ ] ; let list = await first ; all . push ( ... list ) ; while ( list . nextLink ) { list = await client . listNext ( list . nextLink ) ; all . push ( ... list ) ; } return all ; } }