// ets_tracing: off import * as List from "../../Collections/Immutable/List/index.js" import { pipe } from "../../Function/index.js" import type { TestAnnotationMap } from "../TestAnnotationMap/index.js" export interface TestAnnotationRenderer { readonly run: ( ancestors: List.List, child: TestAnnotationMap ) => List.List } export class CompositeRenderer implements TestAnnotationRenderer { readonly renderers: List.List constructor(_: readonly TestAnnotationRenderer[]) { this.renderers = List.from(_) } readonly run: ( ancestors: List.List, child: TestAnnotationMap ) => List.List = (ancestors, child) => pipe( this.renderers, List.chain((_) => _.run(ancestors, child)) ) } export const standard: TestAnnotationRenderer = new CompositeRenderer([])