Skip to content

GetConnInfo

reference
1 min readUpdated

Kind: Type

Source: src/helper/conninfo/types.ts

Part of: 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.

Was this page helpful?

Download as PDF
GetConnInfo — Hono (narrator proof)