Skip to content

typescript support #49

@Sc2Marines

Description

@Sc2Marines

It could be cool to have a declaration file to have typescript support for imports.

Something like this :

// src/minecraft-protocol-forge.d.ts
declare module "minecraft-protocol-forge" {
  import { Client } from "minecraft-protocol";

  interface ForgeMod {
    modid: string;
    version: string;
  }

  interface ForgeOptions {
    forgeMods: ForgeMod[];
  }

  /**
   * Manually triggers the Forge handshake with a specific list of mods.
   */
  export function forgeHandshake(client: Client, options: ForgeOptions): void;

  /**
   * Automatically detects if the server is Forge and handles the handshake.
   * This is the recommended way for "auto-resolution".
   */
  export function autoVersionForge(client: Client): void;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions