figma-api-stub
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -88,2 +88,9 @@ "use strict"; | ||
applyMixins_1.applyMixins(RectangleNodeStub, [BaseNodeMixinStub, LayoutMixinStub]); | ||
var TextNodeStub = /** @class */ (function () { | ||
function TextNodeStub() { | ||
this.type = "TEXT"; | ||
} | ||
return TextNodeStub; | ||
}()); | ||
applyMixins_1.applyMixins(TextNodeStub, [BaseNodeMixinStub, LayoutMixinStub]); | ||
var DocumentNodeStub = /** @class */ (function () { | ||
@@ -96,2 +103,30 @@ function DocumentNodeStub() { | ||
applyMixins_1.applyMixins(DocumentNodeStub, [BaseNodeMixinStub, ChildrenMixinStub]); | ||
var PageNodeStub = /** @class */ (function () { | ||
function PageNodeStub() { | ||
this.type = "PAGE"; | ||
} | ||
return PageNodeStub; | ||
}()); | ||
applyMixins_1.applyMixins(PageNodeStub, [BaseNodeMixinStub, ChildrenMixinStub]); | ||
var FrameNodeStub = /** @class */ (function () { | ||
function FrameNodeStub() { | ||
this.type = "FRAME"; | ||
} | ||
return FrameNodeStub; | ||
}()); | ||
applyMixins_1.applyMixins(FrameNodeStub, [BaseNodeMixinStub, ChildrenMixinStub]); | ||
var GroupNodeStub = /** @class */ (function () { | ||
function GroupNodeStub() { | ||
this.type = "GROUP"; | ||
} | ||
return GroupNodeStub; | ||
}()); | ||
applyMixins_1.applyMixins(GroupNodeStub, [BaseNodeMixinStub, ChildrenMixinStub]); | ||
var ComponentNodeStub = /** @class */ (function () { | ||
function ComponentNodeStub() { | ||
this.type = "COMPONENT"; | ||
} | ||
return ComponentNodeStub; | ||
}()); | ||
applyMixins_1.applyMixins(ComponentNodeStub, [BaseNodeMixinStub, ChildrenMixinStub]); | ||
exports.createFigma = function () { return ({ | ||
@@ -101,4 +136,24 @@ // @ts-ignore | ||
// @ts-ignore | ||
createRectangle: function () { return new RectangleNodeStub(); } | ||
createPage: function () { return new PageNodeStub(); }, | ||
// @ts-ignore | ||
createFrame: function () { return new FrameNodeStub(); }, | ||
// @ts-ignore | ||
createComponent: function () { return new ComponentNodeStub(); }, | ||
// @ts-ignore | ||
createRectangle: function () { return new RectangleNodeStub(); }, | ||
// @ts-ignore | ||
createText: function () { return new TextNodeStub(); }, | ||
// @ts-ignore | ||
group: function (nodes, parent, index) { | ||
var group = new GroupNodeStub(); | ||
nodes.forEach(function (node) { return group.appendChild(node); }); | ||
if (index) { | ||
parent.insertChild(index, group); | ||
} | ||
else { | ||
parent.appendChild(group); | ||
} | ||
return group; | ||
} | ||
}); }; | ||
//# sourceMappingURL=stubs.js.map |
{ | ||
"name": "figma-api-stub", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Figma API stub", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
# Figma API Stub | ||
[![npm version](https://img.shields.io/npm/v/figma-api-stub.svg)](https://www.npmjs.com/package/figma-api-stub) | ||
Stub implementation of [Figma Plugins API](https://www.figma.com/plugin-docs/intro/). | ||
@@ -4,0 +6,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28831
729
36