-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exported variable <variable name> has or is using private name <private name> from external library #15947
Comments
Actually I can't extend the class, that makes no sense. I'd have to recreate every function in that library haha |
Ok import { optional, Rule } from 'rulr';
import { stringValue, mailto, sha1, iri, account } from '../factory';
export default {
objectType: optional(stringValue) as Rule,
name: optional(stringValue),
mbox: optional(mailto),
mbox_sha1sum: optional(sha1),
openid: optional(iri),
account: optional(account),
}; |
I am not able to get this to repro locally using your input file. can you share more context? |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
Hey @mhegazy, no worries, I'd do the same, I'm on holiday for a few more days, I'll get back to this when I'm home 😄 |
Ok @mhegazy, what context do you need? 😄 |
can you share a self-contained sample that reproduces the issue? |
Yeah I'll give that a try. |
This is the same issue as #9944. The declaration emitter tried to serialize the type of the property To avoid this warning, write an explicit type annotation for the type of your property. something like this would work: import { optional, Rule } from 'rulr';
export default <{foobar: Rule;}> {
foobar: optional(() => []),
} |
Hey @mhegazy, I did understand that already from other issues I'd found before creating this one, but thank you for the explanation anyway and thanks for referencing the duplicate issue (sorry I didn't find that in my search) 😄 I'll subscribe to that issue going forward. Thanks for the fix too! 👍 |
Hey guys not really sure what to do about this. I know this is a duplicate of #6307, but I didn't really want to comment on a closed issue. I can't really use @DanielRosenwasser's solution here because the class is exported from the library. I guess I could extend that class in my code and use that instead. Completely understand the issues with this, I guess I'm just looking for a recommendation and I wanted to report this for other people.
Error:
My code:
Rulr's type definitions (generated by the TypeScript compiler):
The text was updated successfully, but these errors were encountered: