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: type_checker.rs
    path of file: ./repos/stc/crates/stc_ts_lang_server/src
    
    the code of the file until where you have to start completion: use std::{
    fmt::Debug,
    mem::take,
    sync::{Arc, Mutex},
};

use stc_ts_type_checker::Checker;
use stc_ts_types::Type;
use swc_common::{
    errors::{Diagnostic, Emitter, Handler},
    GLOBALS,
};

use crate::{
    config::{tsconfig_for, ParsedTsConfig},
    ir::SourceFile,
    module_loader::get_module_loader,
    Db,
};

#[salsa::tracked]
pub(crate) struct TypeCheckInput {
    pub file: SourceFile,
    pub config: ParsedTsConfig,
}

#[salsa::accumulator]
pub struct Diagnostics(Diagnostic);

#[salsa::tracked]
pub(crate) struct ModuleTypeData {
    #[no_eq]
    pub data: Type,
}

#[salsa::tracked]
pub(crate) fn prepare_input(db: &dyn Db, filename: SourceFile) -> TypeCheckInput {
    let config = t
    
pub(crate) fn check_type(db: &dyn Db, input: TypeCheckInput) -> ModuleTypeData {
    let emitter = EmitterImpl::default();
    let errors = emitter.0.clone();

    let shared = db.shared();
    let cm = shared.cm.clone();

    let handler = Handler::with_emitter(true, false, Box::new(emitter));
    let handler = Arc::new(handler);

    let config = input.config(db);
    let project = get_module_loader(db, config);
    let env = project.env(db).0;

    GLOBALS.set(&shared.globals, || {
        let mut checker = Checker::new(cm, handler.clone(), env, None, Box::new(project.loader(db).0.clone()));

        let module_id = checker.check(input.file(db).filename(db));

        for err in checker.take_errors() {
            err.emit(&handler);
        }

        let errors = take(&mut *errors.lock().unwrap());
        for err in errors {
            Diagnostics::push(db, err);
        }

        let data = checker.get_types(module_id);

        let ty = data.expect("failed to get type data for the module");

        ModuleTypeData::new(db, ty)
    })
}