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

phaser.d.ts issue. #3869

Closed
jcyuan opened this issue Jul 27, 2018 · 5 comments
Closed

phaser.d.ts issue. #3869

jcyuan opened this issue Jul 27, 2018 · 5 comments

Comments

@jcyuan
Copy link
Contributor

jcyuan commented Jul 27, 2018

I found some errors in the .d.ts:

image

GameConfig:
I think this is correct:

{
     render: { pixelArt: true  }
}

but in .d.ts it was generated as "render.pixelArt": boolean.

because this is auto-generated from JSDoc, so I can't modify it and make a PR.

actually If the item is an object in the GameConfig or other class, it will be generated as a wrong format in .d.ts.

@jcyuan
Copy link
Contributor Author

jcyuan commented Jul 27, 2018

the correct format should be:

banner?: boolean | {
    hidePhaser?: boolean,
    text?: string,
    background?: string
};

render?: {
    antialias?: boolean,
    pixelArt?: boolean,
    autoResize?: boolean,
    roundPixels?: boolean,
    transparent?: boolean,
    clearBeforeRender?: boolean,
    premultipliedAlpha?: boolean,
    preserveDrawingBuffer?: boolean,
    failIfMajorPerformanceCaveat?: boolean,
    powerPreference?: string,
    batchSize?: integer
}

input?: boolean | {
    keyboard?: boolean | {
        target?: any
    },
    mouse: boolean | {
        target?: any
    },
    touch?: boolean | {
        target?: any,
        capture?: boolean
    },
    activePointers?: integer,
    gamepad?: boolean | {
        target?: any
    }
};

etc...

@jcyuan
Copy link
Contributor Author

jcyuan commented Jul 27, 2018

another BIG catch:

Phaser.Utils.Object

this namespace should be Phaser.Utils.Objects

missed 's' in the JSDoc.

@jcyuan
Copy link
Contributor Author

jcyuan commented Jul 31, 2018

I think there is still more errors in the .d.ts, is there a good way to fix? e.g. to create .d.ts project on github and everyone could do PR on it?

@photonstorm
Copy link
Collaborator

The vast majority of them can be fixed by editing the JSDocs in the source code, from which the defs are generated. Changing the defs file directly won't help anyone, as it'll just be replaced the next time the parser is run.

@jcyuan
Copy link
Contributor Author

jcyuan commented Jul 31, 2018

ok, I'll try to fix docs

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

2 participants