-
Notifications
You must be signed in to change notification settings - Fork 648
Open
Labels
external issueThe root cause is with an external component that needs a fix or workaroundThe root cause is with an external component that needs a fix or workaround
Description
I have an interface such as this:
import { authoringContentReducer } from './auth.content.reducer';
export const AUTH_CONTENT_FEATURE = 'authContent';
export const authContentFeatureReducer = {
[AUTH_CONTENT_FEATURE]: authoringContentReducer
};
with
import { Reducer } from 'redux';
...
export const authoringContentReducer: Reducer<
AuthoringContentState,
| AddAuthoringContentAction
| SetAuthoringContentAction
| RemoveAuthoringContentAction
> = ...;
the authContentFeatureReducer
is appears in the api export as
{
"kind": "Variable",
"canonicalReference": "authContentFeatureReducer",
"docComment": "",
"excerptTokens": [
{
"kind": "Reference",
"text": "authContentFeatureReducer"
},
{
"kind": "Content",
"text": ": "
},
{
"kind": "Content",
"text": "{\n ["
},
{
"kind": "Reference",
"text": "AUTH_CONTENT_FEATURE"
},
{
"kind": "Content",
"text": "]: import(\"redux\")."
},
{
"kind": "Reference",
"text": "Reducer"
},
i.e. the reference to the Reducer
type from redux
is includes as an import in the type declaration instead of just using the Reducer
value.
This is in particular problematic in the documentation generated from this structure, the fully rendered doc in my example is:
authContentFeatureReducer: {
[AUTH_CONTENT_FEATURE]: import("redux").Reducer<Record<string, import("@ibm-wch-sdk/api").AuthoringContentItem>, import("..").PayloadAction<import("@ibm-wch-sdk/api").AuthoringContentItem> | import("..").PayloadAction<string>>;
}
which is basically unreadable.
I would have preferred the types to be referenced (and in particular documented) just by their name, not their import path.
Metadata
Metadata
Assignees
Labels
external issueThe root cause is with an external component that needs a fix or workaroundThe root cause is with an external component that needs a fix or workaround
Type
Projects
Status
AE/AD