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

getExtension of WebGL shouldn't return any #18633

Closed
kyasbal opened this issue Sep 21, 2017 · 5 comments · Fixed by #20177
Closed

getExtension of WebGL shouldn't return any #18633

kyasbal opened this issue Sep 21, 2017 · 5 comments · Fixed by #20177
Assignees
Labels
Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this Suggestion An idea for TypeScript

Comments

@kyasbal
Copy link

kyasbal commented Sep 21, 2017

TypeScript Version: 2.4.0

Code

This is part of lib.d.ts.

    getExtension(name: string): any;

But, there are also several type definitions of extension returning value.

interface WEBGL_compressed_texture_s3tc {
    readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;
    readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;
    readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;
    readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;
}

declare var WEBGL_compressed_texture_s3tc: {
    prototype: WEBGL_compressed_texture_s3tc;
    new(): WEBGL_compressed_texture_s3tc;
    readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;
    readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;
    readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;
    readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;
};

interface WEBGL_debug_renderer_info {
    readonly UNMASKED_RENDERER_WEBGL: number;
    readonly UNMASKED_VENDOR_WEBGL: number;
}

declare var WEBGL_debug_renderer_info: {
    prototype: WEBGL_debug_renderer_info;
    new(): WEBGL_debug_renderer_info;
    readonly UNMASKED_RENDERER_WEBGL: number;
    readonly UNMASKED_VENDOR_WEBGL: number;
};

interface WEBGL_depth_texture {
    readonly UNSIGNED_INT_24_8_WEBGL: number;
}

declare var WEBGL_depth_texture: {
    prototype: WEBGL_depth_texture;
    new(): WEBGL_depth_texture;
    readonly UNSIGNED_INT_24_8_WEBGL: number;
};

These objects are not used.

    getExtension(name:"WEBGL_depth_texture"): WEBGL_depth_texture;
    getExtension(name:"WEBGL_debug_renderer_info"): WEBGL_debug_renderer_info;
    getExtension(name:"WEBGL_compressed_texture_s3tc"): WEBGL_compressed_texture_s3tc;
    getExtension(name:string):any;

This must be fixed with like the code above. There are more extensions also, these also should be defined in lib.d.ts.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 21, 2017

looks like there are more extensions available: https://www.khronos.org/registry/webgl/extensions/

@mhegazy
Copy link
Contributor

mhegazy commented Sep 21, 2017

PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.

@mhegazy mhegazy added Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this Suggestion An idea for TypeScript labels Sep 21, 2017
@mhegazy mhegazy added this to the Community milestone Sep 21, 2017
@kyasbal
Copy link
Author

kyasbal commented Sep 23, 2017

OK, if there were any other developer want to send PR, I will send PR next week.

@mhegazy mhegazy added the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Nov 14, 2017
@mhegazy mhegazy self-assigned this Nov 14, 2017
@mhegazy mhegazy modified the milestones: Community, TypeScript 2.7 Nov 14, 2017
@kyasbal
Copy link
Author

kyasbal commented Nov 17, 2017

Related PR was merged. Thanks!

@kyasbal kyasbal closed this as completed Nov 17, 2017
@mhegazy mhegazy reopened this Nov 17, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Nov 17, 2017

I still need to merge the change into the main TS repo

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Nov 21, 2017
@mhegazy mhegazy removed the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Nov 21, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants