@@ -11,7 +11,7 @@ export class NonApplicableIndexer extends Error {}
1111 * @remarks
1212 * Indexers organize paths into different structures (layers, tools, etc.)
1313 */
14- export class Indexer {
14+ export abstract class Indexer {
1515 /** The indexes being managed by this indexer */
1616 protected indexes : unknown ;
1717
@@ -28,18 +28,15 @@ export class Indexer {
2828 * @param path - Path to sort
2929 * @throws Error if not implemented in subclass
3030 */
31- sortIn ( path : Path ) : void {
32- path ;
33- throw new Error ( 'Method not implemented.' ) ;
34- }
31+ abstract sortIn ( path : Path ) : void ;
3532}
3633
3734/**
3835 * Indexer that organizes paths by travel type (extrusion vs travel moves)
3936 */
4037export class TravelTypeIndexer extends Indexer {
4138 /** Indexes containing arrays of paths for each travel type */
42- protected declare indexes : Record < string , Path [ ] > ;
39+ declare protected indexes : Record < string , Path [ ] > ;
4340
4441 /**
4542 * Creates a new TravelTypeIndexer
@@ -79,7 +76,7 @@ export class LayersIndexer extends Indexer {
7976 static readonly DEFAULT_TOLERANCE = 0.05 ;
8077
8178 /** Array of layers being managed */
82- protected declare indexes : Layer [ ] ;
79+ declare protected indexes : Layer [ ] ;
8380
8481 /** Tolerance for layer height differences */
8582 private tolerance : number ;
@@ -146,7 +143,7 @@ export class LayersIndexer extends Indexer {
146143 */
147144export class ToolIndexer extends Indexer {
148145 /** 2D array of paths indexed by tool number */
149- protected declare indexes : Path [ ] [ ] ;
146+ declare protected indexes : Path [ ] [ ] ;
150147
151148 /**
152149 * Creates a new ToolIndexer
@@ -162,7 +159,6 @@ export class ToolIndexer extends Indexer {
162159 */
163160 sortIn ( path : Path ) : void {
164161 if ( path . travelType === PathType . Extrusion ) {
165- this . indexes ;
166162 this . indexes [ path . tool ] = this . indexes [ path . tool ] || [ ] ;
167163 if ( this . indexes [ path . tool ] === undefined ) {
168164 this . indexes [ path . tool ] = [ ] ;
0 commit comments