add ha addon support

This commit is contained in:
Jatus 2024-01-26 23:19:14 +01:00
parent 0425f6e8df
commit 6f9fc76988
35 changed files with 278 additions and 207 deletions

View File

@ -0,0 +1,36 @@
{
"name": "devcontainer for add-on repositories",
"image": "ghcr.io/home-assistant/devcontainer:addons",
"appPort": [
"7123:8123",
"7357:4357"
],
"postStartCommand": "bash devcontainer_bootstrap",
"runArgs": [
"-e",
"GIT_EDITOR=code --wait",
"--privileged"
],
"containerEnv": {
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
},
"extensions": [
"timonwong.shellcheck",
"esbenp.prettier-vscode"
],
"mounts": [
"type=volume,target=/var/lib/docker"
],
"settings": {
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
}
}

20
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,20 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Home Assistant",
"type": "shell",
"command": "supervisor_run",
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
}
]
}

0
.yamlint Normal file
View File

View File

@ -8,23 +8,18 @@ This project serves as a proof of concept to connect HomeAssistant devices to Vo
### Prerequisites ### Prerequisites
- Docker installed - Add this repository to your home assistant install
- Docker Compose installed
- Clone this repository
### Configuration ### Configuration
Inside the repository, create a `.env` file with the following variables set: 1. Start this addon, should autmatically get all your devices
2. Watch the logs for the QR code that is needed to pair it with your assistant
- `HA_HOST`: HomeAssistant network address 3. Pair it with your assistant with the matter procedure
- `HA_PORT`: HomeAssistant port 4. Enjoy
- `HA_ACCESS_TOKEN`: HomeAssistant access token
Once the `.env` file is configured, run the project with `docker-compose up` for the initial setup. You'll need to scan the QR code in the terminal.
## Key Features ## Key Features
- Supports two types of elements: lights and dimmable lights. - Supports two types of elements: lights and dimmable lights.
## How to Contribute ## How to Contribute
@ -34,4 +29,4 @@ Once the `.env` file is configured, run the project with `docker-compose up` for
## Known Issues and Limitations ## Known Issues and Limitations
- Currently, only lights (including dimmable lights) are working, and the system may be unstable. - Currently, only lights (including dimmable lights) are working, and the system may be unstable.

View File

@ -1,3 +1,4 @@
node_modules node_modules
deviceData deviceData
.env .env
build

35
matter-bridge/Dockerfile Normal file
View File

@ -0,0 +1,35 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base:15.0.3
FROM node:18.19.0-alpine as buildbase
COPY ./package.json ./
COPY ./package-lock.json ./
COPY ./src ./src
COPY ./tsconfig.json ./
RUN npm install
RUN npm run build
FROM node:18.19.0-alpine as deps
COPY ./package.json ./
COPY ./package-lock.json ./
COPY ./src ./src
COPY ./tsconfig.json ./
RUN npm install --production
FROM ${BUILD_FROM} as runenv
COPY --from=buildbase /usr/lib /usr/lib
COPY --from=buildbase /usr/local/lib /usr/local/lib
COPY --from=buildbase /usr/local/include /usr/local/include
COPY --from=buildbase /usr/local/bin /usr/local/bin
COPY --from=buildbase ./build ./build
COPY --from=deps ./node_modules ./node_modules
COPY --from=deps ./package.json ./package.json
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]

17
matter-bridge/config.yml Normal file
View File

@ -0,0 +1,17 @@
---
name: 'HA Matter Bridge'
version: '1.0.0'
slug: ha-matter-bridge
description: This project serves as a proof of concept to connect HomeAssistant devices to Voice Assistants through the Matter Protocol.
init: false
arch:
- amd64
ports:
5540/tcp: 5540
hassio_role: homeassistant
hassio_api: true
homeassistant_api: true
auth_api: true
map:
- addon_config:rw

View File

@ -0,0 +1,5 @@
message: "settings"
settings:
- HA_HOST: localhost
HA_PORT: 8123
HA_ACCESS_TOKEN: "your acces token"

View File

