79 lines
1.8 KiB
TypeScript
79 lines
1.8 KiB
TypeScript
/**
|
|
* boardgame-core
|
|
* 基于 Preact Signals 的桌游状态管理库
|
|
*/
|
|
|
|
// Core types
|
|
export type { IGameContext } from "./core/game";
|
|
export { createPromptDef } from "./core/game";
|
|
|
|
export type { GameHost, GameHostStatus, GameModule } from "./core/game-host";
|
|
export { createGameHost } from "./core/game-host";
|
|
|
|
export type { Part } from "./core/part";
|
|
export { flip, flipTo, roll } from "./core/part";
|
|
|
|
export { createParts, createPartsFromTable } from "./core/part-factory";
|
|
|
|
export type { Region, RegionAxis } from "./core/region";
|
|
export {
|
|
createRegion,
|
|
createRegionAxis,
|
|
applyAlign,
|
|
shuffle,
|
|
moveToRegion,
|
|
} from "./core/region";
|
|
|
|
export * from "./core/game-client";
|
|
|
|
// Utils
|
|
export type {
|
|
Command,
|
|
CommandDef,
|
|
CommandResult,
|
|
CommandSchema,
|
|
CommandParamSchema,
|
|
CommandOptionSchema,
|
|
CommandFlagSchema,
|
|
} from "./utils/command";
|
|
export {
|
|
parseCommand,
|
|
parseCommandSchema,
|
|
validateCommand,
|
|
parseCommandWithSchema,
|
|
applyCommandSchema,
|
|
} from "./utils/command";
|
|
|
|
export type {
|
|
CommandRunner,
|
|
CommandRunnerHandler,
|
|
CommandRunnerContext,
|
|
PromptEvent,
|
|
CommandRunnerEvents,
|
|
} from "./utils/command";
|
|
export {
|
|
createCommandRegistry,
|
|
registerCommand,
|
|
unregisterCommand,
|
|
hasCommand,
|
|
getCommand,
|
|
runCommand,
|
|
runCommandParsed,
|
|
createCommandRunnerContext,
|
|
type CommandRegistry,
|
|
type CommandRunnerContextExport,
|
|
} from "./utils/command";
|
|
|
|
export type { MutableSignal } from "./utils/mutable-signal";
|
|
export { mutableSignal } from "./utils/mutable-signal";
|
|
|
|
export type { RNG, ReadonlyRNG } from "./utils/rng";
|
|
export { createRNG, Mulberry32RNG } from "./utils/rng";
|
|
|
|
export type { MiddlewareChain } from "./utils/middleware";
|
|
export { createMiddlewareChain } from "./utils/middleware";
|
|
|
|
export * from "./utils/spawner";
|
|
|
|
export * from "@preact/signals-core";
|