From c9dd072f3c1067d988d31271122389d05093bfd3 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Wed, 31 Jul 2024 06:41:06 +0000 Subject: [PATCH] bin/tapioca gem --- sorbet/rbi/gems/terser@1.2.3.rbi | 258 +++++++++++++++++++++++++++++++ 1 file changed, 258 insertions(+) create mode 100644 sorbet/rbi/gems/terser@1.2.3.rbi diff --git a/sorbet/rbi/gems/terser@1.2.3.rbi b/sorbet/rbi/gems/terser@1.2.3.rbi new file mode 100644 index 000000000..93fdb68d4 --- /dev/null +++ b/sorbet/rbi/gems/terser@1.2.3.rbi @@ -0,0 +1,258 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `terser` gem. +# Please instead update this file by running `bin/tapioca gem terser`. + + +# A wrapper around the Terser interface +# +# source://terser//lib/terser/railtie.rb#5 +class Terser + # Initialize new context for Terser with given options + # + # @param options [Hash] optional overrides to +Terser::DEFAULTS+ + # @raise [ArgumentError] + # @return [Terser] a new instance of Terser + # + # source://terser//lib/terser.rb#151 + def initialize(options = T.unsafe(nil)); end + + # Minifies JavaScript code + # + # @param source [IO, String] valid JS source code. + # @param source_map_options [Hash] optional + # @return [String] minified code. + # + # source://terser//lib/terser.rb#163 + def compile(source, source_map_options = T.unsafe(nil)); end + + # Minifies JavaScript code and generates a source map + # + # @param source [IO, String] valid JS source code. + # @param source_map_options [Hash] optional + # @return [Array(String, String)] minified code and source map. + # + # source://terser//lib/terser.rb#180 + def compile_with_map(source, source_map_options = T.unsafe(nil)); end + + # Minifies JavaScript code + # + # @param source [IO, String] valid JS source code. + # @param source_map_options [Hash] optional + # @return [String] minified code. + # + # source://terser//lib/terser.rb#163 + def compress(source, source_map_options = T.unsafe(nil)); end + + private + + # source://terser//lib/terser.rb#360 + def comment_options; end + + # source://terser//lib/terser.rb#391 + def comment_setting; end + + # source://terser//lib/terser.rb#335 + def compressor_options; end + + # source://terser//lib/terser.rb#471 + def conditional_option(value, defaults, overrides = T.unsafe(nil)); end + + # source://terser//lib/terser.rb#186 + def context; end + + # source://terser//lib/terser.rb#264 + def context_lines_message(source, line_number, column); end + + # source://terser//lib/terser.rb#451 + def enclose_options; end + + # source://terser//lib/terser.rb#461 + def encode_regexp(regexp); end + + # source://terser//lib/terser.rb#236 + def error_context_format_options(low, high, line_index, column); end + + # source://terser//lib/terser.rb#232 + def error_context_lines; end + + # source://terser//lib/terser.rb#278 + def error_message(result, options); end + + # source://terser//lib/terser.rb#493 + def extract_source_mapping_url(source); end + + # source://terser//lib/terser.rb#247 + def format_error_line(line, options); end + + # source://terser//lib/terser.rb#254 + def format_lines(lines, options); end + + # source://terser//lib/terser.rb#503 + def input_source_map(source, generate_map, options); end + + # @return [Boolean] + # + # source://terser//lib/terser.rb#415 + def keep_classnames?(type); end + + # @return [Boolean] + # + # source://terser//lib/terser.rb#406 + def keep_fnames?(type); end + + # source://terser//lib/terser.rb#302 + def mangle_options; end + + # source://terser//lib/terser.rb#316 + def mangle_properties_options; end + + # Prevent negate_iife when wrap_iife is true + # + # source://terser//lib/terser.rb#352 + def negate_iife_block; end + + # source://terser//lib/terser.rb#401 + def output_options; end + + # source://terser//lib/terser.rb#438 + def parse_options(source_map_options); end + + # @raise [Error] + # + # source://terser//lib/terser.rb#284 + def parse_result(result, generate_map, options, source_map_options = T.unsafe(nil)); end + + # source://terser//lib/terser.rb#443 + def parse_source_map_options(source_map_options); end + + # source://terser//lib/terser.rb#375 + def quote_style; end + + # source://terser//lib/terser.rb#294 + def read_source(source); end + + # Run TerserJS for given source code + # + # source://terser//lib/terser.rb#217 + def run_terserjs(input, generate_map, source_map_options = T.unsafe(nil)); end + + # source://terser//lib/terser.rb#481 + def sanitize_map_root(map); end + + # source://terser//lib/terser.rb#200 + def source_map_comments(source_map_options); end + + # source://terser//lib/terser.rb#424 + def source_map_options(input_map, source_map_options); end + + # source://terser//lib/terser.rb#209 + def source_with(path); end + + class << self + # Minifies JavaScript code using implicit context. + # + # @param source [IO, String] valid JS source code. + # @param options [Hash] optional overrides to +Terser::DEFAULTS+ + # @return [String] minified code. + # + # source://terser//lib/terser.rb#135 + def compile(source, options = T.unsafe(nil)); end + + # Minifies JavaScript code and generates a source map using implicit context. + # + # @param source [IO, String] valid JS source code. + # @param options [Hash] optional overrides to +Terser::DEFAULTS+ + # @return [Array(String, String)] minified code and source map. + # + # source://terser//lib/terser.rb#144 + def compile_with_map(source, options = T.unsafe(nil)); end + end +end + +# A wrapper for Sprockets +# +# source://terser//lib/terser/compressor.rb#8 +class Terser::Compressor + # @return [Compressor] a new instance of Compressor + # + # source://terser//lib/terser/compressor.rb#11 + def initialize(options = T.unsafe(nil)); end + + # Returns the value of attribute cache_key. + # + # source://terser//lib/terser/compressor.rb#30 + def cache_key; end + + # source://terser//lib/terser/compressor.rb#44 + def call(input); end + + class << self + # source://terser//lib/terser/compressor.rb#26 + def cache_key; end + + # source://terser//lib/terser/compressor.rb#22 + def call(input); end + + # source://terser//lib/terser/compressor.rb#18 + def instance; end + end +end + +# source://terser//lib/terser/compressor.rb#9 +Terser::Compressor::VERSION = T.let(T.unsafe(nil), String) + +# Default options for compilation +# +# source://terser//lib/terser.rb#29 +Terser::DEFAULTS = T.let(T.unsafe(nil), Hash) + +# ES5 shims source path +# +# source://terser//lib/terser.rb#22 +Terser::ES5FallbackPath = T.let(T.unsafe(nil), String) + +# source://terser//lib/terser.rb#108 +Terser::EXTRA_OPTIONS = T.let(T.unsafe(nil), Array) + +# Error class for compilation errors. +# +# source://terser//lib/terser.rb#15 +class Terser::Error < ::StandardError; end + +# source://terser//lib/terser.rb#110 +Terser::MANGLE_PROPERTIES_DEFAULTS = T.let(T.unsafe(nil), Hash) + +# Railtie for Rails +# +# source://terser//lib/terser/railtie.rb#7 +class Terser::Railtie < ::Rails::Railtie; end + +# source://terser//lib/terser.rb#118 +Terser::SOURCE_MAP_DEFAULTS = T.let(T.unsafe(nil), Hash) + +# Source Map path +# +# source://terser//lib/terser.rb#20 +Terser::SourceMapPath = T.let(T.unsafe(nil), String) + +# TerserJS source path +# +# source://terser//lib/terser.rb#18 +Terser::SourcePath = T.let(T.unsafe(nil), String) + +# String.split shim source path +# +# source://terser//lib/terser.rb#24 +Terser::SplitFallbackPath = T.let(T.unsafe(nil), String) + +# TerserJS wrapper path +# +# source://terser//lib/terser.rb#26 +Terser::TerserJSWrapperPath = T.let(T.unsafe(nil), String) + +# Current version of Terser. +# +# source://terser//lib/terser/version.rb#5 +Terser::VERSION = T.let(T.unsafe(nil), String)