UNPKG

2.25 kBTypeScriptView Raw
1export declare let controllerCommonModulesInternal: any;
2/** The collection of utility functions in JS-Controller, formerly `lib/tools.js` */
3export declare const controllerToolsInternal: any;
4/**
5 * Resolve a module that is either exported by @iobroker/js-controller-common (new controllers) or located in in the controller's `lib` directory (old controllers).
6 * @param name - The filename of the module to resolve
7 * @param exportName - The name under which the module may be exported. Defaults to `name`.
8 */
9export declare function resolveNamedModule(name: string, exportName?: string): any;
10/**
11 * Converts a pattern to match object IDs into a RegEx string that can be used in `new RegExp(...)`
12 * @param pattern The pattern to convert
13 * @returns The RegEx string
14 */
15declare function pattern2RegEx(pattern: string): string;
16/**
17 * Finds the adapter directory of a given adapter
18 *
19 * @param adapter name of the adapter, e.g. hm-rpc
20 * @returns path to adapter directory or null if no directory found
21 */
22declare function getAdapterDir(adapter: string): string | null;
23interface Multilingual {
24 en: string;
25 de?: string;
26 ru?: string;
27 pt?: string;
28 nl?: string;
29 fr?: string;
30 it?: string;
31 es?: string;
32 pl?: string;
33 uk?: string;
34 "zh-cn"?: string;
35}
36export interface GetInstalledInfoReponse {
37 controller?: boolean;
38 version?: string;
39 icon?: string;
40 title?: string;
41 titleLang?: Multilingual;
42 desc?: Multilingual;
43 platform?: string;
44 keywords?: string[];
45 readme?: string;
46 runningVersion?: string;
47 license?: string;
48 licenseUrl?: string;
49}
50/**
51 * Get list of all installed adapters and controller version on this host
52 * @param hostJsControllerVersion Version of the running js-controller, will be included in the returned information if provided
53 * @returns object containing information about installed host
54 */
55declare function getInstalledInfo(hostJsControllerVersion?: string): GetInstalledInfoReponse;
56export declare const commonTools: {
57 pattern2RegEx: typeof pattern2RegEx;
58 getAdapterDir: typeof getAdapterDir;
59 getInstalledInfo: typeof getInstalledInfo;
60 password: any;
61 letsEncrypt: any;
62 session: any;
63 zipFiles: any;
64};
65export {};