import type { HardhatPlugin } from "../../../types/plugins.js";

import { definePlugin } from "../../../plugins.js";

import { NETWORK_GLOBAL_OPTION } from "./network-option.js";

export type * from "./type-extensions/config.js";
export type * from "./type-extensions/global-options.js";
export type * from "./type-extensions/hooks.js";
export type * from "./type-extensions/hre.js";

const hardhatPlugin: HardhatPlugin = definePlugin({
  id: "builtin:network-manager",
  hookHandlers: {
    config: () => import("./hook-handlers/config.js"),
    hre: () => import("./hook-handlers/hre.js"),
    network: () => import("./hook-handlers/network.js"),
  },
  globalOptions: [NETWORK_GLOBAL_OPTION],
  npmPackage: "hardhat",
  dependencies: () => [import("../artifacts/index.js")],
});

export default hardhatPlugin;
