chore!: prefer interfaces over types for public type definitions#3517
Merged
tbouffard merged 2 commits intoMay 11, 2026
Merged
Conversation
Convert public type-alias declarations to `interface` declarations so that consumers can augment them via
TypeScript declaration merging. This unlocks extension by downstream libs such as `bpmn-visualization-addons`
without forking the types.
The eslint rule `@typescript-eslint/consistent-type-definitions` was previously disabled. Removing the disable
lets the default `prefer-interface` configuration take effect and keeps future declarations consistent.
Also surface a couple of types and tighten the API documentation:
- export `BpmnGraph` and `Disposable` (as types) so consumers can reference them directly;
- silence typedoc warnings: unused `@param` entries on the destructured parameter of
`IconPainter.newBpmnCanvas`, unresolved `{@link}` references, mismatched param names;
- add a type-only test under `test/typescript-support/` proving `BpmnGraph` is reachable from a consumer
package and that mxGraph-derived members (`graph.view.revalidate()`, `graph.getStylesheet()`) compile.
BREAKING CHANGE:
- Public types previously declared with \`type X = { ... }\` are now \`interface X { ... }\`. Object-shape
usages (Pick, Omit, intersection with \`&\`, \`extends\`) are unaffected. Consumers relying on type-alias-only
semantics (e.g. assignability of a union/tuple alias) would need to adapt, though no such usage is known.
|
♻️ PR Preview 5f53374 has been successfully destroyed since this PR has been closed. 🤖 By surge-preview |
|
♻️ PR Preview 5f53374 has been successfully destroyed since this PR has been closed. 🤖 By surge-preview |
It was using a TypeScript syntax not supported by TS v4
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Convert public type-alias declarations to
interfacedeclarations so that consumers can augment them viaTypeScript declaration merging. This unlocks extension by downstream libs such as
bpmn-visualization-addonswithout forking the types.
The eslint rule
@typescript-eslint/consistent-type-definitionswas previously disabled. Removing the disablelets the default
prefer-interfaceconfiguration take effect and keeps future declarations consistent.Also surface a couple of types and tighten the API documentation:
BpmnGraphandDisposable(as types) so consumers can reference them directly;@paramentries on the destructured parameter ofIconPainter.newBpmnCanvas, unresolved{@link}references, mismatched param names;test/typescript-support/provingBpmnGraphis reachable from a consumerpackage and that mxGraph-derived members (
graph.view.revalidate(),graph.getStylesheet()) compile.BREAKING CHANGE:
usages (Pick, Omit, intersection with `&`, `extends`) are unaffected. Consumers relying on type-alias-only
semantics (e.g. assignability of a union/tuple alias) would need to adapt, though no such usage is known.