// Generated by dts-bundle v0.7.3

declare module '@modfy/videocontext' {
    import { AudioContextWrapper } from "@modfy/videocontext/Audio/AudioContextWrapper";
    import DestinationNode from "@modfy/videocontext/DestinationNode/destinationnode";
    import CompositingNode from "@modfy/videocontext/ProcessingNodes/compositingnode";
    import EffectNode from "@modfy/videocontext/ProcessingNodes/effectnode";
    import ProcessingNode from "@modfy/videocontext/ProcessingNodes/processingnode";
    import TransitionNode from "@modfy/videocontext/ProcessingNodes/transitionnode";
    import AudioNode from "@modfy/videocontext/SourceNodes/audionode";
    import CanvasNode from "@modfy/videocontext/SourceNodes/canvasnode";
    import ImageNode from "@modfy/videocontext/SourceNodes/imagenode";
    import MediaNode from "@modfy/videocontext/SourceNodes/medianode";
    import SourceNode from "@modfy/videocontext/SourceNodes/sourcenode";
    import VideoNode from "@modfy/videocontext/SourceNodes/videonode";
    import GraphNode from "@modfy/videocontext/graphnode";
    import { MediaErrorEvent, MediaErrorTarget } from "@modfy/videocontext/MediaErrorTarget";
    import RenderGraph from "@modfy/videocontext/rendergraph";
    import { createControlFormForNode, createSigmaGraphDataFromRenderGraph, exportToJSON, importSimpleEDL, UpdateablesManager, visualiseVideoContextGraph, visualiseVideoContextTimeline } from "@modfy/videocontext/utils";
    import VideoElementCache from "@modfy/videocontext/videoelementcache";
    enum STATE {
            PLAYING = 0,
            PAUSED = 1,
            STALLED = 2,
            ENDED = 3,
            BROKEN = 4
    }
    enum EVENTS {
            UPDATE = "update",
            STALLED = "stalled",
            ENDED = "ended",
            CONTENT = "content",
            NOCONTENT = "nocontent"
    }
    /**
        * VideoContext.
        * @module VideoContext
        */
    export default class VideoContext {
            audioCtx?: AudioContextWrapper;
            mediaErrorTarget: MediaErrorTarget;
            _canvas: HTMLCanvasElement;
            _endOnLastSourceEnd: boolean;
            _gl: WebGLRenderingContext;
            _useVideoElementCache: boolean;
            _videoElementCache: VideoElementCache;
            _audioElementCache: undefined;
            _id: string;
            _renderGraph: RenderGraph;
            _sourceNodes: Array<SourceNode<any>>;
            _processingNodes: Array<ProcessingNode>;
            _timeline: any[];
            _currentTime: number;
            currentFrame: number;
            fps: number;
            _state: number;
            _playbackRate: number;
            _volume: number;
            _sourcesPlaying: unknown;
            _destinationNode: DestinationNode;
            _callbacks: Map<string, Array<Function>>;
            _timelineCallbacks: Array<{
                    time: number;
                    func: Function;
                    ordering: number;
            }>;
            _isRenderMode: boolean;
            _glCleared: boolean;
            static STATE: typeof STATE;
            static EVENTS: typeof EVENTS;
            /**
                * Initialise the VideoContext and render to the specific canvas. A 2nd parameter can be passed to the constructor which is a function that get's called if the VideoContext fails to initialise.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement, () => console.error("Sorry, your browser dosen\'t support WebGL"));
                * var videoNode = ctx.video("video.mp4");
                * videoNode.connect(ctx.destination);
                * videoNode.start(0);
                * videoNode.stop(10);
                * ctx.play();
                *
                */
            constructor(canvas: HTMLCanvasElement, initErrorCallback?: Function, { manualUpdate, endOnLastSourceEnd, useVideoElementCache, videoElementCacheSize, webglContextAttributes, fps }?: {
                    manualUpdate?: boolean;
                    endOnLastSourceEnd?: boolean;
                    useVideoElementCache?: boolean;
                    videoElementCacheSize?: number;
                    webglContextAttributes?: {};
                    fps?: number;
            }, webglType?: string);
            onMediaError(fn: (mediaErr: MediaErrorEvent) => void): void;
            /**
                *
                */
            setDestinationNode(node: AudioDestinationNode): void;
            getNodeType(node: GraphNode): "video" | "audio" | "canvas" | "image" | "unknown" | "compositing" | "effect" | "transition" | "destination";
            toggleRenderMode(b: boolean): void;
            toggleUpdater(shouldUpdate: boolean): void;
            setUpdaterRunning(isRunning: any): void;
            /**
                * Returns an ID assigned to the VideoContext instance. This will either be the same id as the underlying canvas element,
                * or a uniquely generated one.
                */
            get id(): string;
            /**
                *  Update the canvas element without having to recreate the whole video context
                * @param {Canvas} canvas the new canvas element to render the output to
                */
            updateCanvas(canvas: HTMLCanvasElement, { webglContextAttributes, webglType, initErrorCallback }: {
                    webglContextAttributes?: {};
                    webglType?: string;
                    initErrorCallback?: () => void;
            }): void;
            /**
                * Set the ID of the VideoContext instance. This should be unique.
                */
            set id(newID: string);
            /**
                * Register a callback to happen at a specific point in time.
                * @param {number} time - the time at which to trigger the callback.
                * @param {Function} func - the callback to register.
                * @param {number} ordering - the order in which to call the callback if more than one is registered for the same time.
                */
            registerTimelineCallback(time: number, func: Function, ordering?: number): void;
            /**
                * Unregister a callback which happens at a specific point in time.
                * @param {Function} func - the callback to unregister.
                */
            unregisterTimelineCallback(func: Function): void;
            /**
                * Register a callback to listen to one of the events defined in `VideoContext.EVENTS`
                *
                * @param {String} type - the event to register against.
                * @param {Function} func - the callback to register.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * ctx.registerCallback(VideoContext.EVENTS.STALLED, () => console.log("Playback stalled"));
                * ctx.registerCallback(VideoContext.EVENTS.UPDATE, () => console.log("new frame"));
                * ctx.registerCallback(VideoContext.EVENTS.ENDED, () => console.log("Playback ended"));
                */
            registerCallback(type: string, func: Function): boolean;
            /**
                * Remove a previously registered callback
                *
                * @param {Function} func - the callback to remove.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                *
                * //the callback
                * var updateCallback = () => console.log("new frame");
                *
                * //register the callback
                * ctx.registerCallback(VideoContext.EVENTS.UPDATE, updateCallback);
                * //then unregister it
                * ctx.unregisterCallback(updateCallback);
                *
                */
            unregisterCallback(func: Function): boolean;
            _callCallbacks(type: string): void;
            /**
                * Get the canvas that the VideoContext is using.
                *
                * @return {HTMLCanvasElement} The canvas that the VideoContext is using.
                *
                */
            get element(): HTMLCanvasElement;
            /**
                * Get the current state.
                * @return {STATE} The number representing the state.
                *
                */
            get state(): number;
            /**
                * Set the progress through the internal timeline.
                * Setting this can be used as a way to implement a scrubbable timeline.
                *
                * @param {number} currentTime - this is the currentTime to set in seconds.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * var videoNode = ctx.video("video.mp4");
                * videoNode.connect(ctx.destination);
                * videoNode.start(0);
                * videoNode.stop(20);
                * ctx.currentTime = 10; // seek 10 seconds in
                * ctx.play();
                *
                */
            set currentTime(currentTime: number);
            /**
                * Get how far through the internal timeline has been played.
                *
                * Getting this value will give the current playhead position. Can be used for updating timelines.
                * @return {number} The time in seconds through the current playlist.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * var videoNode = ctx.video("video.mp4");
                * videoNode.connect(ctx.destination);
                * videoNode.start(0);
                * videoNode.stop(10);
                * ctx.play();
                * setTimeout(() => console.log(ctx.currentTime),1000); //should print roughly 1.0
                *
                */
            get currentTime(): number;
            /**
                * Update Frame and also calls a side effect of update the currentTime
                */
            setCurrentFrame(currentFrame: number): void;
            /**
                * Get the time at which the last node in the current internal timeline finishes playing.
                *
                * @return {number} The end time in seconds of the last video node to finish playing.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * console.log(ctx.duration); //prints 0
                *
                * var videoNode = ctx.video("video.mp4");
                * videoNode.connect(ctx.destination);
                * videoNode.start(0);
                * videoNode.stop(10);
                *
                * console.log(ctx.duration); //prints 10
                *
                * ctx.play();
                */
            get duration(): number;
            /**
                * Get the final node in the render graph which represents the canvas to display content on to.
                *
                * This proprety is read-only and there can only ever be one destination node. Other nodes can connect to this but you cannot connect this node to anything.
                *
                * @return {DestinationNode} A graph node representing the canvas to display the content on.
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * var videoNode = ctx.video("video.mp4");
                * videoNode.start(0);
                * videoNode.stop(10);
                * videoNode.connect(ctx.destination);
                *
                */
            get destination(): DestinationNode;
            /**
                * Set the playback rate of the VideoContext instance.
                * This will alter the playback speed of all media elements played through the VideoContext.
                *
                * @param {number} rate - this is the playback rate.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * var videoNode = ctx.video("video.mp4");
                * videoNode.start(0);
                * videoNode.stop(10);
                * videoNode.connect(ctx.destination);
                * ctx.playbackRate = 2;
                * ctx.play(); // Double playback rate means this will finish playing in 5 seconds.
                */
            set playbackRate(rate: number);
            /**
                *  Return the current playbackRate of the video context.
                * @return {number} A value representing the playbackRate. 1.0 by default.
                */
            get playbackRate(): number;
            /**
                * Set the volume of all MediaNode created in the VideoContext.
                * @param {number} volume - the volume to apply to the video nodes.
                */
            set volume(vol: number);
            /**
                * Return the current volume of the video context.
                * @return {number} A value representing the volume. 1.0 by default.
                */
            get volume(): number;
            /**
                * Start the VideoContext playing
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * var videoNode = ctx.video("video.mp4");
                * videoNode.connect(ctx.destination);
                * videoNode.start(0);
                * videoNode.stop(10);
                * ctx.play();
                */
            play(): boolean;
            /**
                * Pause playback of the VideoContext
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * var videoNode = ctx.video("video.mp4");
                * videoNode.connect(ctx.destination);
                * videoNode.start(0);
                * videoNode.stop(20);
                * ctx.currentTime = 10; // seek 10 seconds in
                * ctx.play();
                * setTimeout(() => ctx.pause(), 1000); //pause playback after roughly one second.
                */
            pause(): boolean;
            /**
                * Create a new node representing a video source
                *
                * @param {string|HTMLVideoElement|MediaStream} - The URL or video element to create the video from.
                * @param {number} [sourceOffset=0] - Offset into the start of the source video to start playing from.
                * @param {number} [preloadTime=4] - How many seconds before the video is to be played to start loading it.
                * @param {Object} [videoElementAttributes] - A dictionary of attributes to map onto the underlying video element.
                * @return {VideoNode} A new video node.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * var videoNode = ctx.video("bigbuckbunny.mp4");
                */
            video(src: string | HTMLVideoElement | MediaStream, sourceOffset?: number, preloadTime?: number, audioOptions?: {
                    gain: number;
            }, videoElementAttributes?: {}): VideoNode;
            /**
                * Create a new node representing an audio source
                * @param {string|HTMLAudioElement|MediaStream} src - The url or audio element to create the audio node from.
                * @param {number} [sourceOffset=0] - Offset into the start of the source audio to start playing from.
                * @param {number} [preloadTime=4] - How long before a node is to be displayed to attmept to load it.
                * @param {Object} [imageElementAttributes] - Any attributes to be given to the underlying image element.
                * @return {AudioNode} A new audio node.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * var audioNode = ctx.audio("ziggystardust.mp3");
                */
            audio(src: string | HTMLAudioElement | MediaStream, sourceOffset?: number, preloadTime?: number, audioOptions?: {
                    gain: number;
            }, audioElementAttributes?: {}): AudioNode;
            /**
                * Create a new node representing an image source
                * @param {string|Image|ImageBitmap} src - The url or image element to create the image node from.
                * @param {number} [preloadTime=4] - How long before a node is to be displayed to attmept to load it.
                * @param {Object} [imageElementAttributes] - Any attributes to be given to the underlying image element.
                * @return {ImageNode} A new image node.
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                * var imageNode = ctx.image("image.png");
                *
                * @example
                * var canvasElement = document.getElementById("canvas");
                * var imageElement = document.getElementById("image");
                * var ctx = new VideoContext(canvasElement);
                * var imageNode = ctx.image(imageElement);
                */
            image(src: string | ImageBitmap | HTMLImageElement, preloadTime?: number, imageElementAttributes?: {}): ImageNode;
            /**
                * Create a new node representing a canvas source
                * @param {Canvas} src - The canvas element to create the canvas node from.
                * @return {CanvasNode} A new canvas node.
                */
            canvas(canvas: HTMLCanvasElement): CanvasNode;
            /**
                * Create a new effect node.
                * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS.
                * @return {EffectNode} A new effect node created from the passed definition
                */
            effect(definition: any): EffectNode;
            /**
                * Create a new compositiing node.
                *
                * Compositing nodes are used for operations such as combining multiple video sources into a single track/connection for further processing in the graph.
                *
                * A compositing node is slightly different to other processing nodes in that it only has one input in it's definition but can have unlimited connections made to it.
                * The shader in the definition is run for each input in turn, drawing them to the output buffer. This means there can be no interaction between the spearte inputs to a compositing node, as they are individually processed in seperate shader passes.
                *
                * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the compositing node to create. Builtin definitions can be found by accessing VideoContext.DEFINITIONS
                *
                * @return {CompositingNode} A new compositing node created from the passed definition.
                *
                * @example
                *
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                *
                * //A simple compositing node definition which just renders all the inputs to the output buffer.
                * var combineDefinition = {
                *     vertexShader : "\
                *         attribute vec2 a_position;\
                *         attribute vec2 a_texCoord;\
                *         varying vec2 v_texCoord;\
                *         void main() {\
                *             gl_Position = vec4(vec2(2.0,2.0)*vec2(1.0, 1.0), 0.0, 1.0);\
                *             v_texCoord = a_texCoord;\
                *         }",
                *     fragmentShader : "\
                *         precision mediump float;\
                *         uniform sampler2D u_image;\
                *         uniform float a;\
                *         varying vec2 v_texCoord;\
                *         varying float v_progress;\
                *         void main(){\
                *             vec4 color = texture2D(u_image, v_texCoord);\
                *             gl_FragColor = color;\
                *         }",
                *     properties:{
                *         "a":{type:"uniform", value:0.0},
                *     },
                *     inputs:["u_image"]
                * };
                * //Create the node, passing in the definition.
                * var trackNode = videoCtx.compositor(combineDefinition);
                *
                * //create two videos which will play at back to back
                * var videoNode1 = ctx.video("video1.mp4");
                * videoNode1.play(0);
                * videoNode1.stop(10);
                * var videoNode2 = ctx.video("video2.mp4");
                * videoNode2.play(10);
                * videoNode2.stop(20);
                *
                * //Connect the nodes to the combine node. This will give a single connection representing the two videos which can
                * //be connected to other effects such as LUTs, chromakeyers, etc.
                * videoNode1.connect(trackNode);
                * videoNode2.connect(trackNode);
                *
                * //Don't do anything exciting, just connect it to the output.
                * trackNode.connect(ctx.destination);
                *
                */
            compositor(definition: any): CompositingNode;
            /**
                * Instanciate a custom built source node
                * @param {SourceNode} CustomSourceNode
                * @param {Object} src
                */
            customSourceNode(CustomSourceNode: typeof SourceNode, src: any): SourceNode<any>;
            /**
                * Create a new transition node.
                *
                * Transistion nodes are a type of effect node which have parameters which can be changed as events on the timeline.
                *
                * For example a transition node which cross-fades between two videos could have a "mix" property which sets the
                * progress through the transistion. Rather than having to write your own code to adjust this property at specfic
                * points in time a transition node has a "transition" function which takes a startTime, stopTime, targetValue, and a
                * propertyName (which will be "mix"). This will linearly interpolate the property from the curernt value to
                * tragetValue between the startTime and stopTime.
                *
                * @param {Object} definition - this is an object defining the shaders, inputs, and properties of the transition node to create.
                * @return {TransitionNode} A new transition node created from the passed definition.
                * @example
                *
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement);
                *
                * //A simple cross-fade node definition which cross-fades between two videos based on the mix property.
                * var crossfadeDefinition = {
                *     vertexShader : "\
                *        attribute vec2 a_position;\
                *        attribute vec2 a_texCoord;\
                *        varying vec2 v_texCoord;\
                *        void main() {\
                *            gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\
                *            v_texCoord = a_texCoord;\
                *         }",
                *     fragmentShader : "\
                *         precision mediump float;\
                *         uniform sampler2D u_image_a;\
                *         uniform sampler2D u_image_b;\
                *         uniform float mix;\
                *         varying vec2 v_texCoord;\
                *         varying float v_mix;\
                *         void main(){\
                *             vec4 color_a = texture2D(u_image_a, v_texCoord);\
                *             vec4 color_b = texture2D(u_image_b, v_texCoord);\
                *             color_a[0] *= mix;\
                *             color_a[1] *= mix;\
                *             color_a[2] *= mix;\
                *             color_a[3] *= mix;\
                *             color_b[0] *= (1.0 - mix);\
                *             color_b[1] *= (1.0 - mix);\
                *             color_b[2] *= (1.0 - mix);\
                *             color_b[3] *= (1.0 - mix);\
                *             gl_FragColor = color_a + color_b;\
                *         }",
                *     properties:{
                *         "mix":{type:"uniform", value:0.0},
                *     },
                *     inputs:["u_image_a","u_image_b"]
                * };
                *
                * //Create the node, passing in the definition.
                * var transitionNode = videoCtx.transition(crossfadeDefinition);
                *
                * //create two videos which will overlap by two seconds
                * var videoNode1 = ctx.video("video1.mp4");
                * videoNode1.play(0);
                * videoNode1.stop(10);
                * var videoNode2 = ctx.video("video2.mp4");
                * videoNode2.play(8);
                * videoNode2.stop(18);
                *
                * //Connect the nodes to the transistion node.
                * videoNode1.connect(transitionNode);
                * videoNode2.connect(transitionNode);
                *
                * //Set-up a transition which happens at the crossover point of the playback of the two videos
                * transitionNode.transition(8,10,1.0,"mix");
                *
                * //Connect the transition node to the output
                * transitionNode.connect(ctx.destination);
                *
                * //start playback
                * ctx.play();
                */
            transition(definition: any): TransitionNode;
            _isStalled(): boolean;
            /**
                * This allows manual calling of the update loop of the videoContext.
                *
                * @param {Number} dt - The difference in seconds between this and the previous calling of update.
                * @example
                *
                * var canvasElement = document.getElementById("canvas");
                * var ctx = new VideoContext(canvasElement, undefined, {"manualUpdate" : true});
                *
                * var previousTime;
                * function update(time){
                *     if (previousTime === undefined) previousTime = time;
                *     var dt = (time - previousTime)/1000;
                *     ctx.update(dt);
                *     previousTime = time;
                *     requestAnimationFrame(update);
                * }
                * update();
                *
                */
            update(dt: number): Promise<void>;
            /**
                * Way to manually call the updateLoop for small frame intervals
                * @param frames
                * @returns
                */
            updateFrame(frames: number): Promise<void>;
            /**
                * Update the video context
                * @param dt number Delta time in seconds
                */
            _update(dt: number): Promise<void>;
            /**
                * Destroy all nodes in the graph and reset the timeline. After calling this any created nodes will be unusable.
                */
            reset(): void;
            _deprecate(msg: string): void;
            static get DEFINITIONS(): {
                    AAF_VIDEO_SCALE: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    scaleX: {
                                            type: string;
                                            value: number;
                                    };
                                    scaleY: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    CROSSFADE: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    mix: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    DREAMFADE: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    mix: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    HORIZONTAL_WIPE: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    mix: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    VERTICAL_WIPE: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    mix: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    RANDOM_DISSOLVE: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    mix: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    STATIC_DISSOLVE: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    mix: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    STATIC_EFFECT: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    weight: {
                                            type: string;
                                            value: number[];
                                    };
                                    amount: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    TO_COLOR_AND_BACK: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    mix: {
                                            type: string;
                                            value: number;
                                    };
                                    color: {
                                            type: string;
                                            value: number[];
                                    };
                            };
                            inputs: string[];
                    };
                    STAR_WIPE: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    mix: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    COMBINE: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    a: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    COLORTHRESHOLD: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    a: {
                                            type: string;
                                            value: number;
                                    };
                                    colorAlphaThreshold: {
                                            type: string;
                                            value: number[];
                                    };
                            };
                            inputs: string[];
                    };
                    MONOCHROME: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    inputMix: {
                                            type: string;
                                            value: number[];
                                    };
                                    outputMix: {
                                            type: string;
                                            value: number[];
                                    };
                            };
                            inputs: string[];
                    };
                    HORIZONTAL_BLUR: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    blurAmount: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    VERTICAL_BLUR: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    blurAmount: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    }; /**
                    //  * Video Context States
                    //  * @readonly
                    //  * @typedef {Object} STATE
                    //  * @property {number} STATE.PLAYING - All sources are active
                    //  * @property {number} STATE.PAUSED - All sources are paused
                    //  * @property {number} STATE.STALLED - One or more sources is unable to play
                    //  * @property {number} STATE.ENDED - All sources have finished playing
                    //  * @property {number} STATE.BROKEN - The render graph is in a broken state
                    //  */
                    AAF_VIDEO_CROP: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    cropLeft: {
                                            type: string;
                                            value: number;
                                    };
                                    cropRight: {
                                            type: string;
                                            value: number;
                                    };
                                    cropTop: {
                                            type: string;
                                            value: number;
                                    };
                                    cropBottom: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    AAF_VIDEO_POSITION: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    positionOffsetX: {
                                            type: string;
                                            value: number;
                                    };
                                    positionOffsetY: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    AAF_VIDEO_FLIP: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {};
                            inputs: string[];
                    };
                    AAF_VIDEO_FLOP: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {};
                            inputs: string[];
                    };
                    OPACITY: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    opacity: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
                    CROP: {
                            title: string;
                            description: string;
                            vertexShader: any;
                            fragmentShader: any;
                            properties: {
                                    x: {
                                            type: string;
                                            value: number;
                                    };
                                    y: {
                                            type: string;
                                            value: number;
                                    };
                                    width: {
                                            type: string;
                                            value: number;
                                    };
                                    height: {
                                            type: string;
                                            value: number;
                                    };
                            };
                            inputs: string[];
                    };
            };
            static get NODES(): {
                    AudioNode: typeof AudioNode;
                    CanvasNode: typeof CanvasNode;
                    ImageNode: typeof ImageNode;
                    MediaNode: typeof MediaNode;
                    SourceNode: typeof SourceNode;
                    VideoNode: typeof VideoNode;
            };
            /**
                * Get a JS Object containing the state of the VideoContext instance and all the created nodes.
                */
            snapshot(): {
                    nodes: {};
                    videoContext: {
                            currentTime: any;
                            duration: any;
                            state: any;
                            playbackRate: any;
                    };
            };
            static visualiseVideoContextTimeline: typeof visualiseVideoContextTimeline;
            static visualiseVideoContextGraph: typeof visualiseVideoContextGraph;
            static createControlFormForNode: typeof createControlFormForNode;
            static createSigmaGraphDataFromRenderGraph: typeof createSigmaGraphDataFromRenderGraph;
            static exportToJSON: typeof exportToJSON;
            static updateablesManager: UpdateablesManager;
            static importSimpleEDL: typeof importSimpleEDL;
    }
    export {};
}

