Nog CLI Developer Guide - v0.11.0
    Preparing search index...

    Utility class for building TypeScript declarations (Interfaces, Type Aliases, Variables). Designed to be injected via DI.

    Index

    Constructors

    Methods

    • Creates an exported constant variable statement.

      Parameters

      • name: string
      • initializer: Expression

      Returns VariableStatement

      export const API_CONFIG = Symbol("API_CONFIG");
      
    • Helper to create an ExpressionWithTypeArguments, used in inheritance (extends).

      Parameters

      • identifierName: string
      • OptionaltypeArgs: TypeNode[]

      Returns ExpressionWithTypeArguments

      Pick<ModuleMetadata, "imports">
      
    • Creates a Function Type Node.

      Parameters

      • parameters: ParameterDeclaration[]
      • returnType: TypeNode

      Returns FunctionTypeNode

      (...args: unknown[]) => Promise<ApiModuleConfig>
      
    • Creates an exported Interface.

      Parameters

      • name: string

        The name of the interface.

      • members: TypeElement[]

        The properties and methods of the interface.

      • OptionalextendsTypes: ExpressionWithTypeArguments[]

        Optional array of expressions for the 'extends' clause.

      Returns InterfaceDeclaration

    • Creates a Method Signature for an interface.

      Parameters

      • name: string
      • parameters: ParameterDeclaration[]
      • returnType: TypeNode

      Returns MethodSignature

      createApiModuleConfig(): Promise<ApiModuleConfig>;
      
    • Creates an optional Property Signature for an interface.

      Parameters

      • name: string
      • type: TypeNode

      Returns PropertySignature

      baseUrl?: string;
      
    • Creates an exported Type Alias.

      Parameters

      • name: string
      • type: TypeNode

      Returns TypeAliasDeclaration

      export type ApiHeaders = Record<string, string>;