Skip to content

Instantly share code, notes, and snippets.

import { emit, on, once } from "@create-figma-plugin/utilities"
export type AsyncActionType<F extends (...args: any) => any> = F
export type SyncActionType<F extends (...args: any) => any> = (
...args: Parameters<F>
) => Promise<ReturnType<F>>
let lastCallerId = 0
let lastSubscriptionId = 0
const subscriptions = new Map<string, Function[]>()
@yagudaev
yagudaev / setPropertyFill.test.ts
Created August 9, 2022 21:48
Figma convert `gradientHandlePositions` to `transformGradient` and vice-versa
import {
convertGradientHandlesToTransform,
convertTransformToGradientHandles
} from "./setPropertyFill"
describe("convertGradientHandlesToTransform", () => {
it("identity matrix", () => {
expect(
convertGradientHandlesToTransform([
{