export class FlexibleViewportSpacer {
    getRows;
    before;
    after;
    constructor(getRows, before, after) {
        this.getRows = getRows;
        this.before = before;
        this.after = after;
    }
    invalidate() {
        // No cached state.
    }
    render(width) {
        const rows = this.getRows();
        const beforeHeight = this.before.reduce((height, component) => height + component.render(width).length, 0);
        const afterHeight = this.after.reduce((height, component) => height + component.render(width).length, 0);
        return Array.from({ length: Math.max(0, rows - beforeHeight - afterHeight) }, () => "");
    }
}
//# sourceMappingURL=flexible-viewport-spacer.js.map