Skip to main content
Glama
interface-support.md942 B
## Interface Support All built-in macros work with interfaces. For interfaces, methods are generated as functions in a namespace with the same name, using `self` as the first parameter: TypeScript ``` /** @derive(Debug, Clone, PartialEq) */ interface Point {   x: number;   y: number; } // Generated namespace: // namespace Point { //   export function toString(self: Point): string { ... } //   export function clone(self: Point): Point { ... } //   export function equals(self: Point, other: Point): boolean { ... } //   export function hashCode(self: Point): number { ... } // } const point: Point = { x: 10, y: 20 }; // Use the namespace functions console.log(Point.toString(point));     // "Point { x: 10, y: 20 }" const copy = Point.clone(point);        // { x: 10, y: 20 } console.log(Point.equals(point, copy)); // true ```

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/macroforge-ts/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server