export const EnumDriver = {
    /** Add or update an exported enum. Skips if enum exists and `overwrite` is false. */
    addEnum(sourceFile, enumName, members, options = {}) {
        const existing = sourceFile.getEnum(enumName);
        if (existing) {
            if (!options.overwrite)
                return;
            for (const member of existing.getMembers()) {
                member.remove();
            }
            for (const member of members) {
                if (!existing.getMember(member)) {
                    existing.addMember({ name: member, value: member });
                }
            }
        }
        else {
            sourceFile.addEnum({
                isExported: true,
                members: members.map((m) => ({ name: m, value: m })),
                name: enumName,
            });
        }
    },
};
