import { setUnionManyInto } from "collection-utils";
import { TypeAttributeKind } from "../attributes/TypeAttributes.js";
// FIXME: Don't infer provenance.  All original types should be present in
// non-inferred form in the final graph.
class ProvenanceTypeAttributeKind extends TypeAttributeKind {
    constructor() {
        super("provenance");
    }
    appliesToTypeKind(_kind) {
        return true;
    }
    combine(arr) {
        return setUnionManyInto(new Set(), arr);
    }
    makeInferred(p) {
        return p;
    }
    stringify(p) {
        return Array.from(p)
            .sort()
            .map((i) => i.toString())
            .join(",");
    }
}
export const provenanceTypeAttributeKind = new ProvenanceTypeAttributeKind();
