Fix eslint errors
This commit is contained in:
parent
5b3ab651e6
commit
4e41fda93a
87 changed files with 1003 additions and 702 deletions
|
@ -1,6 +1,9 @@
|
|||
import { IContainerModel } from '../Interfaces/IContainerModel';
|
||||
import { type IContainerModel } from '../Interfaces/IContainerModel';
|
||||
|
||||
export function * MakeChildrenIterator(containers: Map<string, IContainerModel>, childrenIds: string[]): Generator<IContainerModel, void, unknown> {
|
||||
export function * MakeChildrenIterator(
|
||||
containers: Map<string, IContainerModel>,
|
||||
childrenIds: string[]
|
||||
): Generator<IContainerModel, void, unknown> {
|
||||
for (const childId of childrenIds) {
|
||||
const child = FindContainerById(containers, childId);
|
||||
|
||||
|
@ -15,7 +18,11 @@ export function * MakeChildrenIterator(containers: Map<string, IContainerModel>,
|
|||
/**
|
||||
* Returns a Generator iterating of over the children depth-first
|
||||
*/
|
||||
export function * MakeDFSIterator(root: IContainerModel, containers: Map<string, IContainerModel>, enableHideChildrenInTreeview = false): Generator<IContainerModel, void, unknown> {
|
||||
export function * MakeDFSIterator(
|
||||
root: IContainerModel,
|
||||
containers: Map<string, IContainerModel>,
|
||||
enableHideChildrenInTreeview = false
|
||||
): Generator<IContainerModel, void, unknown> {
|
||||
const queue: IContainerModel[] = [root];
|
||||
const visited = new Set<IContainerModel>(queue);
|
||||
while (queue.length > 0) {
|
||||
|
@ -51,7 +58,10 @@ export interface ContainerAndDepthAndTransform extends ContainerAndDepth {
|
|||
/**
|
||||
* Returns a Generator iterating of over the children depth-first
|
||||
*/
|
||||
export function * MakeBFSIterator(root: IContainerModel, containers: Map<string, IContainerModel>): Generator<ContainerAndDepth, void, unknown> {
|
||||
export function * MakeBFSIterator(
|
||||
root: IContainerModel,
|
||||
containers: Map<string, IContainerModel>
|
||||
): Generator<ContainerAndDepth, void, unknown> {
|
||||
const queue: IContainerModel[] = [root];
|
||||
let depth = 0;
|
||||
while (queue.length > 0) {
|
||||
|
@ -141,7 +151,10 @@ export function GetDepth(containers: Map<string, IContainerModel>, parent: ICont
|
|||
* Returns the absolute position by iterating to the parent
|
||||
* @returns The absolute position of the container
|
||||
*/
|
||||
export function GetAbsolutePosition(containers: Map<string, IContainerModel>, container: IContainerModel): [number, number] {
|
||||
export function GetAbsolutePosition(
|
||||
containers: Map<string, IContainerModel>,
|
||||
container: IContainerModel
|
||||
): [number, number] {
|
||||
const x = container.properties.x;
|
||||
const y = container.properties.y;
|
||||
const parent = FindContainerById(containers, container.properties.parentId) ?? null;
|
||||
|
@ -230,7 +243,11 @@ export function ApplyParentTransform(
|
|||
* @param id Id of the container to find
|
||||
* @returns The container found or undefined if not found
|
||||
*/
|
||||
export function FindContainerByIdDFS(root: IContainerModel, containers: Map<string, IContainerModel>, id: string): IContainerModel | undefined {
|
||||
export function FindContainerByIdDFS(
|
||||
root: IContainerModel,
|
||||
containers: Map<string, IContainerModel>,
|
||||
id: string
|
||||
): IContainerModel | undefined {
|
||||
const it = MakeDFSIterator(root, containers);
|
||||
for (const container of it) {
|
||||
if (container.properties.id === id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue