Socket
Socket
Sign inDemoInstall

@types/cytoscape-canvas

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/cytoscape-canvas

TypeScript definitions for cytoscape-canvas


Version published
Weekly downloads
5.3K
decreased by-10.3%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/cytoscape-canvas

Summary

This package contains type definitions for cytoscape-canvas (https://github.com/classcraft/cytoscape.js-canvas).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cytoscape-canvas.

index.d.ts

import cytoscape = require("cytoscape");

declare const cyCanvas: cytoscape.Ext;

export = cyCanvas;
export as namespace cyCanvas;

declare namespace cyCanvas {
    interface Options {
        /**
         * The z-index of the canvas.
         */
        zIndex?: number;
        /**
         * The pixel ratio of the canvas.
         */
        pixelRatio?: number;
    }

    interface CanvasInstance {
        /**
         * Return the generated canvas.
         */
        getCanvas: () => HTMLCanvasElement;

        /**
         * Set the context transform to match Cytoscape's zoom & pan.
         * Further drawing will be on model position.
         * @param ctx The canvas context.
         */
        setTransform: (ctx: CanvasRenderingContext2D) => void;

        /**
         * Reset the context transform.
         * Further drawing will be on rendered position.
         * @param ctx The canvas context.
         */
        resetTransform: (ctx: CanvasRenderingContext2D) => void;

        /**
         * Clear the entire canvas.
         * @param ctx The canvas context.
         */
        clear: (ctx: CanvasRenderingContext2D) => void;
    }
}

declare global {
    namespace cytoscape {
        interface Core {
            /*
             * Initialize the canvas according to the given options.
             */
            cyCanvas: (options?: cyCanvas.Options) => cyCanvas.CanvasInstance;
        }
    }
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: @types/cytoscape

Credits

These definitions were written by Musa.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc