Skip to content

Exported variable <variable name> has or is using private name <private name> from external library #15947

Closed
@ryasmi

Description

@ryasmi

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:

(4,1): error TS4082: Default export of the module has or is using private name 'Warning'.

My code:

import { optional } from 'rulr';
import { stringValue, mailto, sha1, iri, account } from '../factory';

export default {
  objectType: optional(stringValue),
  name: optional(stringValue),
  mbox: optional(mailto),
  mbox_sha1sum: optional(sha1),
  openid: optional(iri),
  account: optional(account),
};

Rulr's type definitions (generated by the TypeScript compiler):

export declare type Path = string[];
export declare class Warning {
    data: any;
    path: Path;
    constructor(data: any, path: Path);
}
export declare type Rule = (data: any, path: Path) => Warning[];
export declare const optional: (rule: Rule) => Rule;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions