---
title: "BrowserHmrChannel"
description: "The part of `remix/node-hmr`'s `BrowserHmrChannel` this module uses."
url: "https://pitlane.tools/package/content/hot/interface/BrowserHmrChannel"
---

# BrowserHmrChannel

```ts
import type { BrowserHmrChannel } from "@pitlane/content/hot";
```

The part of `remix/node-hmr`'s `BrowserHmrChannel` this module uses.

Declared structurally rather than imported, because importing the module that declares it would pull a Node-only dependency into every bundle this package reaches. [hotContent](https://pitlane.tools/package/content/hot/function/hotContent.md) holds the only import of it, loaded on demand behind its guard.

## Properties

### url

```ts
readonly url: string;
```

## Methods

### close()

```ts
close(): void;
```

Shuts the channel down.

#### Returns

`void`

---

### onFileEvents()

```ts
onFileEvents(handler): () => void;
```

Registers `handler` for batches of changed files. The browser events it resolves to are sent to connected clients. Returns a function that unregisters it.

#### Parameters

##### handler

(`events`: readonly [`FileEvent`](https://pitlane.tools/package/content/hot/interface/FileEvent.md)\[\]) => `Promise`\<readonly [`BrowserEvent`](https://pitlane.tools/package/content/hot/interface/BrowserEvent.md)\[\]>

#### Returns

() => `void`

---

### updateWatchedFiles()

```ts
updateWatchedFiles(delta): void;
```

Adds absolute paths to, and removes them from, the set the supervisor watches.

#### Parameters

##### delta

###### add

readonly `string`\[\]

###### remove

readonly `string`\[\]

#### Returns

`void`
