# This file is generated by the templates/template.rb script and should not be
# modified manually. See templates/sig/prism.rbs.erb
# if you are looking to modify the template

module Prism
  BACKEND: :CEXT | :FFI
  VERSION: String

  class CurrentVersionError < ArgumentError
    def initialize: (String version) -> void
  end

  # Methods taking a Ruby source code string:

  def self.parse: (
    String source,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> ParseResult

  def self.profile: (
    String source,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> nil

  def self.lex: (
    String source,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> LexResult

  def self.lex_compat: (
    String source,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> LexCompat::Result

  def self.parse_lex: (
    String source,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> ParseLexResult

  def self.dump: (
    String source,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> String

  def self.parse_comments: (
    String source,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> Array[comment]

  def self.parse_success?: (
    String source,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> bool

  def self.parse_failure?: (
    String source,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> bool

  def self.load: (
    String source,
    String serialized,
    ?bool freeze
  ) -> ParseResult

  def self.lex_ripper: (
    String source
  ) -> Array[[[Integer, Integer], Symbol, String, untyped]]

  # Methods taking a path to a Ruby file:

  def self.parse_file: (
    String filepath,
    ?encoding: Encoding | false,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> ParseResult

  def self.profile_file: (
    String filepath,
    ?encoding: Encoding | false,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> nil

  def self.lex_file: (
    String filepath,
    ?encoding: Encoding | false,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> LexResult

  def self.parse_lex_file: (
    String filepath,
    ?encoding: Encoding | false,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> ParseLexResult

  def self.dump_file: (
    String filepath,
    ?encoding: Encoding | false,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> String

  def self.parse_file_comments: (
    String filepath,
    ?encoding: Encoding | false,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> Array[comment]

  def self.parse_file_success?: (
    String filepath,
    ?encoding: Encoding | false,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> bool

  def self.parse_file_failure?: (
    String filepath,
    ?encoding: Encoding | false,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> bool

  interface _Stream
    def gets: (?Integer integer) -> (String | nil)
  end

  def self.parse_stream: (
    _Stream stream,
    ?encoding: Encoding | false,
    ?filepath: String,
    ?freeze: bool,
    ?frozen_string_literal: bool,
    ?line: Integer,
    ?main_script: bool,
    ?offset: Integer,
    ?scopes: Array[Array[Symbol]],
    ?verbose: bool
  ) -> ParseResult

  def self.scope: (?locals: Array[Symbol], ?forwarding: Array[Symbol]) -> Scope
end
