Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tong/hxelectron

Haxe type definitions for electron
https://github.com/tong/hxelectron

electron externs haxe

Last synced: 5 days ago
JSON representation

Haxe type definitions for electron

Awesome Lists containing this project

README

        

HXElectron
==========
Haxe type definitions for [electron](https://electronjs.org/), a framework for building cross-platform desktop applications with JavaScript, HTML, and CSS.

[![test](https://github.com/tong/hxelectron/actions/workflows/test.yml/badge.svg)](https://github.com/tong/hxelectron/actions/workflows/test.yml) [![Haxelib Version](https://img.shields.io/github/tag/tong/hxelectron.svg?style=flat-square&colorA=EA8220&colorB=FBC707&label=haxelib)](http://lib.haxe.org/p/electron/)

## Install

Release version
```sh
haxelib install electron
```

Development version
```sh
haxelib git electron https://github.com/tong/hxelectron.git
```

---

## Generate Type Definitions

All type definitions are generated from [electron-api.json](electron-api.json) by [ElectronAPI.hx](ElectronAPI.hx).
To (re)generate for another electron version download the description file from https://github.com/electron/electron/releases and run:
```sh
haxe --macro ElectronAPI.generate("optional/path/to/electron-api.json")
```

Build `haxedoc.xml` to insure everything is fine:
```sh
haxe haxedoc.hxml
```

By default `hxelectron/electron-api.json` is used if you ommit the path argument to your custom description file.

---

### Metadata

The haxe externs are attributed with following metadata:
- `@:electron_platforms(["Linux"|"macOS"|"Windows"])` the supporting platforms (only if specific).

---

## Usage

### Demo Application

Clone this repository and setup:
```sh
git clone https://github.com/tong/hxelectron
cd hxelectron/
haxelib dev electron .
```

Build and Run:
```sh
cd demo/
npm install # Install electron
npm run build # Build main.js, app.js
npm start # Run application
```