diff --git a/TiaCodegen-ts/package.json b/TiaCodegen-ts/package.json index 8d49c6e..fd93bff 100644 --- a/TiaCodegen-ts/package.json +++ b/TiaCodegen-ts/package.json @@ -2,11 +2,18 @@ "name": "tia-codegen-ts", "version": "1.0.0", "description": "TypeScript port of TiaCodeGen C# library", + "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + } + }, "scripts": { "build": "tsc", - "test": "jest --testPathPattern=tests", + "test": "node --experimental-vm-modules node_modules/jest-cli/bin/jest.js --testPathPattern=tests", "typecheck": "tsc --noEmit" }, "devDependencies": { @@ -17,8 +24,14 @@ "typescript": "^5.4.5" }, "jest": { - "preset": "ts-jest", + "preset": "ts-jest/presets/default-esm", "testEnvironment": "node", - "testMatch": ["**/tests/**/*.test.ts"] + "testMatch": ["**/tests/**/*.test.ts"], + "moduleNameMapper": { + "^(\\.{1,2}/.*)\\.js$": "$1" + }, + "transform": { + "^.+\\.tsx?$": ["ts-jest", {"useESM": true}] + } } } diff --git a/TiaCodegen-ts/src/Blocks/Block.ts b/TiaCodegen-ts/src/Blocks/Block.ts index 6ffc3a5..0bc761a 100644 --- a/TiaCodegen-ts/src/Blocks/Block.ts +++ b/TiaCodegen-ts/src/Blocks/Block.ts @@ -1,5 +1,5 @@ -import { CodeBlock } from './CodeBlock'; -import { KopCodeHelper } from '../CodeGen/KopCodeHelper'; +import { CodeBlock } from './CodeBlock.js'; +import { KopCodeHelper } from '../CodeGen/KopCodeHelper.js'; export class Block { name: string; diff --git a/TiaCodegen-ts/src/Blocks/CodeBlock.ts b/TiaCodegen-ts/src/Blocks/CodeBlock.ts index 8a1c1ea..f0995fb 100644 --- a/TiaCodegen-ts/src/Blocks/CodeBlock.ts +++ b/TiaCodegen-ts/src/Blocks/CodeBlock.ts @@ -1,4 +1,4 @@ -import { BaseOperationOrSignal } from '../Commands/BaseOperationOrSignal'; +import { BaseOperationOrSignal } from '../Commands/BaseOperationOrSignal.js'; export class CodeBlock extends BaseOperationOrSignal { name: string; diff --git a/TiaCodegen-ts/src/Blocks/Network.ts b/TiaCodegen-ts/src/Blocks/Network.ts index f5f91b2..ea4f1c8 100644 --- a/TiaCodegen-ts/src/Blocks/Network.ts +++ b/TiaCodegen-ts/src/Blocks/Network.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { BaseOperationOrSignal } from '../Commands/BaseOperationOrSignal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { BaseOperationOrSignal } from '../Commands/BaseOperationOrSignal.js'; export class Network extends BaseOperationOrSignal { networkTitle: string | undefined; diff --git a/TiaCodegen-ts/src/CodeGen/KopCodeHelper.ts b/TiaCodegen-ts/src/CodeGen/KopCodeHelper.ts index 118f9d4..67f9fd8 100644 --- a/TiaCodegen-ts/src/CodeGen/KopCodeHelper.ts +++ b/TiaCodegen-ts/src/CodeGen/KopCodeHelper.ts @@ -1,39 +1,39 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { ICoil } from '../Interfaces/ICoil'; -import { IFunctionOperation } from '../Interfaces/IFunctionOperation'; -import { IPartName } from '../Interfaces/IPartName'; -import { StringBuilder } from '../utils/StringBuilder'; -import { flatten } from '../Internal/IEnumerableExtensions'; -import { NaturalComparer } from '../Extensions/NaturalComparer'; -import { CodeBlock } from '../Blocks/CodeBlock'; -import { Network } from '../Blocks/Network'; -import { And } from '../Commands/And'; -import { Or } from '../Commands/Or'; -import { Not } from '../Commands/Not'; -import { Distributor } from '../Commands/Distributor'; -import { Move } from '../Commands/Move'; -import { Convert } from '../Commands/Convert'; -import { S_Move } from '../Commands/S_Move'; -import { Signal } from '../Commands/Signals/Signal'; -import { BaseCoil } from '../Commands/Coils/BaseCoil'; -import { BaseNPCoil } from '../Commands/Coils/BaseNPCoil'; -import { Coil } from '../Commands/Coils/Coil'; -import { SCoil } from '../Commands/Coils/SCoil'; -import { RCoil } from '../Commands/Coils/RCoil'; -import { BaseOperationOrSignal } from '../Commands/BaseOperationOrSignal'; -import { CompareOperator } from '../Commands/Comparisons/CompareOperator'; -import { InRangeCall } from '../Commands/Comparisons/InRangeCall'; -import { OutRangeCall } from '../Commands/Comparisons/OutRangeCall'; -import { FunctionCall } from '../Commands/Functions/Base/FunctionCall'; -import { FunctionBlockCall } from '../Commands/Functions/Base/FunctionBlockCall'; -import { SystemFunctionCall } from '../Commands/Functions/Base/SystemFunctionCall'; -import { SystemFunctionBlockCall } from '../Commands/Functions/Base/SystemFunctionBlockCall'; -import { ArithmeticCall } from '../Commands/Functions/Arithmetic/ArithmeticCall'; -import { VariableArithmeticCall } from '../Commands/Functions/Arithmetic/VariableArithmeticCall'; -import { AckGlCall } from '../Commands/Functions/AckGlCall'; -import { CTUCall } from '../Commands/Functions/CTUCall'; -import { CTUDCall } from '../Commands/Functions/CTUDCall'; -import { tryGetParent } from '../Extensions/OperationOrSignalExtensions'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { ICoil } from '../Interfaces/ICoil.js'; +import { IFunctionOperation } from '../Interfaces/IFunctionOperation.js'; +import { IPartName } from '../Interfaces/IPartName.js'; +import { StringBuilder } from '../utils/StringBuilder.js'; +import { flatten } from '../Internal/IEnumerableExtensions.js'; +import { NaturalComparer } from '../Extensions/NaturalComparer.js'; +import { CodeBlock } from '../Blocks/CodeBlock.js'; +import { Network } from '../Blocks/Network.js'; +import { And } from '../Commands/And.js'; +import { Or } from '../Commands/Or.js'; +import { Not } from '../Commands/Not.js'; +import { Distributor } from '../Commands/Distributor.js'; +import { Move } from '../Commands/Move.js'; +import { Convert } from '../Commands/Convert.js'; +import { S_Move } from '../Commands/S_Move.js'; +import { Signal } from '../Commands/Signals/Signal.js'; +import { BaseCoil } from '../Commands/Coils/BaseCoil.js'; +import { BaseNPCoil } from '../Commands/Coils/BaseNPCoil.js'; +import { Coil } from '../Commands/Coils/Coil.js'; +import { SCoil } from '../Commands/Coils/SCoil.js'; +import { RCoil } from '../Commands/Coils/RCoil.js'; +import { BaseOperationOrSignal } from '../Commands/BaseOperationOrSignal.js'; +import { CompareOperator } from '../Commands/Comparisons/CompareOperator.js'; +import { InRangeCall } from '../Commands/Comparisons/InRangeCall.js'; +import { OutRangeCall } from '../Commands/Comparisons/OutRangeCall.js'; +import { FunctionCall } from '../Commands/Functions/Base/FunctionCall.js'; +import { FunctionBlockCall } from '../Commands/Functions/Base/FunctionBlockCall.js'; +import { SystemFunctionCall } from '../Commands/Functions/Base/SystemFunctionCall.js'; +import { SystemFunctionBlockCall } from '../Commands/Functions/Base/SystemFunctionBlockCall.js'; +import { ArithmeticCall } from '../Commands/Functions/Arithmetic/ArithmeticCall.js'; +import { VariableArithmeticCall } from '../Commands/Functions/Arithmetic/VariableArithmeticCall.js'; +import { AckGlCall } from '../Commands/Functions/AckGlCall.js'; +import { CTUCall } from '../Commands/Functions/CTUCall.js'; +import { CTUDCall } from '../Commands/Functions/CTUDCall.js'; +import { tryGetParent } from '../Extensions/OperationOrSignalExtensions.js'; export class KopCodeHelper { static flattenOrdered(e: T[], f: (t: T) => T[]): T[] { diff --git a/TiaCodegen-ts/src/Commands/And.ts b/TiaCodegen-ts/src/Commands/And.ts index 4948c91..bbc412d 100644 --- a/TiaCodegen-ts/src/Commands/And.ts +++ b/TiaCodegen-ts/src/Commands/And.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { BaseOperationOrSignal } from './BaseOperationOrSignal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { BaseOperationOrSignal } from './BaseOperationOrSignal.js'; export class And extends BaseOperationOrSignal { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/BaseOperationOrSignal.ts b/TiaCodegen-ts/src/Commands/BaseOperationOrSignal.ts index 057d33e..11b776f 100644 --- a/TiaCodegen-ts/src/Commands/BaseOperationOrSignal.ts +++ b/TiaCodegen-ts/src/Commands/BaseOperationOrSignal.ts @@ -1,4 +1,4 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; export abstract class BaseOperationOrSignal implements IOperationOrSignal { debugInfo: string | null = null; @@ -23,9 +23,10 @@ export abstract class BaseOperationOrSignal implements IOperationOrSignal { createContactAndFillCardinality(parent: IOperationOrSignal): number { this.cardinality = 1; - if (this.children.length > 0 && this.children[this.children.length - 1] instanceof Or) { - this.cardinality = this.children[this.children.length - 1].createContactAndFillCardinality(parent); - this.children[this.children.length - 1].doNotCreateContact = true; + const lastChild = this.children[this.children.length - 1]; + if (this.children.length > 0 && lastChild.constructor.name === 'Or') { + this.cardinality = lastChild.createContactAndFillCardinality(parent); + lastChild.doNotCreateContact = true; } return this.cardinality; } @@ -35,14 +36,15 @@ export abstract class BaseOperationOrSignal implements IOperationOrSignal { } toString(): string { - if (this instanceof And || this instanceof Or) { - return `${this.constructor.name} (${this.children.map(x => x.toString()).join(',')})`; + const name = this.constructor.name; + if (name === 'And' || name === 'Or') { + return `${name} (${this.children.map(x => x.toString()).join(',')})`; } - return this.constructor.name; + return name; } getFirstChildNotAnd(): IOperationOrSignal { - if (this instanceof And) { + if (this.constructor.name === 'And') { const ch1 = this.children[0]; if (ch1 instanceof BaseOperationOrSignal) { return ch1.getFirstChildNotAnd(); @@ -63,7 +65,3 @@ export abstract class BaseOperationOrSignal implements IOperationOrSignal { return inst; } } - -// Forward declarations to avoid circular imports - these are resolved at runtime -import { And } from './And'; -import { Or } from './Or'; diff --git a/TiaCodegen-ts/src/Commands/Coils/BaseCoil.ts b/TiaCodegen-ts/src/Commands/Coils/BaseCoil.ts index 8fc7b30..2a6e13a 100644 --- a/TiaCodegen-ts/src/Commands/Coils/BaseCoil.ts +++ b/TiaCodegen-ts/src/Commands/Coils/BaseCoil.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { ICoil } from '../../Interfaces/ICoil'; -import { Signal } from '../Signals/Signal'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { ICoil } from '../../Interfaces/ICoil.js'; +import { Signal } from '../Signals/Signal.js'; export class BaseCoil implements IOperationOrSignal, ICoil { debugInfo: string | null = null; diff --git a/TiaCodegen-ts/src/Commands/Coils/BaseNPCoil.ts b/TiaCodegen-ts/src/Commands/Coils/BaseNPCoil.ts index 907c454..d9c09fb 100644 --- a/TiaCodegen-ts/src/Commands/Coils/BaseNPCoil.ts +++ b/TiaCodegen-ts/src/Commands/Coils/BaseNPCoil.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { Signal } from '../Signals/Signal'; -import { BaseCoil } from './BaseCoil'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { Signal } from '../Signals/Signal.js'; +import { BaseCoil } from './BaseCoil.js'; export class BaseNPCoil extends BaseCoil { helpSignal: Signal | null; diff --git a/TiaCodegen-ts/src/Commands/Coils/Coil.ts b/TiaCodegen-ts/src/Commands/Coils/Coil.ts index b5b862d..8190377 100644 --- a/TiaCodegen-ts/src/Commands/Coils/Coil.ts +++ b/TiaCodegen-ts/src/Commands/Coils/Coil.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { Signal } from '../Signals/Signal'; -import { BaseCoil } from './BaseCoil'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { Signal } from '../Signals/Signal.js'; +import { BaseCoil } from './BaseCoil.js'; export class Coil extends BaseCoil { constructor(signal: Signal, op: IOperationOrSignal | null = null) { diff --git a/TiaCodegen-ts/src/Commands/Coils/PCoil.ts b/TiaCodegen-ts/src/Commands/Coils/PCoil.ts index bcee6b4..4c1744b 100644 --- a/TiaCodegen-ts/src/Commands/Coils/PCoil.ts +++ b/TiaCodegen-ts/src/Commands/Coils/PCoil.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { Signal } from '../Signals/Signal'; -import { BaseNPCoil } from './BaseNPCoil'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { Signal } from '../Signals/Signal.js'; +import { BaseNPCoil } from './BaseNPCoil.js'; export class PCoil extends BaseNPCoil { constructor(signal: Signal, helpSignal: Signal, op: IOperationOrSignal | null = null) { diff --git a/TiaCodegen-ts/src/Commands/Coils/RCoil.ts b/TiaCodegen-ts/src/Commands/Coils/RCoil.ts index 0329e1b..8c29bf9 100644 --- a/TiaCodegen-ts/src/Commands/Coils/RCoil.ts +++ b/TiaCodegen-ts/src/Commands/Coils/RCoil.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { Signal } from '../Signals/Signal'; -import { BaseCoil } from './BaseCoil'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { Signal } from '../Signals/Signal.js'; +import { BaseCoil } from './BaseCoil.js'; export class RCoil extends BaseCoil { constructor(signal: Signal, op: IOperationOrSignal | null = null) { diff --git a/TiaCodegen-ts/src/Commands/Coils/SCoil.ts b/TiaCodegen-ts/src/Commands/Coils/SCoil.ts index bba4ee5..5569f14 100644 --- a/TiaCodegen-ts/src/Commands/Coils/SCoil.ts +++ b/TiaCodegen-ts/src/Commands/Coils/SCoil.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { Signal } from '../Signals/Signal'; -import { BaseCoil } from './BaseCoil'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { Signal } from '../Signals/Signal.js'; +import { BaseCoil } from './BaseCoil.js'; export class SCoil extends BaseCoil { constructor(signal: Signal, op: IOperationOrSignal | null = null) { diff --git a/TiaCodegen-ts/src/Commands/Comparisons/CompareOperator.ts b/TiaCodegen-ts/src/Commands/Comparisons/CompareOperator.ts index c458647..49a501a 100644 --- a/TiaCodegen-ts/src/Commands/Comparisons/CompareOperator.ts +++ b/TiaCodegen-ts/src/Commands/Comparisons/CompareOperator.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { BaseOperationOrSignal } from '../BaseOperationOrSignal'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { BaseOperationOrSignal } from '../BaseOperationOrSignal.js'; export abstract class CompareOperator extends BaseOperationOrSignal { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Comparisons/Eq.ts b/TiaCodegen-ts/src/Commands/Comparisons/Eq.ts index d6d6b20..c2c08fb 100644 --- a/TiaCodegen-ts/src/Commands/Comparisons/Eq.ts +++ b/TiaCodegen-ts/src/Commands/Comparisons/Eq.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { CompareOperator } from './CompareOperator'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { CompareOperator } from './CompareOperator.js'; export class Eq extends CompareOperator { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Comparisons/Ge.ts b/TiaCodegen-ts/src/Commands/Comparisons/Ge.ts index 584ecf1..5f03313 100644 --- a/TiaCodegen-ts/src/Commands/Comparisons/Ge.ts +++ b/TiaCodegen-ts/src/Commands/Comparisons/Ge.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { CompareOperator } from './CompareOperator'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { CompareOperator } from './CompareOperator.js'; export class Ge extends CompareOperator { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Comparisons/Gt.ts b/TiaCodegen-ts/src/Commands/Comparisons/Gt.ts index 2412406..8bc983c 100644 --- a/TiaCodegen-ts/src/Commands/Comparisons/Gt.ts +++ b/TiaCodegen-ts/src/Commands/Comparisons/Gt.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { CompareOperator } from './CompareOperator'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { CompareOperator } from './CompareOperator.js'; export class Gt extends CompareOperator { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Comparisons/InRangeCall.ts b/TiaCodegen-ts/src/Commands/Comparisons/InRangeCall.ts index bd141bc..0560c6c 100644 --- a/TiaCodegen-ts/src/Commands/Comparisons/InRangeCall.ts +++ b/TiaCodegen-ts/src/Commands/Comparisons/InRangeCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionCall } from '../Functions/Base/SystemFunctionCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionCall } from '../Functions/Base/SystemFunctionCall.js'; export class InRangeCall extends SystemFunctionCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Comparisons/Le.ts b/TiaCodegen-ts/src/Commands/Comparisons/Le.ts index 8d55b5f..ed9c420 100644 --- a/TiaCodegen-ts/src/Commands/Comparisons/Le.ts +++ b/TiaCodegen-ts/src/Commands/Comparisons/Le.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { CompareOperator } from './CompareOperator'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { CompareOperator } from './CompareOperator.js'; export class Le extends CompareOperator { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Comparisons/Lt.ts b/TiaCodegen-ts/src/Commands/Comparisons/Lt.ts index ea1db20..d06b850 100644 --- a/TiaCodegen-ts/src/Commands/Comparisons/Lt.ts +++ b/TiaCodegen-ts/src/Commands/Comparisons/Lt.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { CompareOperator } from './CompareOperator'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { CompareOperator } from './CompareOperator.js'; export class Lt extends CompareOperator { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Comparisons/Ne.ts b/TiaCodegen-ts/src/Commands/Comparisons/Ne.ts index b4403db..61b08d8 100644 --- a/TiaCodegen-ts/src/Commands/Comparisons/Ne.ts +++ b/TiaCodegen-ts/src/Commands/Comparisons/Ne.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { CompareOperator } from './CompareOperator'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { CompareOperator } from './CompareOperator.js'; export class Ne extends CompareOperator { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Comparisons/OutRangeCall.ts b/TiaCodegen-ts/src/Commands/Comparisons/OutRangeCall.ts index 5cb2dac..5320a4f 100644 --- a/TiaCodegen-ts/src/Commands/Comparisons/OutRangeCall.ts +++ b/TiaCodegen-ts/src/Commands/Comparisons/OutRangeCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionCall } from '../Functions/Base/SystemFunctionCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionCall } from '../Functions/Base/SystemFunctionCall.js'; export class OutRangeCall extends SystemFunctionCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Convert.ts b/TiaCodegen-ts/src/Commands/Convert.ts index 7e6ab78..ebbfe3c 100644 --- a/TiaCodegen-ts/src/Commands/Convert.ts +++ b/TiaCodegen-ts/src/Commands/Convert.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { IFunctionOperation } from '../Interfaces/IFunctionOperation'; -import { BaseOperationOrSignal } from './BaseOperationOrSignal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { IFunctionOperation } from '../Interfaces/IFunctionOperation.js'; +import { BaseOperationOrSignal } from './BaseOperationOrSignal.js'; export class Convert extends BaseOperationOrSignal implements IFunctionOperation { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Distributor.ts b/TiaCodegen-ts/src/Commands/Distributor.ts index 632fc13..4c30820 100644 --- a/TiaCodegen-ts/src/Commands/Distributor.ts +++ b/TiaCodegen-ts/src/Commands/Distributor.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { BaseOperationOrSignal } from './BaseOperationOrSignal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { BaseOperationOrSignal } from './BaseOperationOrSignal.js'; export class Distributor extends BaseOperationOrSignal { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Functions/AckGlCall.ts b/TiaCodegen-ts/src/Commands/Functions/AckGlCall.ts index 4a14d9a..fd6d841 100644 --- a/TiaCodegen-ts/src/Commands/Functions/AckGlCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/AckGlCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class AckGlCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/AddCall.ts b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/AddCall.ts index 466c9ff..3ffd2c0 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/AddCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/AddCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../../Enums/Direction'; -import { VariableArithmeticCall } from './VariableArithmeticCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../../Enums/Direction.js'; +import { VariableArithmeticCall } from './VariableArithmeticCall.js'; export class AddCall extends VariableArithmeticCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/ArithmeticCall.ts b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/ArithmeticCall.ts index eee7a97..91c6e9e 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/ArithmeticCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/ArithmeticCall.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { SystemFunctionCall } from '../Base/SystemFunctionCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { SystemFunctionCall } from '../Base/SystemFunctionCall.js'; export abstract class ArithmeticCall extends SystemFunctionCall { type: string = ''; diff --git a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/DivCall.ts b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/DivCall.ts index 26b9c32..7efbc76 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/DivCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/DivCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../../Enums/Direction'; -import { ArithmeticCall } from './ArithmeticCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../../Enums/Direction.js'; +import { ArithmeticCall } from './ArithmeticCall.js'; export class DivCall extends ArithmeticCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/ModCall.ts b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/ModCall.ts index 0b24db0..f291889 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/ModCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/ModCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../../Enums/Direction'; -import { ArithmeticCall } from './ArithmeticCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../../Enums/Direction.js'; +import { ArithmeticCall } from './ArithmeticCall.js'; export class ModCall extends ArithmeticCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/MulCall.ts b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/MulCall.ts index e8e681e..6708dfd 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/MulCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/MulCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../../Enums/Direction'; -import { VariableArithmeticCall } from './VariableArithmeticCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../../Enums/Direction.js'; +import { VariableArithmeticCall } from './VariableArithmeticCall.js'; export class MulCall extends VariableArithmeticCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/SubCall.ts b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/SubCall.ts index 9567653..5b99280 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/SubCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/SubCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../../Enums/Direction'; -import { ArithmeticCall } from './ArithmeticCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../../Enums/Direction.js'; +import { ArithmeticCall } from './ArithmeticCall.js'; export class SubCall extends ArithmeticCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/VariableArithmeticCall.ts b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/VariableArithmeticCall.ts index 942985c..2133fdf 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Arithmetic/VariableArithmeticCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Arithmetic/VariableArithmeticCall.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { ArithmeticCall } from './ArithmeticCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { ArithmeticCall } from './ArithmeticCall.js'; export abstract class VariableArithmeticCall extends ArithmeticCall { constructor(functionName: string, eno: IOperationOrSignal | null = null) { diff --git a/TiaCodegen-ts/src/Commands/Functions/Base/FunctionBlockCall.ts b/TiaCodegen-ts/src/Commands/Functions/Base/FunctionBlockCall.ts index 6379d32..8c20ffb 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Base/FunctionBlockCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Base/FunctionBlockCall.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { FunctionCall } from './FunctionCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { FunctionCall } from './FunctionCall.js'; export class FunctionBlockCall extends FunctionCall { instanceName: string; diff --git a/TiaCodegen-ts/src/Commands/Functions/Base/FunctionCall.ts b/TiaCodegen-ts/src/Commands/Functions/Base/FunctionCall.ts index 27f24a3..ed2904a 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Base/FunctionCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Base/FunctionCall.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../../Enums/Direction'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../../Enums/Direction.js'; export class FunctionCall implements IOperationOrSignal { safetyTemplateString: string | null = null; diff --git a/TiaCodegen-ts/src/Commands/Functions/Base/SystemFunctionBlockCall.ts b/TiaCodegen-ts/src/Commands/Functions/Base/SystemFunctionBlockCall.ts index 4fcaf2a..6a71454 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Base/SystemFunctionBlockCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Base/SystemFunctionBlockCall.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { FunctionBlockCall } from './FunctionBlockCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { FunctionBlockCall } from './FunctionBlockCall.js'; export class SystemFunctionBlockCall extends FunctionBlockCall { templateValueName: string | null = null; diff --git a/TiaCodegen-ts/src/Commands/Functions/Base/SystemFunctionCall.ts b/TiaCodegen-ts/src/Commands/Functions/Base/SystemFunctionCall.ts index 9b7fed5..0ef7899 100644 --- a/TiaCodegen-ts/src/Commands/Functions/Base/SystemFunctionCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/Base/SystemFunctionCall.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal'; -import { FunctionCall } from './FunctionCall'; +import { IOperationOrSignal } from '../../../Interfaces/IOperationOrSignal.js'; +import { FunctionCall } from './FunctionCall.js'; export class SystemFunctionCall extends FunctionCall { constructor(functionName: string, eno: IOperationOrSignal | null = null) { diff --git a/TiaCodegen-ts/src/Commands/Functions/CTUCall.ts b/TiaCodegen-ts/src/Commands/Functions/CTUCall.ts index b46853c..287151a 100644 --- a/TiaCodegen-ts/src/Commands/Functions/CTUCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/CTUCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class CTUCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/CTUDCall.ts b/TiaCodegen-ts/src/Commands/Functions/CTUDCall.ts index 47d2d95..3e4531e 100644 --- a/TiaCodegen-ts/src/Commands/Functions/CTUDCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/CTUDCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class CTUDCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/FDBACKCall.ts b/TiaCodegen-ts/src/Commands/Functions/FDBACKCall.ts index a311a50..b80e599 100644 --- a/TiaCodegen-ts/src/Commands/Functions/FDBACKCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/FDBACKCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class FDBACKCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/FTrigCall.ts b/TiaCodegen-ts/src/Commands/Functions/FTrigCall.ts index 7073a98..24ab1f2 100644 --- a/TiaCodegen-ts/src/Commands/Functions/FTrigCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/FTrigCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class FTrigCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/NTrigCall.ts b/TiaCodegen-ts/src/Commands/Functions/NTrigCall.ts index fbd4ed0..acde17b 100644 --- a/TiaCodegen-ts/src/Commands/Functions/NTrigCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/NTrigCall.ts @@ -1,6 +1,6 @@ -import { Signal } from '../Signals/Signal'; -import { IPartName } from '../../Interfaces/IPartName'; -import { BaseNPCoil } from '../Coils/BaseNPCoil'; +import { Signal } from '../Signals/Signal.js'; +import { IPartName } from '../../Interfaces/IPartName.js'; +import { BaseNPCoil } from '../Coils/BaseNPCoil.js'; export class NTrigCall extends BaseNPCoil implements IPartName { partName: string; diff --git a/TiaCodegen-ts/src/Commands/Functions/PTrigCall.ts b/TiaCodegen-ts/src/Commands/Functions/PTrigCall.ts index 22e4b89..8861f3d 100644 --- a/TiaCodegen-ts/src/Commands/Functions/PTrigCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/PTrigCall.ts @@ -1,6 +1,6 @@ -import { Signal } from '../Signals/Signal'; -import { IPartName } from '../../Interfaces/IPartName'; -import { BaseNPCoil } from '../Coils/BaseNPCoil'; +import { Signal } from '../Signals/Signal.js'; +import { IPartName } from '../../Interfaces/IPartName.js'; +import { BaseNPCoil } from '../Coils/BaseNPCoil.js'; export class PTrigCall extends BaseNPCoil implements IPartName { partName: string; diff --git a/TiaCodegen-ts/src/Commands/Functions/RTrigCall.ts b/TiaCodegen-ts/src/Commands/Functions/RTrigCall.ts index 2f9d8f7..ebfcb28 100644 --- a/TiaCodegen-ts/src/Commands/Functions/RTrigCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/RTrigCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class RTrigCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/TOFCall.ts b/TiaCodegen-ts/src/Commands/Functions/TOFCall.ts index 26ecf1e..5f079b0 100644 --- a/TiaCodegen-ts/src/Commands/Functions/TOFCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/TOFCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class TOFCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/TONCall.ts b/TiaCodegen-ts/src/Commands/Functions/TONCall.ts index 29178f6..53b1c4f 100644 --- a/TiaCodegen-ts/src/Commands/Functions/TONCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/TONCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class TONCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/TONRCall.ts b/TiaCodegen-ts/src/Commands/Functions/TONRCall.ts index d9c5a77..2a566ed 100644 --- a/TiaCodegen-ts/src/Commands/Functions/TONRCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/TONRCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class TONRCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Functions/TPCall.ts b/TiaCodegen-ts/src/Commands/Functions/TPCall.ts index 6591e3d..4302cb3 100644 --- a/TiaCodegen-ts/src/Commands/Functions/TPCall.ts +++ b/TiaCodegen-ts/src/Commands/Functions/TPCall.ts @@ -1,7 +1,7 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper'; -import { Direction } from '../../Enums/Direction'; -import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { IOperationOrSignalDirectionWrapper } from '../../Interfaces/IOperationOrSignalDirectionWrapper.js'; +import { Direction } from '../../Enums/Direction.js'; +import { SystemFunctionBlockCall } from './Base/SystemFunctionBlockCall.js'; export class TPCall extends SystemFunctionBlockCall { constructor( diff --git a/TiaCodegen-ts/src/Commands/Move.ts b/TiaCodegen-ts/src/Commands/Move.ts index 441979a..177f1ba 100644 --- a/TiaCodegen-ts/src/Commands/Move.ts +++ b/TiaCodegen-ts/src/Commands/Move.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { IFunctionOperation } from '../Interfaces/IFunctionOperation'; -import { BaseOperationOrSignal } from './BaseOperationOrSignal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { IFunctionOperation } from '../Interfaces/IFunctionOperation.js'; +import { BaseOperationOrSignal } from './BaseOperationOrSignal.js'; export class Move extends BaseOperationOrSignal implements IFunctionOperation { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/NCoil.ts b/TiaCodegen-ts/src/Commands/NCoil.ts index c557cb6..c230353 100644 --- a/TiaCodegen-ts/src/Commands/NCoil.ts +++ b/TiaCodegen-ts/src/Commands/NCoil.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { Signal } from './Signals/Signal'; -import { BaseNPCoil } from './Coils/BaseNPCoil'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { Signal } from './Signals/Signal.js'; +import { BaseNPCoil } from './Coils/BaseNPCoil.js'; export class NCoil extends BaseNPCoil { constructor(signal: Signal, helpSignal: Signal, op: IOperationOrSignal | null = null) { diff --git a/TiaCodegen-ts/src/Commands/Not.ts b/TiaCodegen-ts/src/Commands/Not.ts index f218584..d623c1a 100644 --- a/TiaCodegen-ts/src/Commands/Not.ts +++ b/TiaCodegen-ts/src/Commands/Not.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { Signal } from './Signals/Signal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { Signal } from './Signals/Signal.js'; export class Not implements IOperationOrSignal { debugInfo: string | null = null; diff --git a/TiaCodegen-ts/src/Commands/Or.ts b/TiaCodegen-ts/src/Commands/Or.ts index e6a6ad7..6d74a09 100644 --- a/TiaCodegen-ts/src/Commands/Or.ts +++ b/TiaCodegen-ts/src/Commands/Or.ts @@ -1,5 +1,5 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { BaseOperationOrSignal } from './BaseOperationOrSignal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { BaseOperationOrSignal } from './BaseOperationOrSignal.js'; export class Or extends BaseOperationOrSignal { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/S_Move.ts b/TiaCodegen-ts/src/Commands/S_Move.ts index 89d9700..875420e 100644 --- a/TiaCodegen-ts/src/Commands/S_Move.ts +++ b/TiaCodegen-ts/src/Commands/S_Move.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; -import { IFunctionOperation } from '../Interfaces/IFunctionOperation'; -import { BaseOperationOrSignal } from './BaseOperationOrSignal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; +import { IFunctionOperation } from '../Interfaces/IFunctionOperation.js'; +import { BaseOperationOrSignal } from './BaseOperationOrSignal.js'; export class S_Move extends BaseOperationOrSignal implements IFunctionOperation { constructor(...operationOrSignals: IOperationOrSignal[]) { diff --git a/TiaCodegen-ts/src/Commands/Signals/FixedSignal.ts b/TiaCodegen-ts/src/Commands/Signals/FixedSignal.ts index 02b4479..e9d68bf 100644 --- a/TiaCodegen-ts/src/Commands/Signals/FixedSignal.ts +++ b/TiaCodegen-ts/src/Commands/Signals/FixedSignal.ts @@ -1 +1 @@ -export { Signal, FixedSignal, FixedPeripherySignal } from './Signal'; +export { Signal, FixedSignal, FixedPeripherySignal } from './Signal.js'; diff --git a/TiaCodegen-ts/src/Commands/Signals/Signal.ts b/TiaCodegen-ts/src/Commands/Signals/Signal.ts index ab48da7..bfb92ea 100644 --- a/TiaCodegen-ts/src/Commands/Signals/Signal.ts +++ b/TiaCodegen-ts/src/Commands/Signals/Signal.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal'; -import { SignalType } from '../../Enums/SignalType'; -import { StringBuilder } from '../../utils/StringBuilder'; +import { IOperationOrSignal } from '../../Interfaces/IOperationOrSignal.js'; +import { SignalType } from '../../Enums/SignalType.js'; +import { StringBuilder } from '../../utils/StringBuilder.js'; export class Signal implements IOperationOrSignal { debugInfo: string | null = null; diff --git a/TiaCodegen-ts/src/Extensions/OperationOrSignalExtensions.ts b/TiaCodegen-ts/src/Extensions/OperationOrSignalExtensions.ts index 8db6bc9..667aaef 100644 --- a/TiaCodegen-ts/src/Extensions/OperationOrSignalExtensions.ts +++ b/TiaCodegen-ts/src/Extensions/OperationOrSignalExtensions.ts @@ -1,4 +1,4 @@ -import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal'; +import { IOperationOrSignal } from '../Interfaces/IOperationOrSignal.js'; export function tryGetParent( op: IOperationOrSignal, diff --git a/TiaCodegen-ts/src/Interfaces/IOperationOrSignalDirectionWrapper.ts b/TiaCodegen-ts/src/Interfaces/IOperationOrSignalDirectionWrapper.ts index 00224d2..0a2d35a 100644 --- a/TiaCodegen-ts/src/Interfaces/IOperationOrSignalDirectionWrapper.ts +++ b/TiaCodegen-ts/src/Interfaces/IOperationOrSignalDirectionWrapper.ts @@ -1,6 +1,6 @@ -import { IOperationOrSignal } from './IOperationOrSignal'; -import { Direction } from '../Enums/Direction'; -import { SignalType } from '../Enums/SignalType'; +import { IOperationOrSignal } from './IOperationOrSignal.js'; +import { Direction } from '../Enums/Direction.js'; +import { SignalType } from '../Enums/SignalType.js'; export class IOperationOrSignalDirectionWrapper { operationOrSignal: IOperationOrSignal | null; diff --git a/TiaCodegen-ts/src/index.ts b/TiaCodegen-ts/src/index.ts index 4a3ae21..bed6d2a 100644 --- a/TiaCodegen-ts/src/index.ts +++ b/TiaCodegen-ts/src/index.ts @@ -1,90 +1,90 @@ // Enums -export { Direction } from './Enums/Direction'; -export { SignalType } from './Enums/SignalType'; +export { Direction } from './Enums/Direction.js'; +export { SignalType } from './Enums/SignalType.js'; // Interfaces -export { IOperationOrSignal } from './Interfaces/IOperationOrSignal'; -export { ICoil } from './Interfaces/ICoil'; -export { IFunctionOperation } from './Interfaces/IFunctionOperation'; -export { IPartName } from './Interfaces/IPartName'; -export { IOperationOrSignalDirectionWrapper } from './Interfaces/IOperationOrSignalDirectionWrapper'; +export type { IOperationOrSignal } from './Interfaces/IOperationOrSignal.js'; +export type { ICoil } from './Interfaces/ICoil.js'; +export type { IFunctionOperation } from './Interfaces/IFunctionOperation.js'; +export type { IPartName } from './Interfaces/IPartName.js'; +export { IOperationOrSignalDirectionWrapper } from './Interfaces/IOperationOrSignalDirectionWrapper.js'; // Utils -export { StringBuilder } from './utils/StringBuilder'; +export { StringBuilder } from './utils/StringBuilder.js'; // Internal -export { flatten } from './Internal/IEnumerableExtensions'; +export { flatten } from './Internal/IEnumerableExtensions.js'; // Extensions -export { NaturalComparer } from './Extensions/NaturalComparer'; -export { tryGetParent } from './Extensions/OperationOrSignalExtensions'; +export { NaturalComparer } from './Extensions/NaturalComparer.js'; +export { tryGetParent } from './Extensions/OperationOrSignalExtensions.js'; // Commands -export { BaseOperationOrSignal } from './Commands/BaseOperationOrSignal'; -export { And } from './Commands/And'; -export { Or } from './Commands/Or'; -export { Not } from './Commands/Not'; -export { Distributor } from './Commands/Distributor'; -export { Move } from './Commands/Move'; -export { Convert } from './Commands/Convert'; -export { S_Move } from './Commands/S_Move'; -export { NCoil } from './Commands/NCoil'; +export { BaseOperationOrSignal } from './Commands/BaseOperationOrSignal.js'; +export { And } from './Commands/And.js'; +export { Or } from './Commands/Or.js'; +export { Not } from './Commands/Not.js'; +export { Distributor } from './Commands/Distributor.js'; +export { Move } from './Commands/Move.js'; +export { Convert } from './Commands/Convert.js'; +export { S_Move } from './Commands/S_Move.js'; +export { NCoil } from './Commands/NCoil.js'; // Signals -export { Signal, FixedSignal, FixedPeripherySignal } from './Commands/Signals/Signal'; +export { Signal, FixedSignal, FixedPeripherySignal } from './Commands/Signals/Signal.js'; // Coils -export { BaseCoil } from './Commands/Coils/BaseCoil'; -export { BaseNPCoil } from './Commands/Coils/BaseNPCoil'; -export { Coil } from './Commands/Coils/Coil'; -export { PCoil } from './Commands/Coils/PCoil'; -export { RCoil } from './Commands/Coils/RCoil'; -export { SCoil } from './Commands/Coils/SCoil'; +export { BaseCoil } from './Commands/Coils/BaseCoil.js'; +export { BaseNPCoil } from './Commands/Coils/BaseNPCoil.js'; +export { Coil } from './Commands/Coils/Coil.js'; +export { PCoil } from './Commands/Coils/PCoil.js'; +export { RCoil } from './Commands/Coils/RCoil.js'; +export { SCoil } from './Commands/Coils/SCoil.js'; // Comparisons -export { CompareOperator } from './Commands/Comparisons/CompareOperator'; -export { Eq } from './Commands/Comparisons/Eq'; -export { Ne } from './Commands/Comparisons/Ne'; -export { Ge } from './Commands/Comparisons/Ge'; -export { Gt } from './Commands/Comparisons/Gt'; -export { Le } from './Commands/Comparisons/Le'; -export { Lt } from './Commands/Comparisons/Lt'; -export { InRangeCall } from './Commands/Comparisons/InRangeCall'; -export { OutRangeCall } from './Commands/Comparisons/OutRangeCall'; +export { CompareOperator } from './Commands/Comparisons/CompareOperator.js'; +export { Eq } from './Commands/Comparisons/Eq.js'; +export { Ne } from './Commands/Comparisons/Ne.js'; +export { Ge } from './Commands/Comparisons/Ge.js'; +export { Gt } from './Commands/Comparisons/Gt.js'; +export { Le } from './Commands/Comparisons/Le.js'; +export { Lt } from './Commands/Comparisons/Lt.js'; +export { InRangeCall } from './Commands/Comparisons/InRangeCall.js'; +export { OutRangeCall } from './Commands/Comparisons/OutRangeCall.js'; // Function Base -export { FunctionCall } from './Commands/Functions/Base/FunctionCall'; -export { FunctionBlockCall } from './Commands/Functions/Base/FunctionBlockCall'; -export { SystemFunctionCall } from './Commands/Functions/Base/SystemFunctionCall'; -export { SystemFunctionBlockCall } from './Commands/Functions/Base/SystemFunctionBlockCall'; +export { FunctionCall } from './Commands/Functions/Base/FunctionCall.js'; +export { FunctionBlockCall } from './Commands/Functions/Base/FunctionBlockCall.js'; +export { SystemFunctionCall } from './Commands/Functions/Base/SystemFunctionCall.js'; +export { SystemFunctionBlockCall } from './Commands/Functions/Base/SystemFunctionBlockCall.js'; // Arithmetic -export { ArithmeticCall } from './Commands/Functions/Arithmetic/ArithmeticCall'; -export { VariableArithmeticCall } from './Commands/Functions/Arithmetic/VariableArithmeticCall'; -export { AddCall } from './Commands/Functions/Arithmetic/AddCall'; -export { MulCall } from './Commands/Functions/Arithmetic/MulCall'; -export { SubCall } from './Commands/Functions/Arithmetic/SubCall'; -export { DivCall } from './Commands/Functions/Arithmetic/DivCall'; -export { ModCall } from './Commands/Functions/Arithmetic/ModCall'; +export { ArithmeticCall } from './Commands/Functions/Arithmetic/ArithmeticCall.js'; +export { VariableArithmeticCall } from './Commands/Functions/Arithmetic/VariableArithmeticCall.js'; +export { AddCall } from './Commands/Functions/Arithmetic/AddCall.js'; +export { MulCall } from './Commands/Functions/Arithmetic/MulCall.js'; +export { SubCall } from './Commands/Functions/Arithmetic/SubCall.js'; +export { DivCall } from './Commands/Functions/Arithmetic/DivCall.js'; +export { ModCall } from './Commands/Functions/Arithmetic/ModCall.js'; // Functions -export { AckGlCall } from './Commands/Functions/AckGlCall'; -export { CTUCall } from './Commands/Functions/CTUCall'; -export { CTUDCall } from './Commands/Functions/CTUDCall'; -export { FDBACKCall } from './Commands/Functions/FDBACKCall'; -export { FTrigCall } from './Commands/Functions/FTrigCall'; -export { NTrigCall } from './Commands/Functions/NTrigCall'; -export { PTrigCall } from './Commands/Functions/PTrigCall'; -export { RTrigCall } from './Commands/Functions/RTrigCall'; -export { TOFCall } from './Commands/Functions/TOFCall'; -export { TONCall } from './Commands/Functions/TONCall'; -export { TONRCall } from './Commands/Functions/TONRCall'; -export { TPCall } from './Commands/Functions/TPCall'; +export { AckGlCall } from './Commands/Functions/AckGlCall.js'; +export { CTUCall } from './Commands/Functions/CTUCall.js'; +export { CTUDCall } from './Commands/Functions/CTUDCall.js'; +export { FDBACKCall } from './Commands/Functions/FDBACKCall.js'; +export { FTrigCall } from './Commands/Functions/FTrigCall.js'; +export { NTrigCall } from './Commands/Functions/NTrigCall.js'; +export { PTrigCall } from './Commands/Functions/PTrigCall.js'; +export { RTrigCall } from './Commands/Functions/RTrigCall.js'; +export { TOFCall } from './Commands/Functions/TOFCall.js'; +export { TONCall } from './Commands/Functions/TONCall.js'; +export { TONRCall } from './Commands/Functions/TONRCall.js'; +export { TPCall } from './Commands/Functions/TPCall.js'; // Blocks -export { CodeBlock } from './Blocks/CodeBlock'; -export { Network } from './Blocks/Network'; -export { Block } from './Blocks/Block'; +export { CodeBlock } from './Blocks/CodeBlock.js'; +export { Network } from './Blocks/Network.js'; +export { Block } from './Blocks/Block.js'; // CodeGen -export { KopCodeHelper } from './CodeGen/KopCodeHelper'; +export { KopCodeHelper } from './CodeGen/KopCodeHelper.js'; diff --git a/TiaCodegen-ts/tsconfig.json b/TiaCodegen-ts/tsconfig.json index 0ad54fe..0e93982 100644 --- a/TiaCodegen-ts/tsconfig.json +++ b/TiaCodegen-ts/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { "target": "ES2020", - "module": "commonjs", + "module": "NodeNext", + "moduleResolution": "NodeNext", "lib": ["ES2020"], "outDir": "./dist", "rootDir": "./src", @@ -9,6 +10,7 @@ "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, + "isolatedModules": true, "declaration": true, "declarationMap": true, "sourceMap": true