npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ffxiv-overlay-api

v4.7.0

Published

Build your own modern FFXIV overlay with npm & TypeScript support.

Downloads

153

Readme

🗡 ffxiv-overlay-api 🛡

NPM License Codacy

Build your own modern FFXIV overlay with npm & TypeScript support.

This library needs to be used along with ngld/OverlayPlugin.

Table of Contents

Browsers Support

Supports major browser versions released at 2020 or ES2020.

  • Chrome: >=87
  • Firefox: >=78
  • Safari: >=14

Installation

You can install it from npm registry:

npm install ffxiv-overlay-api --save

Or import the library from CDNs:

<script src="https://cdnjs.cloudflare.com/ajax/libs/ffxiv-overlay-api/4.6.2/overlay.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/overlay.min.js"></script>
<script src="https://unpkg.com/[email protected]/lib/overlay.min.js"></script>
<script>
  const overlay = new OverlayAPI();
</script>

Usage

After installation, you can import the library:

import { OverlayAPI } from 'ffxiv-overlay-api';
const overlay = new OverlayAPI();

// use static tool functions directly
OverlayAPI.isCEFSharp();
// import tool functions
import { isCEFSharp } from 'ffxiv-overlay-api';
isCEFSharp();

Then you can add bunch of different listeners.

overlay.addListener('CombatData', (data) => {
  console.log('listener of `CombatData`', data);
});
overlay.addListener('ChangeZone', (data) => {
  console.log('listener of `ChangeZone`', data);
});

Call this function once you’re done adding all of your listeners:

overlay.startEvent();

Once this function has been called, OverlayPlugin will start sending events. Some events will be raised immediately with current state information like ChangeZone or ChangePrimaryPlayer.

After that, put the URL of your overlay into OverlayPlugin, or use the WebSocket URL when enabled. Checkout the index.html for example usage, you can download this file and load it from the OverlayPlugin. Enable WebSocked in your plugin and add ?OVERLAY_WS=ws://127.0.0.1:[port]/ws or ?HOST_PORT=ws://127.0.0.1:[port] after you overlay URL to access the WebSocket server.

Checkout Development section for more details and my new overlay Skyline Overlay for example.

API

You can find all events available in https://ngld.github.io/OverlayPlugin/devs/event_types.

addListener

addListener(event: EventType, cb: EventCallback): void;

add an event listener

removeListener

removeListener(event: EventType, cb: EventCallback): void;

remove a listener

removeAllListener

removeAllListener(event: EventType): void;

remove all listener of one event type

getAllListener

getAllListener(event: EventType): EventCallback[];

get all listeners of a event

startEvent

startEvent(): void;

start listening event

endEncounter

endEncounter(): Promise<void>;

ends current encounter and save it, not working in websocket mode

callHandler

callHandler(msg: any): Promise<any>;

This function allows you to call an overlay handler, these handlers are declared by Event Sources, either built into OverlayPlugin or loaded through addons like Cactbot.

simulateData

simulateData(data: EventData): void;

simulate triggering event once

mergeCombatant (direct export)

mergeCombatant(...args: CombatantData[]): CombatantData | null;

static function for merging combatant like pets into first player arg

class2job (direct export)

class2job(baseClass: string): string;

convert base class to job or return input base class if not found

job2class (direct export)

job2class(job: string): string;

convert job to base class or return input job if not found

isCEFSharp (direct export)

isCEFSharp(): boolean;

check if in overlay plugin emblemed cef

Development

Clone this repo, then:

npm install
npm start

You can access the test overlay at http://localhost:5000/test/, http://localhost:5000/test/?OVERLAY_WS=ws://127.0.0.1:[port]/ws or http://localhost:5000/test/?HOST_PORT=ws://127.0.0.1:[port].

Remember to run npm run build before release commit.

Contributon

Please use the .prettierrc at the root of the project along with Prettier default settings to format your code.

Annotations

Copyright © 2020-present DSRKafuU (https://dsrkafuu.net)