Skip to content

Latest commit

 

History

History
69 lines (46 loc) · 1.93 KB

File metadata and controls

69 lines (46 loc) · 1.93 KB

FlashForge TypeScript API Documentation

This documentation covers the TypeScript surface for @ghosttypes/ff-api.

Before You Start

This repository and flashforge-python-api share the same protocol/domain baseline, but they do not promise strict 1:1 public API parity. The TypeScript library uses its own idiomatic public surface.

Read parity.md first if you are comparing both libraries or maintaining downstream integrations across both languages.

Table of Contents

  1. Getting Started
  2. Architecture Overview
  3. Client Documentation
  4. Models & Interfaces
  5. Modules & Namespaces
  6. Protocols
  7. Error Handling
  8. Advanced Topics
  9. Discovery Migration

Getting Started

Installation

npm install @ghosttypes/ff-api

Discovery

import { PrinterDiscovery } from '@ghosttypes/ff-api';

const discovery = new PrinterDiscovery();
const printers = await discovery.discover();

Connecting to a Modern Printer

import { FiveMClient } from '@ghosttypes/ff-api';

const client = new FiveMClient('192.168.1.100', 'SERIAL123', 'CHECKCODE123');

if (await client.initialize()) {
  await client.initControl();
}

Connecting to a Legacy TCP Printer

import { FlashForgeClient } from '@ghosttypes/ff-api';

const client = new FlashForgeClient('192.168.1.100');
await client.initControl();

Architecture Overview

The library is built around three main ideas:

  • FiveMClient for modern HTTP-capable printers such as Adventurer 5M, 5M Pro, and AD5X
  • FlashForgeClient / FlashForgeTcpClient for legacy TCP and low-level G-code operations
  • PrinterDiscovery for typed UDP discovery across modern and legacy models

For method-level documentation, continue to clients.md and modules.md.