Skip to main content

generateTypescriptInterface

@quik/entity


@quik/entity / Generators / generateTypescriptInterface

Function: generateTypescriptInterface()

generateTypescriptInterface(entity, options?): string

Defined in: entity/src/generators/generateTypescriptInterface.ts:37

Generate a TypeScript interface definition for an entity.

This function creates a TypeScript interface based on an entity definition by:

  1. Creating the interface header with JSDoc documentation
  2. Mapping entity fields to TypeScript types
  3. Handling special field types (dates, enums, entities)
  4. Adding proper type annotations and optional markers

Parameters

entity

string

Name of the entity to generate an interface for

options?

TypescriptInterfaceOptions

Configuration options for interface generation

Returns

string