New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

drah-figma

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drah-figma

Simplified communications between ui and main for figma plugins

  • 0.4.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

drah-figma

Simplified communications between ui and main for figma plugin development.

Example usage

// ./main/drahMain.ts
import { setupDrahMain } from "drah-figma/main"
import type { UIActions } from "../ui/drahUI"

const _mainActions = {
    setRootPluginData: (...parameters: Parameters<typeof figma.root.setPluginData>) =>
        figma.root.setPluginData(...parameters),
    getRootPluginData: (...parameters: Parameters<typeof figma.root.getPluginData>) =>
        figma.root.getPluginData(...parameters),
}

export const drahMain = setupDrahMain<UIActions>(_mainActions);
export type MainActions = typeof _mainActions

// ./main/index.ts
import { drahMain } from "./drahMain.ts"

const googleHtml = await drahMain.getGoogleHtml()

// ./ui/drahUI.ts
import { setupDrahUI } from "drah-figma/ui"
import type { MainActions } from "../main/drahMain.ts"

const _uiActions = {
    getGoogleHtml: async () => {
        const response = await fetch("http://google.com")
        const responseText = await response.text()
    }
}

export const drahUI = setupDrahUI<MainActions>(_uiActions);
export type UIActions = typeof _uiActions

// ./ui/index.ts
import { drahUI } from "./drahUI.ts"

await drahUI.setRootPluginData("test", "data")
await drahUI.getRootPluginData("test")

FAQs

Package last updated on 06 Apr 2021

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc