Skip to content

Conversation

@rudi-c
Copy link
Contributor

@rudi-c rudi-c commented Nov 18, 2024

No description provided.

| { type: "sketch", obj: Sketch, change: TypedObjectChange<FileFormat.Sketch>, origin: ChangeOrigin }
| { type: "extrusion", obj: Extrusion, change: TypedObjectChange<FileFormat.Extrusion>, origin: ChangeOrigin }
| { type: "group", obj: Group, change: TypedObjectChange<FileFormat.Group>, origin: ChangeOrigin }
| { type: "level", obj: Sketch, change: TypedObjectChange<FileFormat.Level>, origin: ChangeOrigin }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively

type ElementChangeCreator<T extends Element, F extends FileFormat.Element> =
  | { type: T["type"], obj: T, change: TypedObjectChange<F>, origin: ChangeOrigin }

type ElementListenerChange =
  | ElementChangeCreator<Level, FileFormat.Level>
  | ElementChangeCreator<Sketch, FileFormat.Sketch>
  ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants