module Zeitwerk::Registry

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/zeitwerk/registry.rbs

module Zeitwerk::Registry
  def inception?: (String cpath) -> nil
  def loader_for: (String path) -> Zeitwerk::Loader?
  def register_autoload: ((Zeitwerk::Loader | Zeitwerk::GemLoader) loader, String abspath) -> (Zeitwerk::Loader | Zeitwerk::GemLoader)
  def unregister_autoload: (String abspath) -> Zeitwerk::Loader
end

def inception?(cpath)

Experimental RBS support (using type sampling data from the type_fusion project).

def inception?: (String cpath) -> nil

This signature was generated using 12 samples from 2 applications.

Other tags:
    Private: -
def inception?(cpath)
  if pair = inceptions[cpath]
    pair.first
  end
end

def loader_for(path)

Experimental RBS support (using type sampling data from the type_fusion project).

def loader_for: (String path) -> Zeitwerk::Loader?

This signature was generated using 399 samples from 4 applications.

Other tags:
    Private: -
def loader_for(path)
  autoloads[path]
end

def loader_for_gem(root_file, namespace:, warn_on_extra_files:)

Other tags:
    Private: -
def loader_for_gem(root_file, namespace:, warn_on_extra_files:)
  gem_loaders_by_root_file[root_file] ||= GemLoader.__new(root_file, namespace: namespace, warn_on_extra_files: warn_on_extra_files)
end

def on_unload(loader)

Other tags:
    Private: -
def on_unload(loader)
  autoloads.delete_if { |_path, object| object == loader }
  inceptions.delete_if { |_cpath, (_path, object)| object == loader }
end

def register_autoload(loader, abspath)

Experimental RBS support (using type sampling data from the type_fusion project).

def register_autoload: ((Zeitwerk::Loader | Zeitwerk::GemLoader) loader, String abspath) -> (Zeitwerk::Loader | Zeitwerk::GemLoader)

This signature was generated using 10 samples from 2 applications.

Other tags:
    Private: -
def register_autoload(loader, abspath)
  autoloads[abspath] = loader
end

def register_inception(cpath, abspath, loader)

Other tags:
    Private: -
def register_inception(cpath, abspath, loader)
  inceptions[cpath] = [abspath, loader]
end

def register_loader(loader)

Other tags:
    Private: -
def register_loader(loader)
  loaders << loader
end

def unregister_autoload(abspath)

Experimental RBS support (using type sampling data from the type_fusion project).

def unregister_autoload: (String abspath) -> Zeitwerk::Loader

This signature was generated using 15 samples from 1 application.

Other tags:
    Private: -
def unregister_autoload(abspath)
  autoloads.delete(abspath)
end

def unregister_loader(loader)

Other tags:
    Private: -
def unregister_loader(loader)
  loaders.delete(loader)
  gem_loaders_by_root_file.delete_if { |_, l| l == loader }
  autoloads.delete_if { |_, l| l == loader }
  inceptions.delete_if { |_, (_, l)| l == loader }
end