# removePort

Canonical: https://docs.shumoku.dev/en/library/api/removePort
Language: en

@shumoku/core · 0.4.0 · function

# removePort

[Source](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/interaction.ts#L816)

Remove a port and redistribute remaining ports on the same node. Also removes any links that reference this port. Returns updated nodes, ports, and links.

```
removePort(portId: string, nodes: Map<string, Node>, ports: Map<string, ResolvedPort>, links: Link[]): { links: Link[]; nodes: Map<string, Node>; ports: Map<string, ResolvedPort> } | null
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `portId` | `string` | No additional description. | `—` |
| `nodes` | `Map<string, Node>` | No additional description. | `—` |
| `ports` | `Map<string, ResolvedPort>` | No additional description. | `—` |
| `links` | `Link[]` | No additional description. | `—` |

## Returns

```
{ links: Link[]; nodes: Map<string, Node>; ports: Map<string, ResolvedPort> } | null
```

[`libs/@shumoku/core/src/layout/interaction.ts:816`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/interaction.ts#L816)
