Skip to content

Types

Reference

All supporting types, interfaces, and type aliases used throughout the Automation API.

File Types

FileInfo

Basic file or directory information returned by list().

FileInfo
interface FileInfo {
  name: string;         // File or directory name
  path: string;         // Full absolute path
  isDirectory: boolean; // true if directory
  isFile: boolean;      // true if file
  size: number;         // Size in bytes (0 for directories)
  lastModified: number; // Last modified timestamp
}

DirectoryInfo

Detailed information about a directory.

DirectoryInfo
interface DirectoryInfo {
  exists: true;
  path: string;
  name: string;
  isDirectory: true;
  isFile: false;
  lastModified: number;
  canRead: boolean;
  canWrite: boolean;
  fileCount: number;      // Number of files
  directoryCount: number; // Number of subdirectories
  totalItems: number;     // Total items (files + directories)
}

FilePathInfo

Detailed information about a file.

FilePathInfo
interface FilePathInfo {
  exists: true;
  path: string;
  name: string;
  isDirectory: false;
  isFile: true;
  lastModified: number;
  canRead: boolean;
  canWrite: boolean;
  size: number;
}

PathNotFoundInfo

Returned when a path doesn't exist.

PathNotFoundInfo
interface PathNotFoundInfo {
  exists: false;
  error?: string; // Optional error message
}

FileHashes

Hash values for a file.

FileHashes
interface FileHashes {
  md5: string;    // MD5 hash
  sha1: string;   // SHA-1 hash
  sha256: string; // SHA-256 hash
  size: number;   // File size
}

FileHashError

Error returned when hashing fails.

FileHashError
interface FileHashError {
  error: string;
}

Info Types

AutomationInfo

Metadata about the running automation.

AutomationInfo
interface AutomationInfo {
  name: string;         // Automation name
  description: string;  // Automation description
  launchId: string;     // Unique ID for this execution
  agent?: {             // Optional agent details
    id: string;
    commitId: string;
    token: string;
    jobTaskId: string;
  };
  serverBaseUrl: string; // Server URL for API calls
  timeout?: number;    // Optional timeout in minutes, since app v2.123 (135)
}

DeviceInfo

Hardware and configuration info about the device.

DeviceInfo
interface DeviceInfo {
  id: string;            // Unique device ID
  brand: string;         // Device brand (e.g., "Samsung")
  model: string;         // Device model
  sdkVersion: number;    // Android SDK version
  processor: string;     // CPU info
  numberOfCores: number; // CPU cores
  ramMb: number;         // RAM in MB
  country: string;       // Device country
  isEmulator: boolean;   // true if emulator
  width: number;         // Screen width in pixels
  height: number;        // Screen height in pixels
}

Email Type

Email

Email message returned by readIMAPEmails().

Email
interface Email {
  id: string;               // Unique email ID
  subject: string;          // Email subject
  from: string;             // Sender email address
  fromName: string;         // Sender display name
  to: string[];             // Recipients
  cc: string[];             // CC recipients
  bcc: string[];            // BCC recipients
  date: number;             // Timestamp (Unix ms)
  body: string;             // Email body content
  isHtml: boolean;          // true if body is HTML
  isRead: boolean;          // Read status
  hasAttachments: boolean;  // Has attachments
  attachmentNames: string[]; // Attachment file names
}

OCR Types

Hierarchical types returned by agent.actions.recognizeText(). The structure follows: TextJSON → TextBlockJSON → LineJSON → ElementJSON → SymbolJSON.

TextJSON

Root OCR result containing all recognized text.

TextJSON
interface TextJSON {
  text: string;              // Complete recognized text
  textBlocks: TextBlockJSON[]; // Array of text blocks
}

TextBlockJSON

A block of text (paragraph or distinct region).

TextBlockJSON
interface TextBlockJSON {
  text: string;            // Text content of the block
  recognizedLanguage: string; // Detected language
  boundingBox?: RectJSON;  // Bounding box on screen
  lines: LineJSON[];       // Lines within the block
}

LineJSON

A single line of text.

LineJSON
interface LineJSON {
  text: string;            // Text content of the line
  angle: number;           // Rotation angle
  confidence: number;      // Recognition confidence (0-1)
  recognizedLanguage: string; // Detected language
  boundingBox?: RectJSON;  // Bounding box on screen
  elements: ElementJSON[]; // Words/elements in the line
}

ElementJSON

A word or element within a line.

ElementJSON
interface ElementJSON {
  text: string;            // Text content (usually a word)
  angle: number;           // Rotation angle
  confidence: number;      // Recognition confidence (0-1)
  recognizedLanguage: string; // Detected language
  boundingBox?: RectJSON;  // Bounding box on screen
  symbols: SymbolJSON[];   // Individual characters
}

SymbolJSON

A single character.

SymbolJSON
interface SymbolJSON {
  text: string;            // Single character
  angle: number;           // Rotation angle
  confidence: number;      // Recognition confidence (0-1)
  recognizedLanguage: string; // Detected language
  boundingBox?: RectJSON;  // Bounding box on screen
}

RectJSON

Bounding box coordinates.

RectJSON
interface RectJSON {
  left: number;   // Left edge
  top: number;    // Top edge
  right: number;  // Right edge
  bottom: number; // Bottom edge
}

Callback Types

NotificationCallback

Callback for receiving system notifications.

NotificationCallback
type NotificationCallback = (
  id: string,         // Notification ID
  packageName: string, // Source app package
  channelId: string,  // Notification channel
  extras: any         // Notification data (title, text, etc.)
) => void;

NetworkCallback

Callback for network state changes.

NetworkCallback
type NetworkCallback = (
  networkAvailable: boolean // true if network is available
) => void;

ToastCallback

Callback for receiving toast messages.

ToastCallback
type ToastCallback = (
  packageName: string,        // Source app package
  data: { message: string }   // Toast message
) => void;

Other Types

MultiTapSequenceItem

Item in a multi-tap sequence for agent.actions.multiTap().

MultiTapSequenceItem
interface MultiTapSequenceItem {
  x: number;    // X coordinate to tap
  y: number;    // Y coordinate to tap
  delay: number; // Delay in ms after this tap
}