import p5exInterface from './p5exInterface'; /** * Extension of p5 class. */ declare class p5exClass extends p5 implements p5exInterface { /** * Current renderer object, either the p5ex instance itself or any p5.Graphics instance. * Will be used as the drawing target. */ currentRenderer: p5exClass; /** * Sets the current renderer object. * @param renderer */ setCurrentRenderer(renderer: p5exClass | p5.Graphics): void; /** * The width and height of the HTML element which contains the sketch. * If the HTML element is not provided, the width and height of the window will be set. */ readonly maxCanvasRegion: { width: number; height: number; getShortSideLength: () => number; }; /** * ScalableCanvas object created by createScalableCanvas(). */ scalableCanvas: ScalableCanvas; /** * The non-scaled width of the canvas. */ readonly nonScaledWidth: number; /** * The non-scaled height of the canvas. */ readonly nonScaledHeight: number; /** * The HTML element which holds the p5 sketch. */ node: HTMLElement; private scalableCanvasType; private _idealFrameRate; private _unitAngleSpeed; private _unitSpeed; private _unitAccelerationMagnitude; /** * The ideal frame rate which was set by setFrameRate(). */ readonly idealFrameRate: number; /** * Anglular displacement in radians per frame which corresponds to 1 cycle per second. * Set by setFrameRate(). */ readonly unitAngleSpeed: number; /** * Positional displacement per frame which corresponds to 1 unit length per second. * Set by setFrameRate(). */ readonly unitSpeed: number; /** * Change of speed per frame which corresponds to 1 unit speed per second. * Set by setFrameRate(). */ readonly unitAccelerationMagnitude: number; /** * Constructor of class p5ex. * @param sketch * @param node * @param sync */ constructor(sketch: Function, node?: HTMLElement | boolean | string, sync?: boolean); /** * Calls frameRate() and sets variables related to the frame rate. * @param {number} [fps=60] - The ideal frame rate per second. */ setFrameRate(fps?: number | undefined): p5exClass; /** * Updates the value of the variable maxCanvasRegion. */ updateMaxCanvasRegion(): void; /** * Create an instance of ScalableCanvas. This includes calling of createCanvas(). * @param {ScalableCanvasType} type - Type chosen from p5ex.ScalableCanvasTypes. * @param {ScalableCanvasParameters} [parameters] - Parameters for type CUSTOM. * @param {string} [rendererType] - Either P2D or WEBGL. */ createScalableCanvas(type: ScalableCanvasType, parameters?: ScalableCanvasParameters, rendererType?: 'p2d' | 'webgl' | undefined): void; /** * Resizes the ScalableCanvas. Does not work on OpenProcessing. * @param {ScalableCanvasType} [type] - Type chosen from p5ex.ScalableCanvasTypes. * If undefined, the last used type will be used again. * @param {ScalableCanvasParameters} [parameters] - Parameters for type CUSTOM. */ resizeScalableCanvas(type?: ScalableCanvasType, parameters?: ScalableCanvasParameters): void; protected createScalableCanvasParameter(type: ScalableCanvasType, parameters?: ScalableCanvasParameters): ScalableCanvasParameters; } import { ScalableCanvas, ScalableCanvasType, ScalableCanvasParameters } from './canvas'; export { p5exClass }; export * from './properties';