Skip to content

typescript support #49

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;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions