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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions types/gl/gl-tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import _default = require("gl");

import type {
STACKGL_destroy_context,
STACKGL_resize_drawingbuffer,
StackGLExtension,
} from "gl";

const createContext = _default;
const WebGLRenderingContext = _default.WebGLRenderingContext;

Expand Down
26 changes: 13 additions & 13 deletions types/gl/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

interface StackGLExtension {
getExtension(extensionName: "STACKGL_resize_drawingbuffer"): STACKGL_resize_drawingbuffer | null;
getExtension(extensionName: "STACKGL_destroy_context"): STACKGL_destroy_context | null;
}
declare namespace createContext {
interface STACKGL_destroy_context {
destroy(): void;
}

interface STACKGL_resize_drawingbuffer {
resize(width: GLint, height: GLint): void;
}
interface STACKGL_resize_drawingbuffer {
resize(width: GLint, height: GLint): void;
}

interface STACKGL_destroy_context {
destroy(): void;
}
interface StackGLExtension {
getExtension(extensionName: "STACKGL_destroy_context"): STACKGL_destroy_context | null;
getExtension(extensionName: "STACKGL_resize_drawingbuffer"): STACKGL_resize_drawingbuffer | null;
}

declare function createContext(width: number, height: number, options?: WebGLContextAttributes): WebGLRenderingContext & StackGLExtension;

declare namespace createContext {
const WebGLRenderingContext: WebGLRenderingContext & StackGLExtension & {
new(): WebGLRenderingContext & StackGLExtension;
prototype: WebGLRenderingContext & StackGLExtension;
};
}

declare function createContext(width: number, height: number, options?: WebGLContextAttributes): WebGLRenderingContext & createContext.StackGLExtension;

export = createContext;