public Optional<Map.Entry<Identifier, T>> getDeclaration(Identifier name) {
        for (ScopeLayer<T> layer : scope) {
            if (layer.containsType(name)) {
                return Optional.ofNullable(layer.getTypeEntry(name));
            }
        }
        return Optional.empty();
    }
Gets the first declaration in scope for the specified identifier.

@param name the identifier to retrieve a declaration for.
@return an optional of the declaration for the identifier, or empty otherwise.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/evaluation/Scope.java