Amplication AST Libraries Documentation
    Preparing search index...

    Type Alias CodeBlockArgs

    CodeBlockArgs:
        | { code: string; imports?: Import[]
        | null }
        | { code: (writer: Writer) => void; imports?: never }

    Configuration arguments for creating a Python code block.

    Type declaration

    • { code: string; imports?: Import[] | null }
      • code: string

        The code to write

      • Optionalimports?: Import[] | null

        A list of imports that are used in the code

    • { code: (writer: Writer) => void; imports?: never }
      • code: (writer: Writer) => void

        A function that writes code to the writer

      • Optionalimports?: never