brew/Library/Homebrew/sorbet/rbi/gems/simpleidn@0.2.1.rbi
2023-12-15 16:24:46 +00:00

197 lines
6.0 KiB
Ruby
Generated

# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `simpleidn` gem.
# Please instead update this file by running `bin/tapioca gem simpleidn`.
# IdnaMappingTable-9.0.0.txt
# Date: 2016-06-16, 13:35:01 GMT
# © 2016 Unicode®, Inc.
# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
# For terms of use, see http://www.unicode.org/terms_of_use.html
#
# Unicode IDNA Compatible Preprocessing (UTS #46)
# For documentation, see http://www.unicode.org/reports/tr46/
# Total code points: 1114112
#
# source://simpleidn//lib/simpleidn/version.rb#1
module SimpleIDN
private
# Converts a UTF-8 unicode string to a punycode ACE string.
# == Example
# SimpleIDN.to_ascii("møllerriis.com")
# => "xn--mllerriis-l8a.com"
#
# source://simpleidn//lib/simpleidn.rb#233
def to_ascii(domain, transitional = T.unsafe(nil)); end
# Converts a punycode ACE string to a UTF-8 unicode string.
# == Example
# SimpleIDN.to_unicode("xn--mllerriis-l8a.com")
# => "møllerriis.com"
#
# source://simpleidn//lib/simpleidn.rb#257
def to_unicode(domain, transitional = T.unsafe(nil)); end
# Applies UTS46 mapping to a Unicode string
# Returns a UTF-8 string in Normalization Form C (NFC)
#
# source://simpleidn//lib/simpleidn.rb#222
def uts46map(str, transitional = T.unsafe(nil)); end
class << self
# Converts a UTF-8 unicode string to a punycode ACE string.
# == Example
# SimpleIDN.to_ascii("møllerriis.com")
# => "xn--mllerriis-l8a.com"
#
# source://simpleidn//lib/simpleidn.rb#233
def to_ascii(domain, transitional = T.unsafe(nil)); end
# Converts a punycode ACE string to a UTF-8 unicode string.
# == Example
# SimpleIDN.to_unicode("xn--mllerriis-l8a.com")
# => "møllerriis.com"
#
# source://simpleidn//lib/simpleidn.rb#257
def to_unicode(domain, transitional = T.unsafe(nil)); end
# Applies UTS46 mapping to a Unicode string
# Returns a UTF-8 string in Normalization Form C (NFC)
#
# source://simpleidn//lib/simpleidn.rb#222
def uts46map(str, transitional = T.unsafe(nil)); end
end
end
# source://simpleidn//lib/simpleidn.rb#199
SimpleIDN::ACE_PREFIX = T.let(T.unsafe(nil), String)
# source://simpleidn//lib/simpleidn.rb#200
SimpleIDN::ASCII_MAX = T.let(T.unsafe(nil), Integer)
# The ConversionError is raised when an error occurs during a
# Punycode <-> Unicode conversion.
#
# source://simpleidn//lib/simpleidn.rb#8
class SimpleIDN::ConversionError < ::RangeError; end
# source://simpleidn//lib/simpleidn.rb#201
SimpleIDN::DOT = T.let(T.unsafe(nil), String)
# source://simpleidn//lib/simpleidn.rb#202
SimpleIDN::EMPTY = T.let(T.unsafe(nil), String)
# source://simpleidn//lib/simpleidn.rb#203
SimpleIDN::LABEL_SEPERATOR_RE = T.let(T.unsafe(nil), Regexp)
# source://simpleidn//lib/simpleidn.rb#11
module SimpleIDN::Punycode
private
# Bias adaptation function
#
# source://simpleidn//lib/simpleidn.rb#44
def adapt(delta, numpoints, firsttime); end
# Main decode
#
# source://simpleidn//lib/simpleidn.rb#57
def decode(input); end
# decode_digit(cp) returns the numeric value of a basic code
# point (for use in representing integers) in the range 0 to
# base-1, or base if cp is does not represent a value.
#
# source://simpleidn//lib/simpleidn.rb#30
def decode_digit(cp); end
# Main encode function
#
# source://simpleidn//lib/simpleidn.rb#129
def encode(input); end
# encode_digit(d) returns the basic code point whose value
# (when used for representing integers) is d, which needs to be in
# the range 0 to base-1.
#
# source://simpleidn//lib/simpleidn.rb#37
def encode_digit(d); end
class << self
# Bias adaptation function
#
# source://simpleidn//lib/simpleidn.rb#44
def adapt(delta, numpoints, firsttime); end
# Main decode
#
# source://simpleidn//lib/simpleidn.rb#57
def decode(input); end
# decode_digit(cp) returns the numeric value of a basic code
# point (for use in representing integers) in the range 0 to
# base-1, or base if cp is does not represent a value.
#
# source://simpleidn//lib/simpleidn.rb#30
def decode_digit(cp); end
# Main encode function
#
# source://simpleidn//lib/simpleidn.rb#129
def encode(input); end
# encode_digit(d) returns the basic code point whose value
# (when used for representing integers) is d, which needs to be in
# the range 0 to base-1.
#
# source://simpleidn//lib/simpleidn.rb#37
def encode_digit(d); end
end
end
# source://simpleidn//lib/simpleidn.rb#21
SimpleIDN::Punycode::ASCII_MAX = T.let(T.unsafe(nil), Integer)
# source://simpleidn//lib/simpleidn.rb#15
SimpleIDN::Punycode::BASE = T.let(T.unsafe(nil), Integer)
# source://simpleidn//lib/simpleidn.rb#16
SimpleIDN::Punycode::DAMP = T.let(T.unsafe(nil), Integer)
# source://simpleidn//lib/simpleidn.rb#14
SimpleIDN::Punycode::DELIMITER = T.let(T.unsafe(nil), Integer)
# source://simpleidn//lib/simpleidn.rb#23
SimpleIDN::Punycode::EMPTY = T.let(T.unsafe(nil), String)
# source://simpleidn//lib/simpleidn.rb#13
SimpleIDN::Punycode::INITIAL_BIAS = T.let(T.unsafe(nil), Integer)
# source://simpleidn//lib/simpleidn.rb#12
SimpleIDN::Punycode::INITIAL_N = T.let(T.unsafe(nil), Integer)
# source://simpleidn//lib/simpleidn.rb#20
SimpleIDN::Punycode::MAXINT = T.let(T.unsafe(nil), Integer)
# source://simpleidn//lib/simpleidn.rb#19
SimpleIDN::Punycode::SKEW = T.let(T.unsafe(nil), Integer)
# source://simpleidn//lib/simpleidn.rb#18
SimpleIDN::Punycode::TMAX = T.let(T.unsafe(nil), Integer)
# source://simpleidn//lib/simpleidn.rb#17
SimpleIDN::Punycode::TMIN = T.let(T.unsafe(nil), Integer)
# See UTS46 Table 1
#
# source://simpleidn//lib/simpleidn.rb#211
SimpleIDN::TRANSITIONAL = T.let(T.unsafe(nil), Hash)
# source://simpleidn//lib/simpleidn/uts46mapping.rb#14
SimpleIDN::UTS64MAPPING = T.let(T.unsafe(nil), Hash)
# source://simpleidn//lib/simpleidn/version.rb#2
SimpleIDN::VERSION = T.let(T.unsafe(nil), String)