# GetConnInfo

**Kind:** Type

**Source:** [`src/helper/conninfo/types.ts`](https://github.com/honojs/hono/blob/main/src/helper/conninfo/types.ts#L45)

**Part of:** [Helper](subsystem-src-helper)

Helper type

`GetConnInfo` describes the value returned when connection information is requested by helper code. It acts as the shared TypeScript contract between code that obtains connection details and code that consumes them.

## Definition

```ts
(c: Context) => ConnInfo
```

## Diagram

```mermaid
graph LR
  Helper["Connection info helper"] --> Type["GetConnInfo"]
  Type --> Consumer["Connection setup code"]
```

## Usage

```ts
import type { GetConnInfo } from './helper/conninfo/types';

declare function getConnectionInfo(): GetConnInfo;
declare function configureConnection(connInfo: GetConnInfo): void;

const connInfo: GetConnInfo = getConnectionInfo();

configureConnection(connInfo);
```

## AI Coding Instructions

- Import `GetConnInfo` with `import type` when it is only used for TypeScript checking.
- Keep producers and consumers of connection information typed with `GetConnInfo`.
- Do not assume properties on `GetConnInfo` without checking its definition in `src/helper/conninfo/types.ts`.
- Update dependent helper and connection setup code when the type definition changes.
