Amplication AST Libraries Documentation
    Preparing search index...
    Args:
        | { code: string; references?: ClassReference[]
        | null }
        | { code: (writer: Writer) => void; references?: never }

    Union type defining the arguments required to create a new CodeBlock instance. Can be either a string-based code block or a function-based code block.

    Type declaration

    • { code: string; references?: ClassReference[] | null }
      • code: string

        The code to write as a string

      • Optionalreferences?: ClassReference[] | null

        A list of references that are present in the code

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

        A function that writes the code using the provided writer

      • Optionalreferences?: never