Amplication AST Libraries Documentation
    Preparing search index...

    Represents a Python module in the AST. This class is the top-level container for Python code, including imports, functions, classes, and global code.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    name: string

    The name of the module

    docstring?: string

    The docstring for the module

    Methods

    • Adds an import statement to the module.

      Parameters

      • importStatement: Import

        The import statement to add

      Returns void

    • Adds a function to the module.

      Parameters

      Returns void

    • Adds a class to the module.

      Parameters

      Returns void

    • Adds a global code block to the module.

      Parameters

      Returns void

    • Writes the module and its contents to the writer.

      Parameters

      • writer: Writer

        The writer to write to

      Returns void

    • Returns the string representation of the AST node. This method creates a new Writer instance and writes the node's content to it.

      Returns string

      The string representation of the AST node