types-p42-flow

1.1.3 • Public • Published

Parallel42 Flow Typescript definitions

(Incomplete) type definitions for Parallel42s Flow. Currently implements the default functions and APIs apart from:

  • Departure/Arrival commonLegs
  • Approach icaos
  • Airport metar
  • Weather metar layers, phenomena, vis
  • A couple of params in the default APIs, such as error for the find_metar_from_coords
  • The Twitch functions and interfaces are guessed from the Flow documentation, I don't have the ability to verify these
  • Probably something else, Issues/PRs welcome

Installation

Install types-p42-flow and add it to your include in tsconfig.json.

npm install -D types-p42-flow

This would be a good starting point:

{
  "compilerOptions": {
    "target": "es2016",
    "module": "amd",
    "outFile": "./code.js",
    "removeComments": true,
    "newLine": "lf",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "noImplicitThis": false
  },
  "include": [
    "node_modules/types-p42-flow",
    "**/*.ts"
  ]
}

Using the above, compile using npx tsc to generate a code.js file.

Datastore

The variable this.store is defined as a Record<string, unknown>. If you want type support for your datastore vars, you can override this using the Store interface:

declare module global {
    interface Store {
        active: boolean,
        another_prop: boolean
    }
}
this.store = {
  active: false,
  another_prop: false
}

Sim settings

Included in the repo are Enums for the different Select-type settings values. These are essentially human readable replacements for the index parameter.

Readme

Keywords

none

Package Sidebar

Install

npm i types-p42-flow

Weekly Downloads

0

Version

1.1.3

License

MIT

Unpacked Size

35.5 kB

Total Files

5

Last publish

Collaborators

  • ranbogmord