browser-use-typescript
Version:
A TypeScript-based browser automation framework
50 lines (49 loc) • 1.47 kB
TypeScript
/**
* TypeScript interfaces and classes converted from Python
*/
import { z } from "zod";
export type Callable = (...args: any[]) => any;
/**
* Model for a registered action
*/
export declare class RegisteredAction {
name: string;
description: string;
function: Callable;
paramModel: z.ZodObject<any>;
constructor(name: string, description: string, func: Callable, paramModel: z.ZodObject<any>);
/**
* Get a description of the action for the prompt
*/
promptDescription(): string;
}
export declare function createDynamicActionModel(fields: {
[key: string]: z.ZodTypeAny;
}): z.ZodObject<any>;
export declare class ActionModel {
actions?: Record<string, z.ZodObject<any>>;
params?: Record<string, any>;
descriptions?: Record<string, string>;
constructor(actions?: Record<string, z.ZodObject<any>>, params?: Record<string, any>, descriptions?: Record<string, string>);
getIndex(): number | string | null;
setIndex(index: number): void;
paramToJson(): Record<string, any>;
toJson(): Record<string, any>;
getActionDefs(): Record<string, any>;
}
/**
* Base model for dynamically created action models
*/
/**
* Model representing the action registry
*/
export declare class ActionRegistry {
actions: Record<string, RegisteredAction>;
/**
* Get a description of all actions for the prompt
*/
getPromptDescription(): string;
}
/**
* Result of an action execution
*/