-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
Description
The following succeeds:
export interface A extends B { /* ... */ }
interface B { /* ... */ }
It will "hide" the interface B entirely from jsii.
But the following fails:
import { B } from './private/b';
export interface A extends B { /* ... */ }
With the error "can't find B, make sure it's exported".
Even though it's the exact same situation.
aws-cloudwatch/lib/alarm.ts:33:1 - error JSII9002: Unable to resolve type "aws-cdk-lib.CreateAlarmOptionsBase". It may be @internal or not exported from the module's entry point (as configured in "package.json" as "main").
Adding @internal
to B
does appease jsii, but this still shouldn't happen this way.
Probable reason
I'm guessing that the code that checks whether or not the B
type should be hidden or should be visible looks at the export
keyword and nothing else, but it B
must have export
if it comes from a different file, even if that file is itself not exported on purpose.