Skip to main content
An ActorStub is the client handle returned by idFromName / newUniqueId. Calling a method on it is an RPC to that one actor instance.
interface ActorStub {
  readonly id: string;                       // the name passed to idFromName
  fetch(req: Request): Promise<Response>;    // HTTP-style entry (see Base Class fetch)
  // + your subclass's public methods — typed via `telnyx-edge types` or by hand, below
}
telnyx-edge types generates the narrowing for every [[actors]] binding in telnyx.toml — a telnyx-env.d.ts that types env.<BINDING> against your class’s public method shape. To hand-roll it instead (also the path for a shared-actor reference, which ships no local class for codegen to read):
import { type ActorNamespace, type ActorStub, type IdFromNameOptions } from "@telnyx/edge-runtime";

type AccountStub = ActorStub & Pick<Account, "deposit" | "debit" | "balance">;

interface AccountNamespace extends ActorNamespace {
  idFromName(name: string, options?: IdFromNameOptions): AccountStub;
}

interface Env { ACCOUNT: AccountNamespace }