declare module '@modfy/videocontext/Audio/AudioContextWrapper' {
    import { AudioDestinationNode } from "@modfy/videocontext/types";
    type AudioProcessCallback = (_event: AudioProcessingEvent) => void;
    export class AudioContextWrapper {
            ctx: AudioContext;
            destination: AudioDestinationNode;
            onAudioProcessCallbacks: AudioProcessCallback[];
            constructor(ctx: AudioContext);
            /**
                * Register a function to be called on audio process events
                * @param callback The function you want to be called every time audio is processed
                * @returns A function you can call to unregister this callback
                */
            registerAudioProcess: (callback: AudioProcessCallback) => () => AudioProcessCallback[];
            /**
                * This is called on teh audio process event on the processor node,
                * it writes the input to the output so audio plays
                * and then calls all the registered callbacks
                */
            onAudioProcess: (event: AudioProcessingEvent) => void;
    }
    export {};
}

declare module '@modfy/videocontext/DestinationNode/destinationnode' {
    import ProcessingNode from "@modfy/videocontext/ProcessingNodes/processingnode";
    import RenderGraph from "@modfy/videocontext/rendergraph";
    const TYPE = "DestinationNode";
    class DestinationNode extends ProcessingNode {
        /**
          * Initialise an instance of a DestinationNode.
          *
          * There should only be a single instance of a DestinationNode per VideoContext instance. An VideoContext's destination can be accessed like so: videoContext.desitnation.
          *
          * You should not instantiate this directly.
          */
        constructor(gl: WebGLRenderingContext, renderGraph: RenderGraph);
        _render(): void;
    }
    export { TYPE as DESTINATIONTYPE };
    export default DestinationNode;
}

