///
import { AppBundleSource, AppSignalCb } from "@holochain/client";
import { URL } from "url";
import { AgentHappOptions, HappBundleOptions, IPlayer, IScenario } from "../../types.js";
import { TryCpConductor } from "./conductor.js";
/**
* A player tied to a {@link TryCpConductor}.
*
* @public
*/
export interface TryCpPlayer extends IPlayer {
conductor: TryCpConductor;
}
/**
* An abstraction of a test scenario to write tests against Holochain hApps,
* running on a TryCp conductor.
*
* @public
*/
export declare class TryCpScenario implements IScenario {
uid: string;
conductors: TryCpConductor[];
private serverUrl;
private server;
private constructor();
/**
* Factory method to create a new scenario.
*
* @param serverUrl - The URL of the TryCp server to connect to.
* @returns A new scenario instance.
*/
static create(serverUrl: URL): Promise;
/**
* Create and add a conductor to the scenario.
*
* @param signalHandler - A callback function to handle signals.
* @returns The newly added conductor instance.
*/
addConductor(signalHandler?: AppSignalCb): Promise;
/**
* Create and add a single player to the scenario, with a set of DNAs
* installed.
*
* @param agentHappOptions - {@link AgentHappOptions}.
* @returns A local player instance.
*/
addPlayerWithHapp(agentHappOptions: AgentHappOptions): Promise;
/**
* Create and add multiple players to the scenario, with a set of DNAs
* installed for each player.
*
* @param agentHappOptions - {@link AgentHappOptions} for each player.
* @returns An array with the added players.
*/
addPlayersWithHapps(agentHappOptions: AgentHappOptions[]): Promise;
/**
* Create and add a single player to the scenario, with a hApp bundle
* installed.
*
* @param appBundleSource - The bundle or path to the bundle.
* @param options - {@link HappBundleOptions} plus a signal handler
* (optional).
* @returns A local player instance.
*/
addPlayerWithHappBundle(appBundleSource: AppBundleSource, options?: HappBundleOptions & {
signalHandler?: AppSignalCb;
}): Promise<{
happId: string;
agentPubKey: Uint8Array;
cells: import("../../types.js").CallableCell[];
namedCells: Map;
conductor: TryCpConductor;
}>;
/**
* Create and add multiple players to the scenario, with a hApp bundle
* installed for each player.
*
* @param playersHappBundles - An array with a hApp bundle for each player,
* and a signal handler (optional).
* @returns
*/
addPlayersWithHappBundles(playersHappBundles: Array<{
appBundleSource: AppBundleSource;
options?: HappBundleOptions & {
signalHandler?: AppSignalCb;
};
}>): Promise<{
happId: string;
agentPubKey: Uint8Array;
cells: import("../../types.js").CallableCell[];
namedCells: Map;
conductor: TryCpConductor;
}[]>;
/**
* Register all agents of all passed in conductors to each other. This skips
* peer discovery through gossip and thus accelerates test runs.
*
* @public
*/
shareAllAgents(): Promise;
/**
* Shut down all conductors in the scenario.
*/
shutDown(): Promise;
/**
* Shut down and delete all conductors in the scenario, and stop the TryCP
* server.
*
* @public
*/
cleanUp(): Promise;
}