function sharedGroupCapacity
sharedGroupCapacity(
parentGroupIds: readonly number[],
childGroupIds: readonly number[],
staticCapByGroupId: ReadonlyMap<number, number>,
remainingByGroupId: ReadonlyMap<number, number>,
): SharedGroupCapacity

Build the SharedGroupCapacity for a parent/child pair. The two are co-grouped when their group sets meet in at least one capped group.

Both facts come from the SAME shared groups, and are the tightest value over those — never the child's tightest group overall. That is what lets a date-less surface reject a share too small to hold both, even when a daily child's per-date remaining is unknown.

Parameters

parentGroupIds: readonly number[]
childGroupIds: readonly number[]
staticCapByGroupId: ReadonlyMap<number, number>
remainingByGroupId: ReadonlyMap<number, number>

Return Type

Usage

import { sharedGroupCapacity } from "docs/config.ts";