declare module '@modfy/videocontext/ProcessingNodes/compositingnode' {
    import ProcessingNode from "@modfy/videocontext/ProcessingNodes/processingnode";
    class CompositingNode extends ProcessingNode {
        /**
          * Initialise an instance of a Compositing Node. You should not instantiate this directly, but use VideoContest.createCompositingNode().
          */
        constructor(gl: any, renderGraph: any, definition: any);
        _render(): void;
    }
    export default CompositingNode;
}

declare module '@modfy/videocontext/ProcessingNodes/effectnode' {
    import ProcessingNode from "@modfy/videocontext/ProcessingNodes/processingnode";
    const TYPE = "EffectNode";
    class EffectNode extends ProcessingNode {
        /**
          * Initialise an instance of an EffectNode. You should not instantiate this directly, but use VideoContest.createEffectNode().
          */
        constructor(gl: any, renderGraph: any, definition: any);
        _render(): void;
    }
    export { TYPE as EFFECTYPE };
    export default EffectNode;
}

declare module '@modfy/videocontext/ProcessingNodes/processingnode' {
    import GraphNode from "@modfy/videocontext/graphnode";
    import RenderGraph from "@modfy/videocontext/rendergraph";
    const TYPE = "ProcessingNode";
    class ProcessingNode extends GraphNode {
            _gl: WebGLRenderingContext;
            _vertexShader: unknown;
            _fragmentShader: unknown;
            _definition: unknown;
            _properties: object;
            _shaderInputsTextureUnitMapping: any[];
            _maxTextureUnits: any;
            _boundTextureUnits: number;
            _texture: any;
            _program: any;
            _framebuffer: WebGLFramebuffer;
            _currentTime: number;
            _currentTimeLocation: WebGLUniformLocation;
            /**
                * Initialise an instance of a ProcessingNode.
                *
                * This class is not used directly, but is extended to create CompositingNodes, TransitionNodes, and EffectNodes.
                */
            constructor(gl: WebGLRenderingContext, renderGraph: RenderGraph, definition: any, inputNames: any, limitConnections: any);
            /**
                * Sets the passed processing node property to the passed value.
                * @param {string} name - The name of the processing node parameter to modify.
                * @param {Object} value - The value to set it to.
                *
                * @example
                * var ctx = new VideoContext();
                * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);
                * monoNode.setProperty("inputMix", [1.0,0.0,0.0]); //Just use red channel
                */
            setProperty(name: any, value: any): void;
            /**
                * Sets the passed processing node property to the passed value.
                * @param {string} name - The name of the processing node parameter to get.
                *
                * @example
                * var ctx = new VideoContext();
                * var monoNode = ctx.effect(VideoContext.DEFINITIONS.MONOCHROME);
                * console.log(monoNode.getProperty("inputMix")); //Will output [0.4,0.6,0.2], the default value from the effect definition.
                *
                */
            getProperty(name: any): any;
            /**
                * Destroy and clean-up the node.
                */
            destroy(): void;
            _update(currentTime: number): void;
            _seek(currentTime: number): void;
            _render(): void;
    }
    export { TYPE as PROCESSINGTYPE };
    export default ProcessingNode;
}

