You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: export.rs
    path of file: ./repos/stc/crates/stc_ts_file_analyzer/src/analyzer
    
    the code of the file until where you have to start completion: use rnode::{NodeId, VisitWith};
use stc_ts_ast_rnode::{
    RBindingIdent, RDecl, RDefaultDecl, RExportAll, RExportDecl, RExportDefaultDecl, RExportDefaultExpr, RExportNamedSpecifier,
    RExportSpecifier, RExpr, RIdent, RModuleExportName, RNamedExport, RPat, RStmt, RTsExportAssignment, RTsModuleName, R
    
    fn validate(&mut self, export: &RExportDecl) {
        let ctx = Ctx {
            in_export_decl: true,
            ..self.ctx
        };
        self.with_ctx(ctx).with(|a: &mut Analyzer| {
            let span = export.span;

            match &export.decl {
                RDecl::Fn(ref f) => {
                    f.visit_with(a);
                    // self.export(f.span(), f.ident.clone().into(), None);
                    a.export_var(f.span(), f.ident.clone().into(), None, f.function.body.is_some());
                }
                RDecl::TsInterface(ref i) => {
                    i.visit_with(a);
                    a.export_type(i.span(), i.id.clone().into(), None)
                }

                RDecl::Class(ref c) => {
                    c.visit_with(a);
                    a.export_type(c.span(), c.ident.clone().into(), None);
                    a.export_var(c.span(), c.ident.clone().into(), None, true);
                }
                RDecl::Var(ref var) => {
                    let span = var.span;
                    var.visit_with(a);

                    let ids: Vec<Id> = find_ids_in_pat(&var.decls);

                    for id in ids {
                        a.export_var(span, id, None, true)
                    }
                }
                RDecl::TsEnum(ref e) => {
                    let span = e.span();

                    let ty = e.validate_with(a).report(&mut a.storage).map(Type::from).map(|ty| ty.freezed());
                    let ty = ty.unwrap_or_else(|| Type::any(span, Default::default()));
                    a.register_type(e.id.clone().into(), ty);

                    a.storage
                        .export_stored_type(span, a.ctx.module_id, e.id.clone().into(), e.id.clone().into());
                    a.storage
                        .export_stored_var(span, a.ctx.module_id, e.id.clone().into(), e.id.clone().into());
                }
                RDecl::TsModule(module) => match &module.id {
                    RTsModuleName::Ident(id) => {
                        module.visit_with(a);
                        a.storage
                            .export_stored_type(span, a.ctx.module_id, id.clone().into(), id.clone().into());
                    }
                    RTsModuleName::Str(..) => {
                        let module: Option<Type> = module.validate_with(a)?;
                        let module = match module {
                            Some(v) => v,
                            None => {
                                unreachable!("global modules cannot be exported")
                            }
                        };
                        // a.storage.export_wildcard_module(s.span, s.value,
                        // module);
                        return Err(ErrorKind::ExportAmbientModule { span }.into());
                    }
                },
                RDecl::TsTypeAlias(ref decl) => {
                    decl.visit_with(a);
                    // export type Foo = 'a' | 'b';
                    // export type Foo = {};

                    // TODO(kdy1): Handle type parameters.
                    a.export_type(span, decl.id.clone().into(), None)
                }
            }

            Ok(())
        })
    }