Skip to content

Commit a825f1f

Browse files
committed
Updated to strict ttl
1 parent 0f31b18 commit a825f1f

File tree

98 files changed

+2906
-2977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2906
-2977
lines changed

.eslintrc

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
{
2-
"root": true,
3-
"parser": "@typescript-eslint/parser",
4-
"plugins": [
5-
"@typescript-eslint"
6-
],
7-
"extends": [
8-
"eslint:recommended",
9-
"plugin:@typescript-eslint/eslint-recommended",
10-
"plugin:@typescript-eslint/recommended"
11-
],
12-
"rules": {
13-
"@typescript-eslint/no-explicit-any": "off",
14-
"@typescript-eslint/explicit-module-boundary-types": "off",
15-
"@typescript-eslint/no-unused-vars": "off",
16-
"@typescript-eslint/no-empty-function": "off"
17-
}
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint"],
5+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended"],
6+
"rules": {
7+
"@typescript-eslint/no-explicit-any": "off",
8+
"@typescript-eslint/explicit-module-boundary-types": "off",
9+
"@typescript-eslint/no-unused-vars": "off",
10+
"@typescript-eslint/no-empty-function": "off",
11+
"@typescript-eslint/no-unsafe-declaration-merging": "off"
12+
}
1813
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"cSpell.words": ["Instantiator", "samm"]
3+
}

package-lock.json

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"n3": "1.17.2",
6161
"rxjs": "7.x",
6262
"tslib": "2.6.2",
63+
"typescript-mix": "^3.1.3",
6364
"util": "0.12.5"
6465
}
6566
}

src/aspect-meta-model/base.ts

Lines changed: 0 additions & 135 deletions
This file was deleted.

src/aspect-meta-model/characteristic/default-characteristic.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,28 @@
1212
*/
1313

1414
import {Type} from '../type';
15-
import {Base, BaseMetaModelElement} from '../base';
1615
import {ModelVisitor} from '../../visitor/model-visitor';
16+
import {NamedElement} from '../named-element';
17+
import {CharacteristicProps} from '../../shared/props';
1718

18-
export interface Characteristic extends BaseMetaModelElement {
19+
export interface Characteristic extends NamedElement {
1920
dataType?: Type;
21+
getDatatype(): Type;
2022
}
2123

22-
export class DefaultCharacteristic extends Base implements Characteristic {
23-
constructor(metaModelVersion: string, aspectModelUrn: string, name: string, private _dataType?: Type) {
24-
super(metaModelVersion, aspectModelUrn, name);
25-
}
24+
export class DefaultCharacteristic extends NamedElement implements Characteristic {
25+
dataType?: Type;
2626

27-
public set dataType(value: Type | undefined) {
28-
this._dataType = value;
27+
constructor(props: CharacteristicProps) {
28+
super(props);
29+
this.dataType = props.dataType;
2930
}
3031

31-
public get dataType(): Type | undefined {
32-
return this._dataType;
32+
getDatatype(): Type {
33+
return this.dataType;
3334
}
3435

35-
public accept<T, U>(visitor: ModelVisitor<T, U>, context: U): T {
36+
accept<T, U>(visitor: ModelVisitor<T, U>, context: U): T {
3637
return visitor.visitCharacteristic(this, context);
3738
}
3839

src/aspect-meta-model/characteristic/default-code.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
*/
1313

1414
import {DefaultCharacteristic} from './default-characteristic';
15-
import {Type} from '../type';
15+
import {CharacteristicProps} from '../../shared/props';
1616

1717
export class DefaultCode extends DefaultCharacteristic {
18-
constructor(metaModelVersion: string, aspectModelUrn: string, name: string, dataType?: Type) {
19-
super(metaModelVersion, aspectModelUrn, name, dataType);
18+
constructor(props: CharacteristicProps) {
19+
super(props);
2020
}
2121
}

src/aspect-meta-model/characteristic/default-collection.ts

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,47 @@
1111
* SPDX-License-Identifier: MPL-2.0
1212
*/
1313

14-
import {Type} from '../type';
14+
import {CollectionProps} from '../../shared/props';
1515
import {Characteristic, DefaultCharacteristic} from './default-characteristic';
1616

17+
export enum CollectionType {
18+
COLLECTION,
19+
SET,
20+
SORTEDSET,
21+
LIST,
22+
}
23+
1724
export interface Collection extends Characteristic {
18-
isAllowDuplicates: boolean;
19-
isOrdered: boolean;
25+
allowDuplicates: boolean;
26+
ordered: boolean;
2027
elementCharacteristic?: Characteristic;
2128
}
2229

2330
export class DefaultCollection extends DefaultCharacteristic implements Collection {
24-
constructor(
25-
metaModelVersion: string,
26-
aspectModelUrn: string,
27-
name: string,
28-
private _isAllowDuplicates: boolean,
29-
private _isOrdered: boolean,
30-
private _elementCharacteristic?: Characteristic,
31-
dataType?: Type
32-
) {
33-
super(metaModelVersion, aspectModelUrn, name, dataType);
34-
}
35-
36-
public set isAllowDuplicates(value: boolean) {
37-
this._isAllowDuplicates = value;
38-
}
31+
allowDuplicates: boolean;
32+
ordered: boolean;
33+
elementCharacteristic?: Characteristic;
3934

40-
public get isAllowDuplicates(): boolean {
41-
return this._isAllowDuplicates;
35+
constructor(props: CollectionProps) {
36+
super(props);
37+
this.allowDuplicates = Boolean(props.allowDuplicates);
38+
this.ordered = Boolean(props.ordered);
39+
this.elementCharacteristic = props.elementCharacteristic;
4240
}
4341

44-
public set isOrdered(value: boolean) {
45-
this._isOrdered = value;
42+
isAllowedDuplicates(): boolean {
43+
return this.allowDuplicates;
4644
}
4745

48-
public get isOrdered(): boolean {
49-
return this._isOrdered;
46+
isOrdered(): boolean {
47+
return this.ordered;
5048
}
5149

52-
public set elementCharacteristic(value: Characteristic | undefined) {
53-
this._elementCharacteristic = value;
50+
getElementCharacteristic(): Characteristic {
51+
return this.elementCharacteristic;
5452
}
5553

56-
public get elementCharacteristic(): Characteristic | undefined {
57-
return this._elementCharacteristic;
54+
getCollectionType(): CollectionType {
55+
return CollectionType.COLLECTION;
5856
}
5957
}

src/aspect-meta-model/characteristic/default-duration.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
* SPDX-License-Identifier: MPL-2.0
1212
*/
1313

14-
import {DefaultQuantifiable} from './default-quantifiable';
15-
import {Type} from '../type';
16-
import {Unit} from '../default-unit';
14+
import {DefaultQuantifiable, Quantifiable} from './default-quantifiable';
15+
import {QuantifiableProps} from '../../shared/props';
1716

18-
export class DefaultDuration extends DefaultQuantifiable {
19-
constructor(metaModelVersion: string, aspectModelUrn: string, name: string, dataType?: Type, public unit?: Unit) {
20-
super(metaModelVersion, aspectModelUrn, name, dataType);
17+
export interface Duration extends Quantifiable {}
18+
export class DefaultDuration extends DefaultQuantifiable implements Quantifiable {
19+
constructor(props: QuantifiableProps) {
20+
super(props);
2121
}
2222
}

0 commit comments

Comments
 (0)