declare module '@modfy/videocontext/ProcessingNodes/transitionnode' {
    import EffectNode from "@modfy/videocontext/ProcessingNodes/effectnode";
    const TYPE = "TransitionNode";
    class TransitionNode extends EffectNode {
            /**
                * Initialise an instance of a TransitionNode. You should not instantiate this directly, but use VideoContest.createTransitionNode().
                */
            constructor(gl: any, renderGraph: any, definition: any);
            _doesTransitionFitOnTimeline(testTransition: any): boolean;
            _insertTransitionInTimeline(transition: any): void;
            /**
                * Create a transition on the timeline.
                *
                * @param {number} startTime - The time at which the transition should start (relative to currentTime of video context).
                * @param {number} endTime - The time at which the transition should be completed by (relative to currentTime of video context).
                * @param {number} currentValue - The value to start the transition at.
                * @param {number} targetValue - The value to transition to by endTime.
                * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to "mix".
                *
                * @return {Boolean} returns True if a transition is successfully added, false otherwise.
                */
            transition(startTime: any, endTime: any, currentValue: any, targetValue: any, propertyName?: string): boolean;
            /**
                * Create a transition on the timeline at an absolute time.
                *
                * @param {number} startTime - The time at which the transition should start (relative to time 0).
                * @param {number} endTime - The time at which the transition should be completed by (relative to time 0).
                * @param {number} currentValue - The value to start the transition at.
                * @param {number} targetValue - The value to transition to by endTime.
                * @param {String} propertyName - The name of the property to clear transitions on, if undefined default to "mix".
                *
                * @return {Boolean} returns True if a transition is successfully added, false otherwise.
                */
            transitionAt(startTime: any, endTime: any, currentValue: any, targetValue: any, propertyName?: string): boolean;
            /**
                * Clear all transitions on the passed property. If no property is defined clear all transitions on the node.
                *
                * @param {String} propertyName - The name of the property to clear transitions on, if undefined clear all transitions on the node.
                */
            clearTransitions(propertyName: any): void;
            /**
                * Clear a transition on the passed property that the specified time lies within.
                *
                * @param {String} propertyName - The name of the property to clear a transition on.
                * @param {number} time - A time which lies within the property you're trying to clear.
                *
                * @return {Boolean} returns True if a transition is removed, false otherwise.
                */
            clearTransition(propertyName: any, time: any): boolean;
            _update(currentTime: any): void;
    }
    export { TYPE as TRANSITIONTYPE };
    export default TransitionNode;
}

declare module '@modfy/videocontext/SourceNodes/audionode' {
    import { MediaAudioAdapter } from "@modfy/videocontext/Audio/MediaAudioAdapter";
    import MediaNode from "@modfy/videocontext/SourceNodes/medianode";
    const TYPE = "AudioNode";
    export type AudioSrc = string | HTMLAudioElement | MediaStream;
    class AudioNode extends MediaNode<AudioSrc> {
        audioAdapter?: MediaAudioAdapter;
        /**
          * Initialise an instance of an AudioNode.
          * This should not be called directly, but created through a call to videoContext.audio();
          */
        constructor(...args: ConstructorParameters<typeof MediaNode>);
        _update(currentTime: number): Promise<boolean>;
        _initializeElement(): void;
        _unload(): void;
        destroy(): void;
    }
    export { TYPE as AUDIOTYPE };
    export default AudioNode;
}

declare module '@modfy/videocontext/SourceNodes/canvasnode' {
    import RenderGraph from "@modfy/videocontext/rendergraph";
    import SourceNode from "@modfy/videocontext/SourceNodes/sourcenode";
    const TYPE = "CanvasNode";
    class CanvasNode extends SourceNode<HTMLCanvasElement> {
        _preloadTime: number;
        /**
          * Initialise an instance of a CanvasNode.
          * This should not be called directly, but created through a call to videoContext.createCanvasNode();
          */
        constructor(canvas: HTMLCanvasElement, gl: WebGLRenderingContext, renderGraph: RenderGraph, currentTime: number, preloadTime?: number);
        _load(): void;
        _unload(): void;
        _seek(time: number): void;
        _update(currentTime: number): boolean;
    }
    export { TYPE as CANVASTYPE };
    export default CanvasNode;
}

declare module '@modfy/videocontext/SourceNodes/imagenode' {
    import RenderGraph from "@modfy/videocontext/rendergraph";
    import SourceNode from "@modfy/videocontext/SourceNodes/sourcenode";
    const TYPE = "ImageNode";
    export type ImageSrc = string | ImageBitmap | HTMLImageElement;
    class ImageNode extends SourceNode<ImageSrc> {
        _preloadTime: number;
        _attributes: {
            [name: string]: any;
        };
        _textureUploaded: boolean;
        _image: HTMLImageElement;
        /**
          * Initialise an instance of an ImageNode.
          * This should not be called directly, but created through a call to videoContext.createImageNode();
          */
        constructor(src: string | ImageBitmap | HTMLImageElement, gl: WebGLRenderingContext, renderGraph: RenderGraph, currentTime: number, preloadTime?: number, attributes?: {});
        get elementURL(): string;
        _loadImage(): Promise<void>;
        _preload(): Promise<void>;
        _load(): void;
        _unload(): void;
        _seek(time: number): void;
        _update(currentTime: number): boolean;
    }
    export { TYPE as IMAGETYPE };
    export default ImageNode;
}

declare module '@modfy/videocontext/SourceNodes/medianode' {
    import { AudioContextWrapper } from "@modfy/videocontext/Audio/AudioContextWrapper";
    import { MediaErrorTarget } from "@modfy/videocontext/MediaErrorTarget";
    import RenderGraph from "@modfy/videocontext/rendergraph";
    import { MediaNodeAudioOptions } from "@modfy/videocontext/types";
    import VideoElementCache from "@modfy/videocontext/videoelementcache";
    import { AudioSrc } from "@modfy/videocontext/SourceNodes/audionode";
    import SourceNode from "@modfy/videocontext/SourceNodes/sourcenode";
    import { VideoSrc } from "@modfy/videocontext/SourceNodes/videonode";
    export type MediaSrc = AudioSrc | VideoSrc;
    class MediaNode<SRC extends MediaSrc> extends SourceNode<SRC> {
            isRenderMode: boolean;
            mediaErrorTarget: MediaErrorTarget;
            _preloadTime: number;
            _sourceOffset: number;
            _globalPlaybackRate: number;
            _mediaElementCache: VideoElementCache;
            _playbackRate: number;
            _playbackRateUpdated: boolean;
            _attributes: {
                    volume: number;
                    loop?: boolean;
            };
            _loopElement: boolean;
            _isElementPlaying: boolean;
            _loadTriggered: boolean;
            _elementType: any;
            /**
                * Initialise an instance of a MediaNode.
                * This should not be called directly, but extended by other Node Types which use a `HTMLMediaElement`.
                * NOTE; audioCtx and audioOptions are being used in audio node
                */
            constructor(src: SRC, gl: WebGLRenderingContext, renderGraph: RenderGraph, currentTime: number, mediaErrorTarget: MediaErrorTarget, _audioCtx?: AudioContextWrapper, _audioOptions?: MediaNodeAudioOptions, globalPlaybackRate?: number, sourceOffset?: number, preloadTime?: number, mediaElementCache?: any, attributes?: {});
            /**
                * Reloads the media
                * @param url - (Optional) New url to use
                */
            refresh(url?: string): void;
            set playbackRate(playbackRate: number);
            set stretchPaused(stretchPaused: boolean);
            get stretchPaused(): boolean;
            get playbackRate(): number;
            get elementURL(): MediaStream extends SRC ? string | (SRC & MediaStream) : string;
            /**
                * @property {Boolean}
                * @summary - Check if the element is waiting on the network to continue playback
                */
            get _buffering(): boolean;
            set volume(volume: number);
            _initializeElement(): void;
            /**
                * Zack: Called when in non-rendering mode to load media that will be polled for readiness later
                */
            _triggerLoad(): void;
            preload(): Promise<void>;
            /**
                * _load has two functions:
                *
                * 1. `_triggerLoad` which ensures the element has the correct src and is at the correct currentTime,
                *     so that the browser can start fetching media.
                *
                * 2.  `shouldPollForElementReadyState` waits until the element has a "readState" that signals there
                *     is enough media to start playback. This is a little confusing as currently structured.
                *     We're using the _update loop to poll the _load function which checks the element status.
                *     When ready we fire off the "loaded callback"
                *
                */
            _load(): void;
            _unload(): void;
            /**
                * Seek to the given ABSOLUTE VideoCtx time (the time will be adjusted for this node)
                *
                * This will change _element.currentTime, and that may require you to check _element.readyState or _element.seeking to
                * load the new data.
                *
                * @param {number} time
                */
            _seek(time: number): void;
            _update(currentTime: number, triggerTextureUpdate?: boolean): Promise<boolean>;
            _updateWrapperSync(currentTime: number, triggerTextureUpdate?: boolean): boolean;
            _updateWrapperAsync(currentTime: number, triggerTextureUpdate?: boolean): Promise<boolean>;
            _updateImpl(): boolean;
            /**
                * Move a media node's place in time without having to create a new one
                * @param startSeconds number The global start seconds
                * @param start number The element's start second
                * @param duration number The element's duration second
                *
                * MediaNode.move - changes the source offset, this is node specific start
                * SourceNode.move - changes the actual startAt and endAt points, this is global start and end
                */
            move(startSeconds: number, start: number, duration: number): void;
            clearTimelineState(): void;
            destroy(): void;
    }
    export default MediaNode;
}

declare module '@modfy/videocontext/SourceNodes/sourcenode' {
    import GraphNode from "@modfy/videocontext/graphnode";
    import RenderGraph from "@modfy/videocontext/rendergraph";
    import { ImageSrc } from "@modfy/videocontext/SourceNodes/imagenode";
    import { MediaSrc } from "@modfy/videocontext/SourceNodes/medianode";
    let STATE: {
            waiting: number;
            sequenced: number;
            playing: number;
            paused: number;
            ended: number;
            error: number;
    };
    const TYPE = "SourceNode";
    export type Sources = MediaSrc | ImageSrc | HTMLCanvasElement;
    export type Elements<T extends Sources> = Exclude<T, string | MediaStream>;
    class SourceNode<SRC extends Sources> extends GraphNode {
            mediaIsOffline: boolean;
            /**
                * This is set from the outside, controls weather we want to show the offline media image or not
                */
            showOfflineUi: boolean;
            _gl?: WebGLRenderingContext;
            _element: Elements<SRC>;
            _elementURL: MediaStream extends SRC ? MediaStream | string : string;
            _isResponsibleForElementLifeCycle: boolean;
            _state: number;
            _currentTime: number;
            _startTime: number;
            _stopTime: number;
            _ready: boolean;
            _loadCalled: boolean;
            _stretchPaused: boolean;
            _texture: WebGLTexture;
            _callbacks: Array<{
                    type: string;
                    func: (...args: unknown[]) => void;
            }>;
            _renderPaused: boolean;
            _buffering: boolean;
            isVisible: boolean;
            /**
                * Initialise an instance of a SourceNode.
                * This is the base class for other Nodes which generate media to be passed into the processing pipeline.
                */
            constructor(src: SRC, gl: WebGLRenderingContext, renderGraph: RenderGraph, currentTime: number);
            /**
                * Returns the state of the node.
                * 0 - Waiting, start() has not been called on it yet.
                * 1 - Sequenced, start() has been called but it is not playing yet.
                * 2 - Playing, the node is playing.
                * 3 - Paused, the node is paused.
                * 4 - Ended, playback of the node has finished.
                *
                * @example
                * var ctx = new VideoContext();
                * var videoNode = ctx.createVideoSourceNode('video.mp4');
                * console.log(videoNode.state); //will output 0 (for waiting)
                * videoNode.start(5);
                * console.log(videoNode.state); //will output 1 (for sequenced)
                * videoNode.stop(10);
                * ctx.play();
                * console.log(videoNode.state); //will output 2 (for playing)
                * ctx.paused();
                * console.log(videoNode.state); //will output 3 (for paused)
                */
            get state(): number;
            /**
                * Returns the underlying DOM element which represents this source node.
                * Note: If a source node is created with a url rather than passing in an existing element then this will return undefined until the source node preloads the element.
                *
                * @return {Element} The underlying DOM element representing the media for the node. If the lifecycle of the video is owned UNSIGNED_BYTE the node itself, this can return undefined if the element hasn't been loaded yet.
                *
                * @example
                * //Accessing the Element on a VideoNode created via a URL
                * var ctx = new VideoContext();
                * var videoNode = ctx.createVideoSourceNode('video.mp4');
                * videoNode.start(0);
                * videoNode.stop(5);
                * //When the node starts playing the element should exist so set it's volume to 0
                * videoNode.regsiterCallback("play", function(){videoNode.element.volume = 0;});
                *
                *
                * @example
                * //Accessing the Element on a VideoNode created via an already existing element
                * var ctx = new VideoContext();
                * var videoElement = document.createElement("video");
                * var videoNode = ctx.createVideoSourceNode(videoElement);
                * videoNode.start(0);
                * videoNode.stop(5);
                * //The elemnt can be accessed unknown time because it's lifecycle is managed outside of the VideoContext
                * videoNode.element.volume = 0;
                *
                */
            get element(): Exclude<SRC, string | MediaStream>;
            /**
                * Returns the duration of the node on a timeline. If no start time is set will return undefiend, if no stop time is set will return Infinity.
                *
                * @return {number} The duration of the node in seconds.
                *
                * @example
                * var ctx = new VideoContext();
                * var videoNode = ctx.createVideoSourceNode('video.mp4');
                * videoNode.start(5);
                * videoNode.stop(10);
                * console.log(videoNode.duration); //will output 10
                */
            get duration(): number;
            set stretchPaused(stretchPaused: boolean);
            get stretchPaused(): boolean;
            _load(): void;
            _unload(): void;
            /**
                * Sets the offline status of this node
                * If you want to show the ui too `showMediaOfflineUi` should be called separately
                */
            setMediaOffline(isOffline: boolean): void;
            setShowOfflineUi(showOfflineUi: boolean): void;
            /**
                * Register callbacks against one of these events: "load", "destroy", "seek", "pause", "play", "ended", "durationchange", "loaded", "error"
                *
                * @param {String} type - the type of event to register the callback against.
                * @param {function} func - the function to call.
                *
                * @example
                * var ctx = new VideoContext();
                * var videoNode = ctx.createVideoSourceNode('video.mp4');
                *
                * videoNode.registerCallback("load", function(){"video is loading"});
                * videoNode.registerCallback("play", function(){"video is playing"});
                * videoNode.registerCallback("ended", function(){"video has eneded"});
                *
                */
            registerCallback(type: any, func: any): void;
            /**
                * Remove callback.
                *
                * @param {function} [func] - the callback to remove, if undefined will remove all callbacks for this node.
                *
                * @example
                * var ctx = new VideoContext();
                * var videoNode = ctx.createVideoSourceNode('video.mp4');
                *
                * videoNode.registerCallback("load", function(){"video is loading"});
                * videoNode.registerCallback("play", function(){"video is playing"});
                * videoNode.registerCallback("ended", function(){"video has eneded"});
                * videoNode.unregisterCallback(); //remove all of the three callbacks.
                *
                */
            unregisterCallback(func?: Function): void;
            _triggerCallbacks(type: string, data?: any): void;
            /**
                * Start playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.
                *
                * @param {number} time - the time from the currentTime of the VideoContext which to start playing, if negative will play as soon as possible.
                * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.
                */
            start(time: number): boolean;
            /**
                * Start playback at an absolute time ont the VideoContext's timeline.
                *
                * @param {number} time - the time on the VideoContexts timeline to start playing.
                * @return {boolean} Will return true is seqeuncing has succeded, or false if it is already sequenced.
                */
            startAt(time: number): boolean;
            get startTime(): number;
            /**
                * Stop playback at VideoContext.currentTime plus passed time. If passed time is negative, will play as soon as possible.
                *
                * @param {number} time - the time from the currentTime of the video context which to stop playback.
                * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.
                */
            stop(time: number): boolean;
            /**
                * Stop playback at an absolute time ont the VideoContext's timeline.
                *
                * @param {number} time - the time on the VideoContexts timeline to stop playing.
                * @return {boolean} Will return true is seqeuncing has succeded, or false if the playback has already ended or if start hasn't been called yet, or if time is less than the start time.
                */
            stopAt(time: number): boolean;
            /**
                * Move a media node's place in time without having to create a new one
                * @param startSeconds number The global start seconds
                * @param start number The element's start second (Not used at the source node level)
                * @param duration number The element's duration second
                *
                * This function can be called on MediaNode or SourceNode, where MediaNode is child of SourceNode
                *
                * MediaNode.move - changes the source offset, this is node specific start
                * SourceNode.move - changes the actual startAt and endAt points, this is global start and end
                * On SourceNode, the start is completely ignored
                */
            move(startSeconds: number, _start: number, duration: number): void;
            get stopTime(): number;
            _seek(time: number): void;
            _pause(): void;
            _play(): void;
            _isReady(): boolean;
            /**
                * Load this node's data required for drawing. This should be called
                * by VideoContext
                * @param {number} currentTime
                * @param {number} [timeout=5000]
                */
            preload(_currentTime: number): Promise<void>;
            /**
                * Updates the GL textures for this node according to the current time.
                * @param {number} currentTime
                * @param {boolean} triggerTextureUpdate
                * @returns
                */
            _update(currentTime: number, triggerTextureUpdate?: boolean): void | boolean | Promise<boolean>;
            /**
                * Trigger a texture update on SourceNode
                */
            updateTexture(): void;
            /**
                * Clear unknown timeline state the node currently has, this puts the node in the "waiting" state, as if neither start nor stop had been called.
                */
            clearTimelineState(): void;
            /**
                * Destroy and clean-up the node.
                */
            destroy(): void;
    }
    export { STATE as SOURCENODESTATE };
    export { TYPE as SOURCETYPE };
    export default SourceNode;
}

