Files
factorio-clusterio/packages/lib/index.ts
T
7122cbccf8 Add typed hook system for plugins
Replace invokeHook and the per plugin on* methods with AsyncHook
collections on the controller, host, instance, clusterioctl and web
control objects. Plugin entrypoints export a default function that
receives a load context and attaches handlers to the hooks it needs.
Class exports still load through fromContext with a deprecation
warning. The create templates and docs use the entrypoint function.

This is clusterio/clusterio#921 recreated on top of master after the
ESM migration and the PluginDeclaration permissions change.

Closes #730

Co-Authored-By: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 22:49:09 +00:00

48 lines
1.7 KiB
TypeScript

/**
* Shared library for Clusterio
* @module lib
*/
export * from "./build_mod.js";
export * from "./src/api.js";
export * from "./src/command.js";
export * from "./src/config/index.js";
export * from "./src/data/index.js";
export * from "./src/database.js";
export * from "./src/errors.js";
export * from "./src/export.js";
export * from "./src/external/index.js";
export * from "./src/factorio/index.js";
export * from "./src/file_ops.js";
export * from "./src/hash.js";
export * from "./src/helpers.js";
export * from "./src/ini.js";
export * from "./src/link/index.js";
export * from "./src/logging.js";
export * from "./src/logging_utils.js";
export * from "./src/lua_tools.js";
export * from "./src/permissions.js";
export * from "./src/plugin.js";
export * from "./src/plugin_loader.js";
export * from "./src/loadPlugin.js";
export * from "./src/prometheus.js";
export * from "./src/schema.js";
export * from "./src/shared_commands.js";
export * from "./src/stream.js";
export * from "./src/system_collectors.js";
export * from "./src/zip_ops.js";
export * from "./src/subscriptions.js";
export * from "./src/datastore.js";
export * from "./src/load_plugin_list.js";
export * from "./src/rce_ops.js";
export * from "./src/LockFile.js";
export * from "./src/AsyncHook.js";
export { default as ExponentialBackoff } from "./src/ExponentialBackoff.js";
export { default as ModStore } from "./src/ModStore.js";
export { default as RateLimiter } from "./src/RateLimiter.js";
export { default as ValueCache } from "./src/ValueCache.js";
export { default as isDeepStrictEqual } from "#is_deep_strict_equal";
import { checkSingletonImport } from "./src/check_singleton_import.js";
checkSingletonImport(import.meta.filename);