@types/node-red__editor-api
TypeScript icon, indicating that this package has built-in type declarations

1.3.5 • Public • Published

Installation

npm install --save @types/node-red__editor-api

Summary

This package contains type definitions for @node-red/editor-api (https://github.com/node-red/node-red/tree/master/packages/node_modules/%40node-red/editor-api).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-red__editor-api.

import { Express, NextFunction, Request, Response } from "express";
import { Server as HttpsServer } from "https";

import * as runtime from "@node-red/runtime";

declare const editorAPI: editorAPI.EditorAPIModule;

export = editorAPI;

declare namespace editorAPI {
    interface Auth {
        needsPermission: (permission: string) => (req: Request, res: Response, next: NextFunction) => void;
    }
    interface EditorAPIModule {
        /**
         * Initialise the module.
         * @param  settings   The runtime settings
         * @param  _server    An instance of HTTP Server
         * @param  storage    An instance of Node-RED Storage
         * @param  runtimeAPI An instance of Node-RED Runtime
         */
        init: (
            settings: runtime.LocalSettings,
            _server: HttpsServer,
            storage: runtime.StorageModule,
            runtimeAPI: runtime.RuntimeModule,
        ) => void;

        /**
         * Start the module.
         */
        start: () => Promise<void>;

        /**
         * Stop the module.
         */
        stop: () => Promise<void>;

        auth: Auth;

        /**
         * The Express app used to serve the Node-RED Editor
         */
        readonly httpAdmin: Express;
    }
}

Additional Details

Credits

These definitions were written by Alex Kaul, and Tadeusz Wyrzykowski.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/node-red__editor-api

Weekly Downloads

5,095

Version

1.3.5

License

MIT

Unpacked Size

5.6 kB

Total Files

5

Last publish

Collaborators

  • types