Skip to content
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

libraries with double quoted properties cause syntax errors in externs #855

Open
BrianLeishman opened this issue Sep 2, 2024 · 0 comments

Comments

@BrianLeishman
Copy link

I've had this problem before, but I'm installing the latest version of pdfjs, and for whatever reason this library has lots of these quoted properties in its type definitions.

Here is an example source d.ts file: https://github.com/StirlingMarketingGroup/StirlingMarketingGroup/blob/master/plus/v2/node_modules/pdfjs-dist/types/src/display/draw_layer.d.ts

export class DrawLayer {
    static get _svgFactory(): any;
    static "__#27@#setBox"(element: any, { x, y, width, height }?: {
        x?: number | undefined;
        y?: number | undefined;
        width?: number | undefined;
        height?: number | undefined;
    }): void;
    constructor({ pageIndex }: {
        pageIndex: any;
    });
    pageIndex: any;
    setParent(parent: any): void;
    highlight(outlines: any, color: any, opacity: any, isPathUpdatable?: boolean): {
        id: number;
        clipPathId: string;
    };
    highlightOutline(outlines: any): number;
    finalizeLine(id: any, line: any): void;
    updateLine(id: any, line: any): void;
    removeFreeHighlight(id: any): void;
    updatePath(id: any, line: any): void;
    updateBox(id: any, box: any): void;
    show(id: any, visible: any): void;
    rotate(id: any, angle: any): void;
    changeColor(id: any, color: any): void;
    changeOpacity(id: any, opacity: any): void;
    addClass(id: any, className: any): void;
    removeClass(id: any, className: any): void;
    remove(id: any): void;
    destroy(): void;
    #private;
}

And this generates a block like this in the externs:

/**
 * @public
 * @param {?} element
 * @param {(undefined|{x: (undefined|number), y: (undefined|number), width: (undefined|number), height: (undefined|number)})=} __1
 * @return {void}
 */
node_modules$pdfjs$0019dist$types$src$display$draw_layer$_d$_ts.DrawLayer"__#27@#setBox" = function(element, __1) {};

I've tried looking for where these externs are generated, but it seems it might be in tsickle itself, which I guess is no longer being maintained :/

So I'm not sure if this is another thing we could potentially patch via tscc?

BrianLeishman added a commit to BrianLeishman/tsickle that referenced this issue Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant