Skip to content

Commit

Permalink
Added documentation for types
Browse files Browse the repository at this point in the history
  • Loading branch information
reindernijhoff committed Nov 7, 2023
1 parent 953d057 commit 74bbde5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/ImageEffectRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import {WebGLInstance} from './WebGLInstance.js';
import RendererInstance from "./RendererInstance.js";

/**
* @typedef {Object} ImageEffectRendererOptions
* @property {boolean} loop - Determines if the renderer should loop. Defaults to false.
* @property {boolean} autoResize - Determines if the renderer should automatically resize. Defaults to true.
* @property {number} pixelRatio - The pixel ratio of the renderer. Defaults to window.devicePixelRatio.
* @property {boolean} useSharedContext - Determines if the renderer should use a shared WebGL context. Defaults to true.
* @property {boolean} asyncCompile - Determines if the renderer should compile shaders asynchronously. Defaults to true.
*/
export type ImageEffectRendererOptions = {
loop: boolean;
autoResize: boolean;
Expand Down
8 changes: 8 additions & 0 deletions src/lib/Renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import type Program from "./Program.js";
import type {RendererBuffer} from "./RendererBuffer.js";
import type {Texture} from "./Texture.js.js";

/**
* @typedef {Object} ImageOptions
* @property {boolean} clampX - Determines if the texture's horizontal dimension will be clamped. Defaults to true.
* @property {boolean} clampY - Determines if the texture's vertical dimension will be clamped. Defaults to true.
* @property {boolean} flipY - Inverts the image texture in the y-axis. Defaults to false.
* @property {boolean} useMipmap - Specifies whether to use mipmaps for texture sampling. Defaults to true.
* @property {boolean} useCache - Indicates if the texture should be cached. Defaults to true.
*/
export type ImageOptions = {
clampX: boolean,
clampY: boolean,
Expand Down

0 comments on commit 74bbde5

Please sign in to comment.