declare module '@modfy/videocontext/SourceNodes/videonode' {
    import MediaNode from "@modfy/videocontext/SourceNodes/medianode";
    const TYPE = "VideoNode";
    export type VideoSrc = string | HTMLVideoElement | MediaStream;
    class VideoNode extends MediaNode<VideoSrc> {
        /**
          * Initialise an instance of a VideoNode.
          * This should not be called directly, but created through a call to videoContext.createVideoNode();
          */
        constructor(...args: ConstructorParameters<typeof MediaNode>);
    }
    export { TYPE as VIDEOTYPE };
    export default VideoNode;
}

declare module '@modfy/videocontext/graphnode' {
    import DestinationNode from "@modfy/videocontext/DestinationNode/destinationnode";
    import RenderGraph from "@modfy/videocontext/rendergraph";
    const TYPE = "GraphNode";
    class GraphNode {
            _renderGraph: RenderGraph;
            _destroyed: boolean;
            _gl?: WebGLRenderingContext;
            _rendered: boolean;
            _inputNames: string[];
            _limitConnections: boolean;
            _displayName: string;
            isRenderMode: boolean;
            /**
                * Base class from which all processing and source nodes are derived.
                */
            constructor(gl: WebGLRenderingContext, renderGraph: RenderGraph, inputNames: string[], limitConnections?: boolean);
            /**
                * Update gl of graphNode
                * @param gl
                */
            updateGl(gl: WebGLRenderingContext): void;
            /**
                * Get a string representation of the class name.
                *
                * @return String A string of the class name.
                */
            get displayName(): string;
            /**
                * Get the names of the inputs to this node.
                *
                * @return {String[]} An array of the names of the inputs ot the node.
                */
            get inputNames(): string[];
            /**
                * The maximum number of connections that can be made to this node. If there is not limit this will return Infinity.
                *
                * @return {number} The number of connections which can be made to this node.
                */
            get maximumConnections(): number;
            /**
                * Get an array of all the nodes which connect to this node.
                *
                * @return {GraphNode[]} An array of nodes which connect to this node.
                */
            get inputs(): any[];
            /**
                * Get an array of all the nodes which this node outputs to.
                *
                * @return {GraphNode[]} An array of nodes which this node connects to.
                */
            get outputs(): any[];
            /**
                * Get whether the node has been destroyed or not.
                *
                * @return {boolean} A true/false value of whatever the node has been destroyed or not.
                */
            get destroyed(): boolean;
            /**
                * Connect this node to the targetNode
                *
                * @param {GraphNode} targetNode - the node to connect.
                * @param {(number| String)} [targetPort] - the port on the targetNode to connect to, this can be an index, a string identifier, or undefined (in which case the next available port will be connected to).
                *
                */
            connect(targetNode: GraphNode, targetPort?: number | string): boolean;
            /**
                * Disconnect this node from the targetNode. If targetNode is undefined remove all out-bound connections.
                *
                * @param {GraphNode} [targetNode] - the node to disconnect from. If undefined, disconnect from all nodes.
                *
                */
            disconnect(targetNode?: GraphNode): boolean;
            /**
                * Destroy this node, removing it from the graph.
                */
            destroy(): void;
            /**
                * Moves a node zIndex around
                *
                * Here we want a source node to call this with a destination node
                *
                * @param {DestinationNode} destinationNode - the node to connect.
                * @param {(number| string)} [targetPort] - the port on the targetNode to connect to, this can be an index, a string identifier, or undefined (in which case the next available port will be connected to).
                */
            moveZPosition(destinationNode: DestinationNode, targetPort: number | string): void;
    }
    export { TYPE as GRAPHTYPE };
    export default GraphNode;
}

declare module '@modfy/videocontext/MediaErrorTarget' {
    export class MediaErrorTarget extends EventTarget {
        mediaError(url: string): void;
    }
    export class MediaErrorEvent extends Event {
        url: string;
        constructor(url: string);
    }
}

