brew/Library/Homebrew/extend/hash/deep_merge.rbi

21 lines
720 B
Plaintext
Raw Normal View History

2024-01-11 19:22:16 -08:00
# typed: strict
# frozen_string_literal: true
class Hash
2024-02-18 15:47:56 -08:00
sig {
2024-01-11 19:22:16 -08:00
type_parameters(:k2).params(
other_hash: T::Hash[T.type_parameter(:k2), T.untyped],
2024-02-18 15:47:56 -08:00
block: T.nilable(T.proc.params(k: T.untyped, v1: T.untyped, v2: T.untyped).returns(T.untyped)),
2024-01-11 19:22:16 -08:00
).returns(T::Hash[T.any(Hash::K, T.type_parameter(:k2)), T.untyped])
2024-02-18 15:47:56 -08:00
}
2024-01-11 19:22:16 -08:00
def deep_merge(other_hash, &block); end
2024-02-18 15:47:56 -08:00
sig {
2024-01-11 19:22:16 -08:00
type_parameters(:k2).params(
other_hash: T::Hash[T.type_parameter(:k2), T.untyped],
2024-02-18 15:47:56 -08:00
block: T.nilable(T.proc.params(k: T.untyped, v1: T.untyped, v2: T.untyped).returns(T.untyped)),
2024-01-11 19:22:16 -08:00
).returns(T::Hash[T.any(Hash::K, T.type_parameter(:k2)), T.untyped])
2024-02-18 15:47:56 -08:00
}
2024-01-11 19:22:16 -08:00
def deep_merge!(other_hash, &block); end
end