UNPKG

@bitbybit-dev/base

Version:

Bit By Bit Developers Base CAD Library to Program Geometry

479 lines (478 loc) 14.4 kB
export declare namespace Lists { enum firstLastEnum { first = "first", last = "last" } class ListItemDto<T> { constructor(list?: T[], index?: number, clone?: boolean); /** * The list to interrogate * @default undefined */ list: T[]; /** * Index of the item in the list - 0 means first. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class SubListDto<T> { constructor(list?: T[], indexStart?: number, indexEnd?: number, clone?: boolean); /** * The list to split into a sublist * @default undefined */ list: T[]; /** * Index from which to start the sublist - 0 means first. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ indexStart: number; /** * Index to which to end the sublist - 0 means first. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ indexEnd: number; /** * Tries to clone the data in the component, sometimes it may not be possible if structure is circular * @default true */ clone?: boolean; } class ListCloneDto<T> { constructor(list?: T[], clone?: boolean); /** * The list to interrogate * @default undefined */ list: T[]; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class RepeatInPatternDto<T> { constructor(list?: T[]); /** * The list to interrogate * @default undefined */ list: T[]; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; /** * The limit of the length of the list * @default 100 * @minimum 1 * @maximum Infinity * @step 1 */ lengthLimit: number; } class SortDto<T> { constructor(list?: T[], clone?: boolean, orderAsc?: boolean); /** * The list to interrogate * @default undefined */ list: T[]; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; /** * If true, the list will be sorted in ascending order, otherwise in descending order * @default true */ orderAsc: boolean; } class SortJsonDto<T> { constructor(list?: T[], clone?: boolean, orderAsc?: boolean); /** * The list to interrogate * @default undefined */ list: T[]; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; /** * If true, the list will be sorted in ascending order, otherwise in descending order * @default true */ orderAsc: boolean; /** * The property to sort by * @default propName */ property: string; } class ListDto<T> { constructor(list?: T[]); /** * The list * @default undefined */ list: T[]; } class GroupListDto<T> { constructor(list?: T[], nrElements?: number, keepRemainder?: boolean); /** * The list of elements to group together * @default undefined */ list: T[]; /** * The number of elements in each group * @default 2 * @minimum 1 * @maximum Infinity * @step 1 */ nrElements: number; /** * If true, the remainder of the list will be added as a separate group * @default false */ keepRemainder: boolean; } class MultiplyItemDto<T> { constructor(item?: T, times?: number); /** * The item to multiply * @default undefined */ item: T; /** * Times to multiply * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ times: number; } class AddItemAtIndexDto<T> { constructor(list?: T[], item?: T, index?: number, clone?: boolean); /** * The list to which item needs to be added * @default undefined */ list: T[]; /** * The item to add * @default undefined */ item: T; /** * The index to add the item at * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class AddItemAtIndexesDto<T> { constructor(list?: T[], item?: T, indexes?: number[], clone?: boolean); /** * The list to which item needs to be added * @default undefined */ list: T[]; /** * The item to add * @default undefined */ item: T; /** * The index to add the item at * @default [0] */ indexes: number[]; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class AddItemsAtIndexesDto<T> { constructor(list?: T[], items?: T[], indexes?: number[], clone?: boolean); /** * The list to which item needs to be added * @default undefined */ list: T[]; /** * The item to add * @default undefined */ items: T[]; /** * The index to add the item at * @default [0] */ indexes: number[]; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class RemoveItemAtIndexDto<T> { constructor(list?: T[], index?: number, clone?: boolean); /** * The list from which item needs to be removed * @default undefined */ list: T[]; /** * The index to on which remove item * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class RemoveItemsAtIndexesDto<T> { constructor(list?: T[], indexes?: number[], clone?: boolean); /** * The list from which item needs to be removed * @default undefined */ list: T[]; /** * The indexes that should be removed * @default undefined */ indexes: number[]; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class RemoveNthItemDto<T> { constructor(list?: T[], nth?: number, offset?: number, clone?: boolean); /** * The list from which item needs to be removed * @default undefined */ list: T[]; /** * The nth item to remove * @default 2 * @minimum 1 * @maximum Infinity * @step 1 */ nth: number; /** * The offset from which to start counting * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ offset: number; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class RandomThresholdDto<T> { constructor(list?: T[], threshold?: number, clone?: boolean); /** * The list from which item needs to be updated * @default undefined */ list: T[]; /** * Threshold for items * @default 0.5 * @minimum 0 * @maximum 1 * @step 1 */ threshold: number; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class RemoveDuplicatesDto<T> { constructor(list?: T[], clone?: boolean); /** * The list from which item needs to be removed * @default undefined */ list: T[]; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class RemoveDuplicatesToleranceDto<T> { constructor(list?: T[], clone?: boolean, tolerance?: number); /** * The list from which item needs to be removed * @default undefined */ list: T[]; /** * The tolerance to apply * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 1e-7 */ tolerance: number; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class GetByPatternDto<T> { constructor(list?: T[], pattern?: boolean[]); /** * The list from which we need to get an item * @default undefined */ list: T[]; /** * The list of booleans to be used as a pattern (true means get, false means skip) * @default [true, true, false] */ pattern: boolean[]; } class GetNthItemDto<T> { constructor(list?: T[], nth?: number, offset?: number, clone?: boolean); /** * The list from which we need to get an item * @default undefined */ list: T[]; /** * The nth item to get * @default 2 * @minimum 1 * @maximum Infinity * @step 1 */ nth: number; /** * The offset from which to start counting * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ offset: number; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class GetLongestListLength<T> { constructor(lists?: T[]); /** * The list from which we need to get an item * @default undefined */ lists: T[]; } class MergeElementsOfLists<T> { constructor(lists?: T[], level?: number); /** * The list from which we need to get an item * @default undefined */ lists: T[]; /** * The level on which to merge the elements. 0 means first level * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ level: number; } class AddItemDto<T> { constructor(list?: T[], item?: T, clone?: boolean); /** * The list to which item needs to be added * @default undefined */ list: T[]; /** * The item to add * @default undefined */ item: T; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } class AddItemFirstLastDto<T> { constructor(list?: T[], item?: T, position?: firstLastEnum, clone?: boolean); /** * The list to which item needs to be added * @default undefined */ list: T[]; /** * The item to add * @default undefined */ item: T; /** * The option if the item needs to be added at the beginning or the end of the list * @default last */ position: firstLastEnum; /** * Tries to make structured clone of the incoming list data in the component, sometimes it may not be possible due to circular structures or other types of error * @default true */ clone?: boolean; } }