@packtrack/layout 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.built/device/channel.d.ts +8 -0
- package/.built/device/device.d.ts +11 -0
- package/.built/district.d.ts +20 -0
- package/.built/index.d.ts +9 -0
- package/.built/layout.d.ts +29 -0
- package/.built/position.d.ts +10 -0
- package/.built/positioner/index.d.ts +2 -0
- package/.built/positioner/point.d.ts +13 -0
- package/.built/positioner/responder-type.d.ts +5 -0
- package/.built/power-district.d.ts +8 -0
- package/.built/route.d.ts +10 -0
- package/.built/router.d.ts +14 -0
- package/.built/section.d.ts +40 -0
- package/.built/tile.d.ts +57 -0
- package/.built/track.d.ts +12 -0
- package/package.json +1 -1
- package/source/index.ts +4 -0
- package/tsconfig.json +2 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Layout } from "./layout";
|
|
2
|
+
import { PowerDistrict } from "./power-district";
|
|
3
|
+
import { Router } from "./router";
|
|
4
|
+
import { Section } from "./section";
|
|
5
|
+
export declare class District {
|
|
6
|
+
name: string;
|
|
7
|
+
parent: District | Layout;
|
|
8
|
+
children: District[];
|
|
9
|
+
powerDistricts: PowerDistrict[];
|
|
10
|
+
sections: Section[];
|
|
11
|
+
routers: Router[];
|
|
12
|
+
constructor(name: string, parent: District | Layout);
|
|
13
|
+
get domainName(): string;
|
|
14
|
+
dump(): void;
|
|
15
|
+
toDotReference(): any;
|
|
16
|
+
toDotDefinition(): any;
|
|
17
|
+
toDotConnection(): any;
|
|
18
|
+
toSVG(): any;
|
|
19
|
+
findSVGPositions(): any;
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { District } from "./district";
|
|
2
|
+
import { PowerDistrict } from "./power-district";
|
|
3
|
+
import { Router } from "./router";
|
|
4
|
+
import { Section } from "./section";
|
|
5
|
+
import { Device } from "./device/device";
|
|
6
|
+
import { ResponderType } from "./positioner/responder-type";
|
|
7
|
+
import { Channel } from "./device/channel";
|
|
8
|
+
export declare class Layout {
|
|
9
|
+
name: string;
|
|
10
|
+
districts: District[];
|
|
11
|
+
devices: Device[];
|
|
12
|
+
responderType: ResponderType[];
|
|
13
|
+
get allDistricts(): District[];
|
|
14
|
+
static from(document: any): Layout;
|
|
15
|
+
loadDistrict(source: any, parent: District | Layout): District;
|
|
16
|
+
linkDistrict(source: any, district: District): void;
|
|
17
|
+
loadSection(source: any, district: District): void;
|
|
18
|
+
findDevice(identifier: string): Device;
|
|
19
|
+
findChannel(device: Device, name: string): Channel;
|
|
20
|
+
findResponderType(name: string): ResponderType;
|
|
21
|
+
linkSection(source: any, section: Section): void;
|
|
22
|
+
findSection(path: string, base: District, source?: District): any;
|
|
23
|
+
loadRouter(source: any, district: District): Router;
|
|
24
|
+
linkRouter(source: any, router: Router): void;
|
|
25
|
+
loadPowerDistrict(source: any, district: District): PowerDistrict;
|
|
26
|
+
toDot(): string;
|
|
27
|
+
toSVG(inject?: string): string;
|
|
28
|
+
dump(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Section } from './section.js';
|
|
2
|
+
export declare class SectionPosition {
|
|
3
|
+
section: Section;
|
|
4
|
+
offset: number;
|
|
5
|
+
reversed: boolean;
|
|
6
|
+
constructor(section: Section, offset: number, reversed: boolean);
|
|
7
|
+
get absolutePosition(): number;
|
|
8
|
+
advance(distance: number): any;
|
|
9
|
+
toString(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Positioner } from ".";
|
|
2
|
+
import { Channel } from "../device/channel";
|
|
3
|
+
import { Track } from "../track";
|
|
4
|
+
import { ResponderType } from "./responder-type";
|
|
5
|
+
export declare class PointPositioner extends Positioner {
|
|
6
|
+
track: Track;
|
|
7
|
+
offset: number;
|
|
8
|
+
channel: Channel;
|
|
9
|
+
responder: ResponderType;
|
|
10
|
+
constructor(track: Track, offset: number, channel: Channel, responder: ResponderType);
|
|
11
|
+
get position(): any;
|
|
12
|
+
dump(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { District } from "./district";
|
|
2
|
+
import { Route } from "./route";
|
|
3
|
+
export declare class Router {
|
|
4
|
+
name: string;
|
|
5
|
+
district: District;
|
|
6
|
+
activeRoute?: Route;
|
|
7
|
+
routes: Route[];
|
|
8
|
+
constructor(name: string, district: District);
|
|
9
|
+
get domainName(): string;
|
|
10
|
+
dump(): void;
|
|
11
|
+
toDotReference(): string;
|
|
12
|
+
toDotDefinition(): string;
|
|
13
|
+
toDotConnection(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { District } from "./district";
|
|
2
|
+
import { SectionPosition } from "./position";
|
|
3
|
+
import { PowerDistrict } from "./power-district";
|
|
4
|
+
import { Router } from "./router";
|
|
5
|
+
import { Tile } from "./tile";
|
|
6
|
+
import { Track } from "./track";
|
|
7
|
+
export declare class Section {
|
|
8
|
+
name: string;
|
|
9
|
+
district: District;
|
|
10
|
+
powerDistrict: PowerDistrict;
|
|
11
|
+
tracks: Track[];
|
|
12
|
+
tiles: Tile[];
|
|
13
|
+
in?: Router | Section;
|
|
14
|
+
out?: Router | Section;
|
|
15
|
+
constructor(name: string, district: District);
|
|
16
|
+
get domainName(): string;
|
|
17
|
+
next(reverse: boolean): Section;
|
|
18
|
+
getTilesInRange(startPosition: SectionPosition, endPosition: SectionPosition): {
|
|
19
|
+
offset: {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
};
|
|
23
|
+
tiles: Tile[];
|
|
24
|
+
};
|
|
25
|
+
dump(): void;
|
|
26
|
+
get length(): number;
|
|
27
|
+
get tileLength(): number;
|
|
28
|
+
trail(offset: number, reversed: boolean, length: number): {
|
|
29
|
+
sections: Section[];
|
|
30
|
+
tip: SectionPosition;
|
|
31
|
+
};
|
|
32
|
+
toDotReference(): string;
|
|
33
|
+
toDotDefinition(): string;
|
|
34
|
+
toDotConnection(): string;
|
|
35
|
+
toSVG(): string;
|
|
36
|
+
findSVGPositions(): {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
}[];
|
|
40
|
+
}
|
package/.built/tile.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Section } from './section.js';
|
|
2
|
+
export declare class TilePattern {
|
|
3
|
+
length: number;
|
|
4
|
+
path: (continuous: boolean, x: number, y: number) => string;
|
|
5
|
+
static patterns: {
|
|
6
|
+
'tl-cc': TilePattern;
|
|
7
|
+
'tc-cc': TilePattern;
|
|
8
|
+
'tr-cc': TilePattern;
|
|
9
|
+
'cl-cc': TilePattern;
|
|
10
|
+
'cr-cc': TilePattern;
|
|
11
|
+
'bl-cc': TilePattern;
|
|
12
|
+
'bc-cc': TilePattern;
|
|
13
|
+
'br-cc': TilePattern;
|
|
14
|
+
'cc-tl': TilePattern;
|
|
15
|
+
'cc-tc': TilePattern;
|
|
16
|
+
'cc-tr': TilePattern;
|
|
17
|
+
'cc-cl': TilePattern;
|
|
18
|
+
'cc-cr': TilePattern;
|
|
19
|
+
'cc-bl': TilePattern;
|
|
20
|
+
'cc-bc': TilePattern;
|
|
21
|
+
'cc-br': TilePattern;
|
|
22
|
+
'cr-cl': TilePattern;
|
|
23
|
+
'cr-tl': TilePattern;
|
|
24
|
+
'cr-bl': TilePattern;
|
|
25
|
+
'cl-cr': TilePattern;
|
|
26
|
+
'cl-tr': TilePattern;
|
|
27
|
+
'cl-bl': TilePattern;
|
|
28
|
+
'tl-bc': TilePattern;
|
|
29
|
+
'tl-br': TilePattern;
|
|
30
|
+
'tl-cr': TilePattern;
|
|
31
|
+
'tc-bc': TilePattern;
|
|
32
|
+
'tc-br': TilePattern;
|
|
33
|
+
'tc-bl': TilePattern;
|
|
34
|
+
'tr-cl': TilePattern;
|
|
35
|
+
'tr-bc': TilePattern;
|
|
36
|
+
'bl-tr': TilePattern;
|
|
37
|
+
'bl-tc': TilePattern;
|
|
38
|
+
'bl-cr': TilePattern;
|
|
39
|
+
'bc-tc': TilePattern;
|
|
40
|
+
'bc-tr': TilePattern;
|
|
41
|
+
'bc-tl': TilePattern;
|
|
42
|
+
'br-cl': TilePattern;
|
|
43
|
+
'br-tc': TilePattern;
|
|
44
|
+
'br-tl': TilePattern;
|
|
45
|
+
'cl-bc': TilePattern;
|
|
46
|
+
};
|
|
47
|
+
constructor(length: number, path: (continuous: boolean, x: number, y: number) => string);
|
|
48
|
+
}
|
|
49
|
+
export declare class Tile {
|
|
50
|
+
section: Section;
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
pattern: TilePattern;
|
|
54
|
+
constructor(section: Section, x: number, y: number, pattern: TilePattern);
|
|
55
|
+
toSVGPath(continuous?: boolean): string;
|
|
56
|
+
toSVG(): string;
|
|
57
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Positioner } from "./positioner";
|
|
2
|
+
import { Section } from "./section";
|
|
3
|
+
import { SectionPosition } from "./position";
|
|
4
|
+
export declare class Track {
|
|
5
|
+
section: Section;
|
|
6
|
+
length: number;
|
|
7
|
+
path: string;
|
|
8
|
+
positioners: Positioner[];
|
|
9
|
+
constructor(section: Section, length: number, path: string);
|
|
10
|
+
get head(): SectionPosition;
|
|
11
|
+
dump(): void;
|
|
12
|
+
}
|
package/package.json
CHANGED
package/source/index.ts
CHANGED