Skip to content

Problems with definitions imported across multiple .d.ts files (re pixi.js v6) #413

Open
@mpcomplete

Description

@mpcomplete

I ran into this issue when trying to update fable-pixi from pixi.js v5 to v6.

pixi.js type definition files have code like this:

import { AlphaFilter } from '@pixi/filter-alpha';

which gets translated by ts2fable into this:

type AlphaFilter = @pixi_filter_alpha.AlphaFilter

which is not valid. I'm actually not sure what the correct behavior here is, because the original fable-pixi handles this in a way that seems hand-written (see Fable.Pixi.js).

Here is the script I ran from within the ts2fable/ project dir:

npm install --save-dev pixi.js
npm run-script ts2fable node_modules/pixi.js/*.d.ts node_modules/\@pixi/*/*.d.ts Fable.Pixi.fs

Also, this generated everything in a single module. It was unclear from the ts2fable docs if there was a simple way to put the output of each file into its own module - maybe it just means running ts2fable separately and gluing them together manually?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions