Hoshimi
Advanced

Custom Structures

Override built-in structures (Player, Node, LyricsManager) safely.

Hoshimi allows replacing default classes through Structures. Use this when you need project-specific behavior without forking core internals.

Type reference: Core API (TypeDoc)

Quick links:

Structure type links:

Related registry:

Basic Override Pattern

override-structures.ts
import { ,  } from 'hoshimi';

class  extends  {
  public (): boolean {
    return this. > 120;
  }
}

. = (...) => new (...);

interface CustomizableStructures {
  : ;
}

Multiple Overrides

multi-override.ts
import { , , ,  } from 'hoshimi';

class  extends  {}
class  extends  {}
class  extends  {}

. = (...) => new (...);
. = (...) => new (...);
. = (...) => new (...);

interface CustomizableStructures {
  : ;
  : ;
  : ;
}

Custom Data Types (Module Augmentation)

custom-types.ts
import type { LyricsResult } from 'hoshimi';

declare module 'hoshimi' {
  interface CustomizablePlayerStorage {
    : boolean;
    : boolean;
    : string;
    : LyricsResult;
  }

  interface CustomizableTrack {
    : {
      : string;
      : string;
    };
  }
}

Best Practices

  • Override structures once during bootstrap.
  • Keep constructor signatures unchanged.
  • Add narrow, domain-specific methods instead of rewriting core flow.

On this page