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

[gl] Export StackGL extension types #63222

Merged

Conversation

SuperSodaSea
Copy link
Contributor

Export STACKGL_destroy_context, STACKGL_resize_drawingbuffer and StackGLExtension in gl.


If changing an existing definition:

@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 12, 2022

@SuperSodaSea Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners, DT maintainers or others

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 63222,
  "author": "SuperSodaSea",
  "headCommitOid": "f00d01c8dea62b3faa1e45e03e7778ab5bc515a2",
  "mergeBaseOid": "862eb1ac269afd36fc4318e1bc3d01dc5b2406a5",
  "lastPushDate": "2022-11-12T17:32:43.000Z",
  "lastActivityDate": "2022-11-15T02:39:01.000Z",
  "mergeOfferDate": "2022-11-15T01:57:26.000Z",
  "mergeRequestDate": "2022-11-15T02:39:01.000Z",
  "mergeRequestUser": "SuperSodaSea",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "gl",
      "kind": "edit",
      "files": [
        {
          "path": "types/gl/gl-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/gl/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "DefinitelyTyped"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "michaeljherrmann",
      "date": "2022-11-15T01:56:44.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 1312535623,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Nov 12, 2022
@typescript-bot
Copy link
Contributor

🔔 @DefinitelyTyped — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@michaeljherrmann
Copy link
Contributor

michaeljherrmann commented Nov 15, 2022

@SuperSodaSea how do you use the current gl library to get issues with types? When I do the following, I seem to have the correct typings:

import createContext, { WebGLRenderingContext } from 'gl';

const ctx1 = createContext(1, 1);
ctx1.getExtension('STACKGL_destroy_context').destroy();
ctx1.getExtension('STACKGL_resize_drawingbuffer').resize(2, 2);

const ctx2 = new WebGLRenderingContext();
ctx2.getExtension('STACKGL_destroy_context').destroy();
ctx2.getExtension('STACKGL_resize_drawingbuffer').resize(2, 2);

Copy link
Contributor

@michaeljherrmann michaeljherrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your changes also still work for me and make sense. I guess I'm just not sure why the previous code didn't quite work

@typescript-bot typescript-bot added Other Approved This PR was reviewed and signed-off by a community member. Self Merge This PR can now be self-merged by the PR author or an owner labels Nov 15, 2022
@typescript-bot
Copy link
Contributor

@SuperSodaSea: Everything looks good here. I am ready to merge this PR (at f00d01c) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@DefinitelyTyped: you can do this too.)

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Waiting for Author to Merge in New Pull Request Status Board Nov 15, 2022
@SuperSodaSea
Copy link
Contributor Author

@michaeljherrmann The original types works just fine, but I want to use the types of the extensions directly:

import createContext from 'gl';
import type { STACKGL_resize_drawingbuffer, StackGLExtension } from 'gl';
class Foo {
    private context: WebGLRenderingContext & StackGLExtension;
    private resizeDrawingBuffer?: STACKGL_resize_drawingbuffer;
    constructor() {
        this.context = createContext(1, 1);
        this.resizeDrawingBuffer = this.context.getExtension('STACKGL_resize_drawingbuffer');
    }
}

Anyway, thanks for approving this.

@SuperSodaSea
Copy link
Contributor Author

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Nov 15, 2022
@typescript-bot typescript-bot merged commit ccfc3c3 into DefinitelyTyped:master Nov 15, 2022
@SuperSodaSea SuperSodaSea deleted the gl/export-extension branch November 15, 2022 02:39
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Other Approved This PR was reviewed and signed-off by a community member. Self Merge This PR can now be self-merged by the PR author or an owner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants