import React from 'react'; import type { EffectsProp, EffectsOutputSize } from './effects/effect-types.js'; import type { InteractiveBaseProps, InteractiveCropProps } from './Interactive.js'; import type { AbsoluteFillLayout } from './Sequence.js'; declare global { interface DrawElementImageOptions { preserveElementGeometry?: boolean; } interface WebGLCopyElementImageConfig { sx?: GLfloat; sy?: GLfloat; swidth?: GLfloat; sheight?: GLfloat; width?: GLsizei; height?: GLsizei; } interface UpdateElementGeometryOptions { preserveHitTestOrder?: boolean; clip?: DOMRectInit; canvasTransform?: DOMMatrixInit; } interface ElementImage { readonly width: number; readonly height: number; close(): void; } interface CanvasRenderingContext2D { drawElementImage(element: Element | ElementImage, dx: number, dy: number, options?: DrawElementImageOptions): void; drawElementImage(element: Element | ElementImage, dx: number, dy: number, dwidth: number, dheight: number, options?: DrawElementImageOptions): void; drawElementImage(element: Element | ElementImage, sx: number, sy: number, swidth: number, sheight: number, dx: number, dy: number, options?: DrawElementImageOptions): void; drawElementImage(element: Element | ElementImage, sx: number, sy: number, swidth: number, sheight: number, dx: number, dy: number, dwidth: number, dheight: number, options?: DrawElementImageOptions): void; } interface OffscreenCanvasRenderingContext2D { drawElementImage(element: Element | ElementImage, dx: number, dy: number, options?: DrawElementImageOptions): void; drawElementImage(element: Element | ElementImage, dx: number, dy: number, dwidth: number, dheight: number, options?: DrawElementImageOptions): void; drawElementImage(element: Element | ElementImage, sx: number, sy: number, swidth: number, sheight: number, dx: number, dy: number, options?: DrawElementImageOptions): void; drawElementImage(element: Element | ElementImage, sx: number, sy: number, swidth: number, sheight: number, dx: number, dy: number, dwidth: number, dheight: number, options?: DrawElementImageOptions): void; } interface WebGLRenderingContextBase { texElementSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, element: Element | ElementImage, config?: WebGLCopyElementImageConfig): void; texElementImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, element: Element | ElementImage): void; texElementImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, element: Element | ElementImage): void; texElementImage2D(target: GLenum, level: GLint, internalformat: GLint, sx: GLfloat, sy: GLfloat, swidth: GLfloat, sheight: GLfloat, format: GLenum, type: GLenum, element: Element | ElementImage): void; texElementImage2D(target: GLenum, level: GLint, internalformat: GLint, sx: GLfloat, sy: GLfloat, swidth: GLfloat, sheight: GLfloat, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, element: Element | ElementImage): void; } interface HTMLCanvasElementEventMap { paint: Event; } interface HTMLCanvasElement { content: string; layoutSubtree?: boolean; onpaint: ((this: HTMLCanvasElement, ev: Event) => unknown) | null; requestPaint?(): void; captureElementImage(element: Element): ElementImage; updateElementGeometry(element: Element | ElementImage, options?: UpdateElementGeometryOptions): void; clearElementGeometry(element: Element | ElementImage): void; getElementTransform(element: Element): DOMMatrix; } interface OffscreenCanvas { updateElementGeometry(element: Element | ElementImage, options?: UpdateElementGeometryOptions): void; clearElementGeometry(element: Element | ElementImage): void; } } export type HtmlInCanvasOnPaintParams = { /** * The paint target. During rendering, its pixels are copied to the layout * `` after painting; during preview, it controls that canvas directly. */ readonly canvas: OffscreenCanvas; readonly element: HTMLDivElement; readonly elementImage: ElementImage; readonly pixelDensity: number; }; export declare const isHtmlInCanvasSupported: () => boolean; export declare const isHtmlInCanvasNestingSupported: () => boolean; /** Generic fallback for consumers that cannot inspect the current browser. */ export declare const HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas requires Chrome 149 or newer with Canvas Draw Element enabled at chrome://flags/#canvas-draw-element."; export declare const getHtmlInCanvasUnsupportedMessage: () => string; export type HtmlInCanvasOnPaint = (params: HtmlInCanvasOnPaintParams) => void | Promise; export type HtmlInCanvasOnInitCleanup = () => void; export type HtmlInCanvasOnInit = (params: HtmlInCanvasOnPaintParams) => HtmlInCanvasOnInitCleanup | Promise; export type HtmlInCanvasPixelDensity = number; export type HtmlInCanvasProps = Omit & InteractiveCropProps & Omit & { readonly durationInFrames?: number; readonly width: number; readonly height: number; readonly effects?: EffectsProp; readonly effectsOutputSize?: EffectsOutputSize; readonly children: React.ReactNode; readonly onPaint?: HtmlInCanvasOnPaint; readonly onInit?: HtmlInCanvasOnInit; readonly pixelDensity?: HtmlInCanvasPixelDensity; readonly _remotionInternalCanvasSiblings?: React.ReactNode; readonly _remotionInternalFallbackLabel?: string; }; export declare const useHtmlInCanvasUnsupportedMessage: () => string | null; export declare const htmlInCanvasSchema: { readonly 'style.transformOrigin': { readonly type: 'transform-origin'; readonly step: 1; readonly default: '50% 50%'; readonly description: 'Origin'; }; readonly 'style.translate': { readonly type: 'translate'; readonly step: 1; readonly default: '0px 0px'; readonly description: 'Offset'; }; readonly 'style.scale': { readonly type: 'scale'; readonly max: 100; readonly step: 0.01; readonly default: 1; readonly description: 'Scale'; readonly defaultKeyframeOutput: 'perceptual-scale'; }; readonly 'style.rotate': { readonly type: 'rotation-css'; readonly step: 1; readonly default: '0deg'; readonly description: 'Rotation'; }; readonly 'style.opacity': { readonly type: 'number'; readonly min: 0; readonly max: 1; readonly step: 0.01; readonly default: 1; readonly description: 'Opacity'; readonly hiddenFromList: false; }; readonly 'style.borderWidth': { readonly type: 'number'; readonly default: undefined; readonly min: 0; readonly step: 1; readonly description: 'Border width'; readonly hiddenFromList: false; }; readonly 'style.borderStyle': { readonly type: 'enum'; readonly default: 'none'; readonly description: 'Border style'; readonly variants: { readonly none: {}; readonly hidden: {}; readonly solid: {}; readonly dashed: {}; readonly dotted: {}; readonly double: {}; readonly groove: {}; readonly ridge: {}; readonly inset: {}; readonly outset: {}; }; }; readonly 'style.borderColor': { readonly type: 'color'; readonly default: undefined; readonly description: 'Border color'; }; readonly 'style.borderRadius': { readonly type: 'number'; readonly default: 0; readonly min: 0; readonly step: 1; readonly description: 'Border radius'; readonly hiddenFromList: false; readonly keyframable: true; }; readonly 'style.borderTopLeftRadius': { readonly type: 'number'; readonly default: 0; readonly min: 0; readonly step: 1; readonly description: 'Top left radius'; readonly hiddenFromList: false; }; readonly 'style.borderTopRightRadius': { readonly type: 'number'; readonly default: 0; readonly min: 0; readonly step: 1; readonly description: 'Top right radius'; readonly hiddenFromList: false; }; readonly 'style.borderBottomRightRadius': { readonly type: 'number'; readonly default: 0; readonly min: 0; readonly step: 1; readonly description: 'Bottom right radius'; readonly hiddenFromList: false; }; readonly 'style.borderBottomLeftRadius': { readonly type: 'number'; readonly default: 0; readonly min: 0; readonly step: 1; readonly description: 'Bottom left radius'; readonly hiddenFromList: false; }; readonly 'style.backgroundColor': { readonly type: 'color'; readonly default: 'transparent'; readonly description: 'Color'; }; readonly cropLeft: { readonly type: 'number'; readonly default: 0; readonly description: 'Crop left'; readonly min: 0; readonly max: 1; readonly step: 0.01; readonly hiddenFromList: false; readonly keyframable: true; }; readonly cropRight: { readonly type: 'number'; readonly default: 0; readonly description: 'Crop right'; readonly min: 0; readonly max: 1; readonly step: 0.01; readonly hiddenFromList: false; readonly keyframable: true; }; readonly cropTop: { readonly type: 'number'; readonly default: 0; readonly description: 'Crop top'; readonly min: 0; readonly max: 1; readonly step: 0.01; readonly hiddenFromList: false; readonly keyframable: true; }; readonly cropBottom: { readonly type: 'number'; readonly default: 0; readonly description: 'Crop bottom'; readonly min: 0; readonly max: 1; readonly step: 0.01; readonly hiddenFromList: false; readonly keyframable: true; }; readonly durationInFrames: { readonly type: 'number'; readonly default: undefined; readonly min: 1; readonly step: 1; readonly hiddenFromList: true; }; readonly from: { readonly type: 'number'; readonly default: 0; readonly step: 1; readonly hiddenFromList: true; }; readonly trimBefore: { readonly type: 'number'; readonly default: 0; readonly min: 0; readonly step: 1; readonly hiddenFromList: true; }; readonly playbackRate: { readonly type: 'number'; readonly default: 1; readonly min: 0.01; readonly step: 0.1; readonly description: 'Playback rate'; readonly hiddenFromList: false; readonly keyframable: false; }; readonly freeze: { readonly type: 'number'; readonly default: null; readonly step: 1; readonly hiddenFromList: true; }; readonly hidden: import("./interactivity-schema.js").BooleanFieldSchema; readonly name: import("./interactivity-schema.js").HiddenFieldSchema; readonly showInTimeline: import("./interactivity-schema.js").HiddenFieldSchema; readonly pixelDensity: { readonly type: 'number'; readonly min: 1; readonly max: 3; readonly step: 0.1; readonly default: 1; readonly description: 'Pixel density'; readonly hiddenFromList: false; }; }; export declare const HtmlInCanvas: React.ForwardRefExoticComponent> & { readonly isSupported: typeof isHtmlInCanvasSupported; readonly isNestingSupported: typeof isHtmlInCanvasNestingSupported; };