module RBS
  class Writer
    interface _IO
      def puts: (*untyped) -> void

      def flush: () -> void
    end

    attr_reader out: _IO
    attr_reader indentation: Array[String]

    def initialize: (out: _IO) -> void

    def indent: (?Integer size) { () -> void } -> void

    def prefix: () -> String

    def puts: (?String) -> void

    def write_annotation: (Array[AST::Annotation]) -> void

    def write_comment: (AST::Comment?) -> void

    def write: (Array[AST::Declarations::t]) -> void

    def write_decl: (AST::Declarations::t) -> void

    def write_member: (AST::Declarations::Module::member) -> void

    def name_and_params: (TypeName, AST::Declarations::ModuleTypeParams) -> String?

    def name_and_args: (TypeName, Array[Types::t]) -> String?

    def method_name: (Symbol) -> String

    def write_def: (AST::Members::MethodDefinition) -> void

    def attribute: (:reader | :writer | :accessor, AST::Members::Attribute) -> void

    interface _Located
      def location: () -> Location?
    end

    def preserve_empty_line: (_Located?, _Located) -> void
  end
end