@ -7,7 +7,7 @@
"": { "": {
"name": "ha-matter-bridge", "name": "ha-matter-bridge",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@project-chip/matter-node.js": "^0.7.4", "@project-chip/matter-node.js": "^0.7.4",
"@project-chip/matter.js-tools": "^0.7.4", "@project-chip/matter.js-tools": "^0.7.4",

View File

@ -4,10 +4,11 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "ts-node ./src/index.ts" "build": "tsc",
"start": "node ./build/index.js"
}, },
"author": "", "author": "",
"license": "ISC", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@project-chip/matter-node.js": "^0.7.4", "@project-chip/matter-node.js": "^0.7.4",
"@project-chip/matter.js-tools": "^0.7.4", "@project-chip/matter.js-tools": "^0.7.4",

3
matter-bridge/run.sh Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/with-contenv bashio
npm run start

5
matter-bridge/schema.yml Normal file
View File

@ -0,0 +1,5 @@
message: str
settings:
- HA_HOST: str
HA_PORT: int
HA_ACCESS_TOKEN: str

View File

@ -8,7 +8,6 @@ export class HAMiddleware {
private logger = new Logger('HAMiddleware'); private logger = new Logger('HAMiddleware');
private hassClient: HassApi; private hassClient: HassApi;
private static instance: HAMiddleware; private static instance: HAMiddleware;
private connectionOpen: boolean = false;
private requestFulfilled: boolean = true; private requestFulfilled: boolean = true;
private entities: { [k: string]: HassEntity } = {}; private entities: { [k: string]: HassEntity } = {};
private functionsToCallOnChange: { private functionsToCallOnChange: {
@ -36,8 +35,7 @@ export class HAMiddleware {
subscribe() { subscribe() {
this.hassClient.on('state_changed', (event) => { this.hassClient.on('state_changed', (event) => {
this.logger.debug(event); this.logger.debug(event);
const toDo = const toDo = this.functionsToCallOnChange[event.data.entity_id];
this.functionsToCallOnChange[event.data.entity_id];
if (toDo) { if (toDo) {
toDo(event.data); toDo(event.data);
} }
@ -97,12 +95,6 @@ export class HAMiddleware {
if (!HAMiddleware.instance) { if (!HAMiddleware.instance) {
const client = await hass(callerOptions); const client = await hass(callerOptions);
HAMiddleware.instance = new HAMiddleware(client); HAMiddleware.instance = new HAMiddleware(client);
let waited = 0;
const timeOut = 5000;
while (!HAMiddleware.instance.connectionOpen && waited < timeOut) {
await sleep(1000);
waited += 1000;
}
} }
return HAMiddleware.instance; return HAMiddleware.instance;
} }

View File

@ -0,0 +1,43 @@
import { getParameter } from './utils/utils';
import { Bridge, getBridge } from './matter';
import { Logger } from '@project-chip/matter-node.js/log';
import { HAMiddleware } from './home-assistant/HAmiddleware';
import { addAllDevicesToBridge } from './mapper/Mapper';
const LOGGER = new Logger('Main');
let HA_MIDDLEWARE: HAMiddleware;
let BRIDGE: Bridge;
async function run() {
LOGGER.info('Startup ...');
const token = getParameter('SUPERVISOR_TOKEN');
if (!token) {
throw new Error('Missing auth token cannot run without it');
}
HA_MIDDLEWARE = await HAMiddleware.getInstance({
host: 'supervisor',
port: 80,
path: '/core/websocket',
token,
});
LOGGER.info('Connected to home assistant');
BRIDGE = getBridge();
LOGGER.info('Creating the bridge');
await addAllDevicesToBridge(HA_MIDDLEWARE, BRIDGE);
LOGGER.info('all devices added');
BRIDGE.start();
}
run()
.then()
.catch((error) => {
console.error(error);
LOGGER.error(JSON.stringify(error));
});
process.on('SIGINT', () => {
HA_MIDDLEWARE.stop();
BRIDGE.stop()
.then(() => process.exit(0))
.catch((err) => LOGGER.error(err));
});

View File

@ -1,12 +1,15 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { addDimmerableLightDevice, addOnOffLightDevice } from './devices/lights'; import {
import { HassEntity } from '../HA/HAssTypes'; addDimmerableLightDevice,
import { Bridge, HAMiddleware } from '.'; addOnOffLightDevice,
} from './devices/lights';
import { HassEntity } from '../home-assistant/HAssTypes';
import { Bridge } from '../matter';
import { Logger } from '@project-chip/matter-node.js/log'; import { Logger } from '@project-chip/matter-node.js/log';
import { HAMiddleware } from '../home-assistant/HAmiddleware';
const LOGGER = new Logger('Mapper'); const LOGGER = new Logger('Mapper');
const lightsMap: Map< const lightsMap: Map<
string, string,
(haEntity: HassEntity, haMiddleware: HAMiddleware, bridge: Bridge) => void (haEntity: HassEntity, haMiddleware: HAMiddleware, bridge: Bridge) => void

View File

@ -0,0 +1,14 @@
import { Device } from '@project-chip/matter-node.js/device';
import { HassEntity } from '../../home-assistant/HAssTypes';
import { HAMiddleware } from '../../home-assistant/HAmiddleware';
import { Bridge } from '../../matter';
export type AddHaDeviceToBridge = (
haEntity: HassEntity,
haMiddleware: HAMiddleware,
bridge: Bridge
) => Device;
export { HAMiddleware } from '../../home-assistant/HAmiddleware';
export { Bridge } from '../../matter';

View File

@ -1,12 +1,21 @@
import { Device, DimmableLightDevice } from "@project-chip/matter-node.js/device"; import {
import { MD5 } from "crypto-js"; Device,
import { HAMiddleware, Bridge } from "../.."; DimmableLightDevice,
import { HassEntity, StateChangedEvent } from "../../../HA/HAssTypes"; } from '@project-chip/matter-node.js/device';
import { AddHaDeviceToBridge } from "../MapperType"; import { MD5 } from 'crypto-js';
import { Logger } from "@project-chip/matter-node.js/log"; import {
HassEntity,
StateChangedEvent,
} from '../../../home-assistant/HAssTypes';
import { AddHaDeviceToBridge, Bridge, HAMiddleware } from '../MapperType';
import { Logger } from '@project-chip/matter-node.js/log';
const LOGGER = new Logger('DimmableLight'); const LOGGER = new Logger('DimmableLight');
export const addDimmerableLightDevice: AddHaDeviceToBridge = (haEntity: HassEntity, haMiddleware: HAMiddleware, bridge: Bridge): Device => { export const addDimmerableLightDevice: AddHaDeviceToBridge = (
haEntity: HassEntity,
haMiddleware: HAMiddleware,
bridge: Bridge
): Device => {
const device = new DimmableLightDevice(); const device = new DimmableLightDevice();
const serialFromId = MD5(haEntity.entity_id).toString(); const serialFromId = MD5(haEntity.entity_id).toString();
device.addOnOffListener((value, oldValue) => { device.addOnOffListener((value, oldValue) => {
@ -36,7 +45,8 @@ export const addDimmerableLightDevice: AddHaDeviceToBridge = (haEntity: HassEnti
(event: StateChangedEvent) => { (event: StateChangedEvent) => {
device.setOnOff(event.data.new_state?.state === 'on'); device.setOnOff(event.data.new_state?.state === 'on');
device.setCurrentLevel( device.setCurrentLevel(
(event.data.new_state?.attributes as never)['brightness']); (event.data.new_state?.attributes as never)['brightness']
);
} }
); );
@ -46,4 +56,4 @@ export const addDimmerableLightDevice: AddHaDeviceToBridge = (haEntity: HassEnti
serialNumber: serialFromId, serialNumber: serialFromId,
}); });
return device; return device;
} };

View File

@ -1,13 +1,19 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { Device, OnOffLightDevice } from "@project-chip/matter-node.js/device"; import { Device, OnOffLightDevice } from '@project-chip/matter-node.js/device';
import { MD5 } from "crypto-js"; import { MD5 } from 'crypto-js';
import { HAMiddleware, Bridge } from "../.."; import {
import { HassEntity, StateChangedEvent } from "../../../HA/HAssTypes"; HassEntity,
import { AddHaDeviceToBridge } from "../MapperType"; StateChangedEvent,
import { Logger } from "@project-chip/matter-node.js/log"; } from '../../../home-assistant/HAssTypes';
import { AddHaDeviceToBridge, Bridge, HAMiddleware } from '../MapperType';
import { Logger } from '@project-chip/matter-node.js/log';
const LOGGER = new Logger('OnOfflIght'); const LOGGER = new Logger('OnOfflIght');
export const addOnOffLightDevice: AddHaDeviceToBridge = (haEntity: HassEntity, haMiddleware: HAMiddleware, bridge: Bridge): Device => { export const addOnOffLightDevice: AddHaDeviceToBridge = (
haEntity: HassEntity,
haMiddleware: HAMiddleware,
bridge: Bridge
): Device => {
const device = new OnOffLightDevice(); const device = new OnOffLightDevice();
const serialFromId = MD5(haEntity.entity_id).toString(); const serialFromId = MD5(haEntity.entity_id).toString();
device.addOnOffListener((value, oldValue) => { device.addOnOffListener((value, oldValue) => {
@ -36,4 +42,4 @@ export const addOnOffLightDevice: AddHaDeviceToBridge = (haEntity: HassEntity, h
serialNumber: serialFromId, serialNumber: serialFromId,
}); });
return device; return device;
} };

View File

@ -10,7 +10,7 @@ import {
} from '@project-chip/matter-node.js/device'; } from '@project-chip/matter-node.js/device';
import { Logger } from '@project-chip/matter-node.js/log'; import { Logger } from '@project-chip/matter-node.js/log';
import { StorageManager } from '@project-chip/matter-node.js/storage'; import { StorageManager } from '@project-chip/matter-node.js/storage';
import { getIntParameter, getParameter } from '../../utils/utils'; import { getIntParameter, getParameter } from '../utils/utils';
import { Time } from '@project-chip/matter-node.js/time'; import { Time } from '@project-chip/matter-node.js/time';
import { VendorId } from '@project-chip/matter-node.js/datatype'; import { VendorId } from '@project-chip/matter-node.js/datatype';
import { QrCode } from '@project-chip/matter-node.js/schema'; import { QrCode } from '@project-chip/matter-node.js/schema';
@ -24,14 +24,16 @@ export class Bridge {
getParameter('name') || 'Matter Bridge'; getParameter('name') || 'Matter Bridge';
private static readonly deviceType = DeviceTypes.AGGREGATOR.code; private static readonly deviceType = DeviceTypes.AGGREGATOR.code;
private static readonly vendorName = getParameter('vendor') || 'Jatus'; private static readonly vendorName = getParameter('vendor') || 'Jatus';
private static readonly productName = 'node-matter OnOff-Bridge'; private static readonly productName = 'HomeAssistant';
private static readonly port = getIntParameter('port') ?? 5540; private static readonly port = getIntParameter('port') ?? 5540;
private ready = false;
private matterServer: MatterServer; private matterServer: MatterServer;
private static instace: Bridge; private static instace: Bridge;
private logger = new Logger('bridge'); private logger = new Logger('bridge');
private storageManager: StorageManager; private storageManager: StorageManager;
private aggregator: Aggregator; private aggregator: Aggregator;
private commissioningServer: CommissioningServer | undefined;
private constructor( private constructor(
matterServer: MatterServer, matterServer: MatterServer,
@ -106,20 +108,22 @@ export class Bridge {
typeof BridgedDeviceBasicInformationCluster.attributes typeof BridgedDeviceBasicInformationCluster.attributes
> >
) { ) {
// const id = getIntParameter('uniqueid'); if (!this.commissioningServer?.isCommissioned()) {
this.logger.warn('System not initialized, may cause crashes');
}
this.aggregator.addBridgedDevice(device, bridgedBasicInformation); this.aggregator.addBridgedDevice(device, bridgedBasicInformation);
} }
async start() { async start() {
this.logger.info('Starting...'); this.logger.info('Starting...');
const commissioningServer = this.commissioningServer =
await this.setupContextAndCommissioningServer(); await this.setupContextAndCommissioningServer();
commissioningServer.addDevice(this.aggregator); this.commissioningServer.addDevice(this.aggregator);
this.matterServer.addCommissioningServer(commissioningServer); this.matterServer.addCommissioningServer(this.commissioningServer);
await this.matterServer.start(); await this.matterServer.start();
this.logger.info('Listening'); this.logger.info('Listening');
if (!commissioningServer.isCommissioned()) { if (!this.commissioningServer.isCommissioned()) {
const pairingData = commissioningServer.getPairingCode(); const pairingData = this.commissioningServer.getPairingCode();
const { qrPairingCode, manualPairingCode } = pairingData; const { qrPairingCode, manualPairingCode } = pairingData;
console.log(QrCode.get(qrPairingCode)); console.log(QrCode.get(qrPairingCode));
@ -136,5 +140,9 @@ export class Bridge {
async stop() { async stop() {
this.matterServer.close(); this.matterServer.close();
this.storageManager
.close()
.then(() => process.exit(0))
.catch((err) => this.logger.error(err));
} }
} }

View File

@ -4,6 +4,8 @@ import {
StorageManager, StorageManager,
} from '@project-chip/matter-node.js/storage'; } from '@project-chip/matter-node.js/storage';
import { getParameter, hasParameter } from '@project-chip/matter-node.js/util'; import { getParameter, hasParameter } from '@project-chip/matter-node.js/util';
export { Bridge } from './Bridge';
import { Bridge } from './Bridge';
let MATTER_SERVER: MatterServer; let MATTER_SERVER: MatterServer;
let STORAGE: StorageBackendDisk; let STORAGE: StorageBackendDisk;
@ -14,7 +16,7 @@ export function serverSetup(): {
storageManager: StorageManager; storageManager: StorageManager;
} { } {
if (!(MATTER_SERVER && STORAGE && STORAGE_MANAGER)) { if (!(MATTER_SERVER && STORAGE && STORAGE_MANAGER)) {
const storageLocation = getParameter('store') || './deviceData'; const storageLocation = getParameter('store') || '/config/deviceData';
STORAGE = new StorageBackendDisk( STORAGE = new StorageBackendDisk(
storageLocation, storageLocation,
@ -27,3 +29,12 @@ export function serverSetup(): {
} }
return { matterServer: MATTER_SERVER, storageManager: STORAGE_MANAGER }; return { matterServer: MATTER_SERVER, storageManager: STORAGE_MANAGER };
} }
export function getBridge(): Bridge {
const serverData = serverSetup();
const bridge = Bridge.getInstance(
serverData.matterServer,
serverData.storageManager
);
return bridge;
}

View File

@ -2,6 +2,7 @@ import { ValidationError } from '@project-chip/matter.js/common';
import { execSync } from 'child_process'; import { execSync } from 'child_process';
const envVar = process.env; const envVar = process.env;
console.debug({ envVar });
export function getParameter(name: string) { export function getParameter(name: string) {
return envVar[name]; return envVar[name];

View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"module": "Node16" /* Specify what module code is generated. */,
"rootDir": "./src",
"outDir": "./build", /* Specify the root folder within your source files. */
"moduleResolution": "node16" /* Specify how TypeScript looks up a file from a given module specifier. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
"strict": true /* Enable all strict type-checking options. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
},
}

1
repository.yml Normal file
View File

@ -0,0 +1 @@
name: ha-matter-bridge

View File

@ -1,37 +0,0 @@
import { Bridge, HAMiddleware, addAllDevicesToBridge } from './matter';
import { serverSetup } from './matter/server';
import { Logger } from '@project-chip/matter-node.js/log';
let LOGGER = new Logger('Main');
let BRIDGE: Bridge;
let HA_MIDDLEWARE: HAMiddleware;
const SERVER_DATA = serverSetup();
async function run() {
HA_MIDDLEWARE = await HAMiddleware.getInstance({
host: process.env.HA_HOST,
port: Number(process.env.HA_PORT),
token: process.env.HA_ACCESS_TOKEN,
});
BRIDGE = Bridge.getInstance(
SERVER_DATA.matterServer,
SERVER_DATA.storageManager
);
await addAllDevicesToBridge(HA_MIDDLEWARE, BRIDGE);
BRIDGE.start();
}
run().then().catch(LOGGER.error);
process.on('SIGINT', () => {
HA_MIDDLEWARE.stop();
BRIDGE.stop()
.then(() => {
// Pragmatic way to make sure the storage is correctly closed before the process ends.
SERVER_DATA.storageManager
.close()
.then(() => process.exit(0))
.catch((err) => LOGGER.error(err));
})
.catch((err) => LOGGER.error(err));
});

View File

@ -1,7 +0,0 @@
import { Device } from "@project-chip/matter-node.js/device";
import { HAMiddleware, Bridge } from "..";
import { HassEntity } from "../../HA/HAssTypes";
export type AddHaDeviceToBridge = (haEntity: HassEntity,
haMiddleware: HAMiddleware,
bridge: Bridge) => Device

View File

@ -1,3 +0,0 @@
export * from './server/Bridge';
export * from '../HA/HAmiddleware';
export * from './Mapper';

View File

@ -1,102 +0,0 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
// "module": "commonjs", /* Specify what module code is generated. */
"module": "Node16" /* Specify what module code is generated. */,
// // "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node16" /* Specify how TypeScript looks up a file from a given module specifier. */,
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
// "resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
},
}