@moonwall/cli
Version:
Testing framework for the Moon family of projects
40 lines (39 loc) • 1.02 kB
TypeScript
interface ShardInfo {
readonly current: number;
readonly total: number;
readonly isSharded: boolean;
}
export declare class ShardManager {
private static instance;
private _shardInfo;
private constructor();
static getInstance(): ShardManager;
/**
* Initialize shard configuration from command line argument or environment
* @param shardArg Optional shard argument from CLI (format: "current/total")
*/
initializeSharding(shardArg?: string): void;
/**
* Get current shard information
*/
getShardInfo(): ShardInfo;
/**
* Get shard index (0-based) for port calculations
*/
getShardIndex(): number;
/**
* Get total number of shards
*/
getTotalShards(): number;
/**
* Check if sharding is enabled
*/
isSharded(): boolean;
/**
* Reset shard configuration (mainly for testing)
*/
reset(): void;
private parseShardString;
}
export declare const shardManager: ShardManager;
export {};