I prefix is used for interfaces

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the types category.

Last Updated: 2024-03-02

When browsing through the Project M code I was thrown by entities with names like IConnectionOptions. Referring to the source definition, I saw that these were in fact interfaces

export interface IConnectionOptions {
  database: string
  host: string
  password: string
  port: number
  username: string
  synchronize?: boolean

The actual ConnectionOptions type was defined elsewhere

export class ConnectionOptions {
  public database: string

  public host: string

  public password: string

  public username: string

  public port: number

  public synchronize?: boolean