Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

pixi-compressed-textures TypeScript Definition #19

Open
SirMaxeN opened this issue Mar 5, 2018 · 4 comments
Open

pixi-compressed-textures TypeScript Definition #19

SirMaxeN opened this issue Mar 5, 2018 · 4 comments

Comments

@SirMaxeN
Copy link

SirMaxeN commented Mar 5, 2018

Is it possible to get somewhere, somehow typescript definition to pixi-compressed-texuters (d.ts)?
Maybe someone already made it?
Thanks for your attention.
I’m looking forward to your reply.

@ivanpopelyshev
Copy link
Contributor

ivanpopelyshev commented Mar 5, 2018

It has to be small, there are only a few methods. DIY.

declare module PIXI.compressedTextures {
    detectExtensions(renderer: WebGLRenderer): Array[string];
}

@hellraisercenobit
Copy link

I got this error =>
Property 'before' does not exist on type 'Loader'.
How we are supposed to override d.ts file from PIXI.js?

@SirMaxeN
Copy link
Author

SirMaxeN commented Apr 9, 2018

In pixi.js 4.5.3 loader has option pre, I use it to extensionChooser.

My whole d.ts file look like this:
declare module PIXI.compressedTextures { function detectExtensions(renderer: WebGLRenderer): Array<string>; function extensionChooser(extension: any):any; function imageParser():any; }

and it was enough for me

@hellraisercenobit
Copy link

hellraisercenobit commented Apr 9, 2018

haaaaaaaaaa okkkkk
I was thinking compressedTexture extends PIXI.js loader ^^.
Thx you @SirMaxeN !

However in my case it's not enough
In a more strict way we need:

declare module PIXI.compressedTextures { function extensionChooser(ext: string[]): Function; function detectExtensions(renderer: WebGLRenderer | CanvasRenderer): string[]; function imageParser(): Function; }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants