From 74bbde5da7952a7f2ea1178b67a5ea58eb736bec Mon Sep 17 00:00:00 2001 From: Reinder Nijhoff Date: Tue, 7 Nov 2023 10:38:17 +0100 Subject: [PATCH] Added documentation for types --- src/lib/ImageEffectRenderer.ts | 8 ++++++++ src/lib/Renderer.ts | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/lib/ImageEffectRenderer.ts b/src/lib/ImageEffectRenderer.ts index da712c4..bcde2bc 100644 --- a/src/lib/ImageEffectRenderer.ts +++ b/src/lib/ImageEffectRenderer.ts @@ -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; diff --git a/src/lib/Renderer.ts b/src/lib/Renderer.ts index 05ef5d9..13d9e58 100644 --- a/src/lib/Renderer.ts +++ b/src/lib/Renderer.ts @@ -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,