agentscape
Version:
Agentscape is a library for creating agent-based simulations. It provides a simple API for defining agents and their behavior, and for defining the environment in which the agents interact. Agentscape is designed to be flexible and extensible, allowing
37 lines (36 loc) • 992 B
TypeScript
/**
* This is responsible for creating the controls pane in the UI.
*/
export interface ControlVariableConfig {
label: string;
name: string;
default: LocalStoreValue;
tooltip?: string;
validation?: (value: LocalStoreValue) => {
isValid: boolean;
message: string;
};
options?: {
label: string;
value: LocalStoreValue;
}[];
}
export interface ControlVariable extends ControlVariableConfig {
type: 'number' | 'string' | 'boolean';
}
type LocalStoreValue = string | number | boolean;
export interface ControlsConstructor {
root: HTMLDivElement;
settings: ControlVariableConfig[];
id?: string;
title?: string;
}
export default class Controls {
private context;
private settings;
constructor(opts: ControlsConstructor);
getSetting(name: string): string | number | boolean;
setSetting(name: string, value: LocalStoreValue, type: ControlVariable['type']): void;
reset(): void;
}
export {};