@@ -11,7 +11,7 @@ import { TGraphColors, TGraphConstants, initGraphColors, initGraphConstants } fr
1111import { GraphEventParams , GraphEventsDefinitions } from "./graphEvents" ;
1212import { scheduler } from "./lib/Scheduler" ;
1313import { HitTest } from "./services/HitTest" ;
14- import { Layer } from "./services/Layer" ;
14+ import { Layer , LayerPublicProps } from "./services/Layer" ;
1515import { Layers } from "./services/LayersService" ;
1616import { CameraService } from "./services/camera/CameraService" ;
1717import { RootStore } from "./store" ;
@@ -23,12 +23,7 @@ import { clearTextCache } from "./utils/renderers/text";
2323import { RecursivePartial } from "./utils/types/helpers" ;
2424import { IPoint , IRect , Point , TPoint , TRect , isTRect } from "./utils/types/shapes" ;
2525
26- export type LayerConfig < T extends Constructor < Layer > = Constructor < Layer > > = [
27- T ,
28- T extends Constructor < Layer < infer Props > >
29- ? Omit < Props , "root" | "camera" | "graph" > & { root ?: Props [ "root" ] }
30- : never ,
31- ] ;
26+ export type LayerConfig < T extends Constructor < Layer > = Constructor < Layer > > = [ T , LayerPublicProps < T > ] ;
3227export type TGraphConfig < Block extends TBlock = TBlock , Connection extends TConnection = TConnection > = {
3328 configurationName ?: string ;
3429 blocks ?: Block [ ] ;
@@ -306,9 +301,7 @@ export class Graph {
306301
307302 public addLayer < T extends Constructor < Layer > = Constructor < Layer > > (
308303 layerCtor : T ,
309- props : T extends Constructor < Layer < infer Props > >
310- ? Omit < Props , "root" | "camera" | "graph" | "emitter" > & { root ?: Props [ "root" ] }
311- : never
304+ props : LayerPublicProps < T >
312305 ) : InstanceType < T > {
313306 // TODO: These types are too complicated, try to simplify them
314307 return this . layers . createLayer ( layerCtor as Constructor < Layer > , {
0 commit comments