declare module '@modfy/videocontext/rendergraph' {
    import GraphNode from "@modfy/videocontext/graphnode";
    type Connection = {
            source: GraphNode;
            destination: GraphNode;
            type: string;
            zIndex?: number;
            name?: string;
    };
    class RenderGraph {
            connections: Array<Connection>;
            isRenderMode: boolean;
            /**
                * Manages the rendering graph.
                */
            constructor(isRenderMode?: boolean);
            /**
                * Get a list of nodes which are connected to the output of the passed node.
                *
                * @param {GraphNode} node - the node to get the outputs for.
                * @return {GraphNode[]} An array of the nodes which are connected to the output.
                */
            getOutputsForNode(node: GraphNode): any[];
            /**
                * Get a list of nodes which are connected, by input name, to the given node. Array contains objects of the form: {"source":sourceNode, "type":"name", "name":inputName, "destination":destinationNode}.
                *
                * @param {GraphNode} node - the node to get the named inputs for.
                * @return {Object[]} An array of objects representing the nodes and connection type, which are connected to the named inputs for the node.
                */
            getNamedInputsForNode(node: GraphNode): any[];
            /**
                * Get a list of nodes which are connected, by z-index name, to the given node. Array contains objects of the form: {"source":sourceNode, "type":"zIndex", "zIndex":0, "destination":destinationNode}.
                *
                * @param {GraphNode} node - the node to get the z-index referenced inputs for.
                * @return {Object[]} An array of objects representing the nodes and connection type, which are connected by z-Index for the node.
                */
            getZIndexInputsForNode(node: GraphNode): any[];
            /**
                * Get a list of nodes which are connected as inputs to the given node. The length of the return array is always equal to the number of inputs for the node, with undefined taking the place of any inputs not connected.
                *
                * @param {GraphNode} node - the node to get the inputs for.
                * @return {GraphNode[]} An array of GraphNodes which are connected to the node.
                */
            getInputsForNode(node: GraphNode): any[];
            /**
                * Check if a named input on a node is available to connect too.
                * @param {GraphNode} node - the node to check.
                * @param {String} inputName - the named input to check.
                */
            isInputAvailable(node: GraphNode, inputName: string): boolean;
            /**
                * Register a connection between two nodes.
                *
                * @param {GraphNode} sourceNode - the node to connect from.
                * @param {GraphNode} destinationNode - the node to connect to.
                * @param {(String | number)} [target] - the target port of the connection, this could be a string to specfiy a specific named port, a number to specify a port by index, or undefined, in which case the next available port will be connected to.
                * @return {boolean} Will return true if connection succeeds otherwise will throw a ConnectException.
                */
            registerConnection(sourceNode: GraphNode, destinationNode: GraphNode, target?: string | number): boolean;
            /**
                * Remove a connection between two nodes.
                * @param {GraphNode} sourceNode - the node to unregsiter connection from.
                * @param {GraphNode} destinationNode - the node to register connection to.
                * @return {boolean} Will return true if removing connection succeeds, or false if there was no connectionsction to remove.
                */
            unregisterConnection(sourceNode: GraphNode, destinationNode: GraphNode): boolean;
            static outputEdgesFor(node: GraphNode, connections: Connection[]): any[];
            static inputEdgesFor(node: GraphNode, connections: Connection[]): any[];
            static getInputlessNodes(connections: Connection[]): any[];
    }
    export default RenderGraph;
}

declare module '@modfy/videocontext/utils' {
    import SourceNode, { Elements, Sources } from "@modfy/videocontext/SourceNodes/sourcenode";
    export function compileShader(gl: any, shaderSource: any, shaderType: any): any;
    export function createShaderProgram(gl: any, vertexShader: any, fragmentShader: any): any;
    export function createElementTexture(gl?: WebGLRenderingContext): WebGLTexture;
    export function updateTexture(gl: WebGLRenderingContext, texture: WebGLTexture, element: Elements<Sources>): void;
    export function clearTexture(gl?: WebGLRenderingContext, texture: WebGLTexture): void;
    export function generateRandomId(): string;
    export function exportToJSON(vc: any): string;
    export function snapshot(vc: any): {
            nodes: {};
            videoContext: {
                    currentTime: any;
                    duration: any;
                    state: any;
                    playbackRate: any;
            };
    };
    export function createControlFormForNode(node: any, nodeName: any): HTMLDivElement;
    export function visualiseVideoContextGraph(videoContext: any, canvas: any): void;
    export function createSigmaGraphDataFromRenderGraph(videoContext: any): {
            nodes: {
                    id: string;
                    label: string;
                    x: number;
                    y: number;
                    size: number;
                    node: any;
            }[];
            edges: any[];
    };
    export function importSimpleEDL(ctx: any, playlist: any): any;
    export function visualiseVideoContextTimeline(videoContext: any, canvas: any, currentTime: any): void;
    export class UpdateablesManager {
            constructor();
            toggle(shouldUpdate: boolean): void;
            _initWebWorker(): void;
            _lostVisibility(): void;
            _gainedVisibility(): void;
            _init(): void;
            _updateWorkerTime(time: any): void;
            _updateRAFTime(time: any): void;
            _update(dt: any): void;
            setRunning(isRunning: any): void;
            register(updateable: any): void;
    }
    export function mediaElementHasSource({ src, srcObject }: {
            src?: string;
            srcObject?: any;
    }): boolean;
    export function getSourceNodeType(sourceNode: SourceNode): "video" | "audio" | "canvas" | "image" | "unknown";
    /**
        * Calls the provided function for each node that is visible
        * @param {SourceNode[]} sourceNodes
        * @param {number} currentTime
        * @param {VisibilityIterationFn} fn
        */
    export function iterateCurrentNodes(sourceNodes: any, currentTime: any, fn: any): void;
    export function isVisible(node: SourceNode, currentTime: number): any;
}

declare module '@modfy/videocontext/videoelementcache' {
    import { AudioContextWrapper } from "@modfy/videocontext/Audio/AudioContextWrapper";
    import VideoElementCacheItem from "@modfy/videocontext/videoelementcacheitem";
    class VideoElementCache {
            _cacheItems: VideoElementCacheItem[];
            _cacheItemsInitialised: boolean;
            constructor(cache_size?: number, audioCtx?: AudioContextWrapper);
            init(): void;
            /**
                * Find and return an empty initialised element or, if the cache is
                * empty, create a new one.
                *
                * @param {Object} mediaNode A `MediaNode` instance
                */
            getElementAndLinkToNode(mediaNode: any): HTMLVideoElement;
            /**
                * Unlink any media node currently linked to a cached video element.
                *
                * @param {VideoElement} element The element to unlink from any media nodes
                */
            unlinkNodeFromElement(element: any): void;
            get length(): number;
            get unused(): number;
    }
    export default VideoElementCache;
}

declare module '@modfy/videocontext/types' {
    export type AudioDestinationNode = {
        connect: AudioNode["connect"];
        disconnect: AudioNode["disconnect"];
    };
    export type MediaNodeAudioOptions = {
        gain: number;
    };
}

declare module '@modfy/videocontext/Audio/MediaAudioAdapter' {
    import { MediaNodeAudioOptions } from "@modfy/videocontext/types";
    import { AudioContextWrapper } from "@modfy/videocontext/Audio/AudioContextWrapper";
    export class MediaAudioAdapter {
        ctx: AudioContextWrapper;
        gain: number;
        mediaElementSourceNode?: MediaElementAudioSourceNode;
        gainNode?: GainNode;
        attached: boolean;
        constructor(ctx: AudioContextWrapper, { gain }: MediaNodeAudioOptions);
        setGain(gain: number): void;
        attachSource(mediaElement: HTMLMediaElement): void;
        detachSource(): void;
        destroy(): void;
    }
}

declare module '@modfy/videocontext/videoelementcacheitem' {
    import { AudioContextWrapper } from "@modfy/videocontext/Audio/AudioContextWrapper";
    import SourceNode from "@modfy/videocontext/SourceNodes/sourcenode";
    /**
      * A video element item created and managed by the `VideoElementCache`.
      *
      * This creates and stores a `<video />` element, which is assigned
      * to a `MediaNode` by the `VideoElementCache` for playback. Once
      * playback has completed the `MediaNode` association will be removed
      * and potentially replaced with another.
      */
    class VideoElementCacheItem {
        _element: HTMLVideoElement;
        _node?: SourceNode<any>;
        audioCtx?: AudioContextWrapper;
        mediaElementSourceNode?: MediaElementAudioSourceNode;
        gainNode?: GainNode;
        constructor(node?: SourceNode<any>, audioCtx?: AudioContextWrapper);
        _createElement(): HTMLVideoElement;
        get element(): HTMLVideoElement;
        set element(element: HTMLVideoElement);
        linkNode(node: any): void;
        unlinkNode(): void;
        isPlaying(): boolean;
    }
    export default VideoElementCacheItem;
}

