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
mermaidgraph LR Helper["Connection info helper"] --> Type["GetConnInfo"] Type --> Consumer["Connection setup code"]
Usage
tsimport 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
GetConnInfowithimport typewhen it is only used for TypeScript checking. - Keep producers and consumers of connection information typed with
GetConnInfo. - Do not assume properties on
GetConnInfowithout checking its definition insrc/helper/conninfo/types.ts. - Update dependent helper and connection setup code when the type definition changes.
Was this page helpful?