watchWildcardDirectory(directory, flags, configFileName, config) {
    return this.watchFactory.watchDirectory(
      directory,
      (fileOrDirectory) => {
        const fileOrDirectoryPath = this.toPath(fileOrDirectory);
        const fsResult = config.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
        if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) && (fsResult && fsResult.fileExists || !fsResult && this.host.fileExists(fileOrDirectoryPath))) {
          this.logger.info(`Config: ${configFileName} Detected new package.json: ${fileOrDirectory}`);
          this.onAddPackageJson(fileOrDirectoryPath);
        }
        const configuredProjectForConfig = this.findConfiguredProjectByProjectName(configFileName);
        if (isIgnoredFileFromWildCardWatching({
          watchedDirPath: directory,
          fileOrDirectory,
          fileOrDirectoryPath,
          configFileName,
          extraFileExtensions: this.hostConfiguration.extraFileExtensions,
          currentDirectory: this.currentDirectory,
          options: config.parsedCommandLine.options,
          program: (configuredProjectForConfig == null ? void 0 : configuredProjectForConfig.getCurrentProgram()) || config.parsedCommandLine.fileNames,
          useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames,
          writeLog: (s) => this.logger.info(s),
          toPath: (s) => this.toPath(s)
        }))
          return;
        if (config.reloadLevel !== 2 /* Full */)
          config.reloadLevel = 1 /* Partial */;
        config.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => {
          if (!watchWildcardDirectories)
            return;
          const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
          if (!project)
            return;
          const reloadLevel = configuredProjectForConfig === project ? 1 /* Partial */ : 0 /* None */;
          if (project.pendingReload !== void 0 && project.pendingReload > reloadLevel)
            return;
          if (this.openFiles.has(fileOrDirectoryPath)) {
            const info = Debug.checkDefined(this.getScriptInfoForPath(fileOrDirectoryPath));
            if (info.isAttached(project)) {
              const loadLevelToSet = Math.max(reloadLevel, project.openFileWatchTriggered.get(fileOrDirectoryPath) || 0 /* None */);
              project.openFileWatchTriggered.set(fileOrDirectoryPath, loadLevelToSet);
            } else {
              project.pendingReload = reloadLevel;
              this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
            }
          } else {
            project.pendingReload = reloadLevel;
            this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
          }
        });
      },
      flags,
      this.getWatchOptionsFromProjectWatchOptions(config.parsedCommandLine.watchOptions),
      WatchType.WildcardDirectory,
      configFileName
    );
  }
This is to watch whenever files are added or removed to the wildcard directories

@internal