PluginAPI constructor
PluginAPI({
- String? apiVersion,
- String? command,
- EditorType? editorType,
- Mode? mode,
- String? pluginId,
- String? widgetId,
- String? fileKey,
- bool? skipInvisibleInstanceChildren,
- TimerAPI? timer,
- ViewportAPI? viewport,
- User? currentUser,
- List<
ActiveUser> ? activeUsers, - TextReviewAPI? textreview,
- CodegenAPI? codegen,
- VSCodeAPI? vscode,
- DevResourcesAPI? devResources,
- PaymentsAPI? payments,
- Uiapi? ui,
- UtilAPI? util,
- ConstantsAPI? constants,
- ClientStorageAPI? clientStorage,
- ParametersAPI? parameters,
- VariablesAPI? variables,
- TeamLibraryAPI? teamLibrary,
- AnnotationsAPI? annotations,
- DocumentNode? root,
- PageNode? currentPage,
- Symbol? mixed,
- bool? hasMissingFont,
- void closePlugin([])?,
- NotificationHandler notify(])?,
- void commitUndo()?,
- void triggerUndo()?,
- Future<
VersionHistoryResult> saveVersionHistoryAsync(])?, - void openExternal()?,
- void showUI(
- String, [
- ShowUIOptions?
- Future<
Object?> getNodeByIdAsync()?, - Object? getNodeById()?,
- Future<
BaseStyle?> getStyleByIdAsync()?, - BaseStyle? getStyleById()?,
- Future<
void> setCurrentPageAsync()?, - RectangleNode createRectangle()?,
- LineNode createLine()?,
- EllipseNode createEllipse()?,
- PolygonNode createPolygon()?,
- StarNode createStar()?,
- VectorNode createVector()?,
- TextNode createText()?,
- FrameNode createFrame()?,
- ComponentNode createComponent()?,
- ComponentNode createComponentFromNode()?,
- PageNode createPage()?,
- PageNode createPageDivider([])?,
- SliceNode createSlice()?,
- SlideNode createSlide([])?,
- SlideRowNode createSlideRow([
- num?
- StickyNode createSticky()?,
- ConnectorNode createConnector()?,
- ShapeWithTextNode createShapeWithText()?,
- CodeBlockNode createCodeBlock()?,
- SectionNode createSection()?,
- TableNode createTable([])?,
- Future<
SceneNode> createNodeFromJSXAsync([- dynamic
- BooleanOperationNode createBooleanOperation()?,
- PaintStyle createPaintStyle()?,
- TextStyle createTextStyle()?,
- EffectStyle createEffectStyle()?,
- GridStyle createGridStyle()?,
- Future<
List< getLocalPaintStylesAsync()?,PaintStyle> > - List<
PaintStyle> getLocalPaintStyles()?, - Future<
List< getLocalTextStylesAsync()?,TextStyle> > - List<
TextStyle> getLocalTextStyles()?, - Future<
List< getLocalEffectStylesAsync()?,EffectStyle> > - List<
EffectStyle> getLocalEffectStyles()?, - Future<
List< getLocalGridStylesAsync()?,GridStyle> > - List<
GridStyle> getLocalGridStyles()?, - dynamic getSelectionColors()?,
- void moveLocalPaintStyleAfter(
- PaintStyle, [
- PaintStyle?
- void moveLocalTextStyleAfter(])?,
- void moveLocalEffectStyleAfter(])?,
- void moveLocalGridStyleAfter(])?,
- void moveLocalPaintFolderAfter(])?,
- void moveLocalTextFolderAfter(])?,
- void moveLocalEffectFolderAfter(])?,
- void moveLocalGridFolderAfter(])?,
- Future<
ComponentNode> importComponentByKeyAsync()?, - Future<
ComponentSetNode> importComponentSetByKeyAsync()?, - Future<
BaseStyle> importStyleByKeyAsync()?, - Future<
List< listAvailableFontsAsync()?,Font> > - Future<
void> loadFontAsync()?, - FrameNode createNodeFromSvg()?,
- Image createImage()?,
- Future<
Image> createImageAsync()?, - Image? getImageByHash()?,
- Future<
Video> createVideoAsync()?, - Future<
OpaqueNodeMixin> createLinkPreviewAsync()?, - MediaNode createGif()?,
- ComponentSetNode combineAsVariants(
- ReadonlyArray<
ComponentNode> , - Object, [
- num?
- ReadonlyArray<
- GroupNode group(
- ReadonlyArray<
Object> , - Object, [
- num?
- ReadonlyArray<
- VectorNode flatten(
- ReadonlyArray<
Object> , [ - Object?,
- num?
- ReadonlyArray<
- BooleanOperationNode union(
- ReadonlyArray<
Object> , - Object, [
- num?
- ReadonlyArray<
- BooleanOperationNode subtract(
- ReadonlyArray<
Object> , - Object, [
- num?
- ReadonlyArray<
- BooleanOperationNode intersect(
- ReadonlyArray<
Object> , - Object, [
- num?
- ReadonlyArray<
- BooleanOperationNode exclude(
- ReadonlyArray<
Object> , - Object, [
- num?
- ReadonlyArray<
- Array<
SceneNode> ungroup()?, - String base64Encode()?,
- Uint8List base64Decode()?,
- Future<
BaseNodeMixin?> getFileThumbnailNodeAsync()?, - BaseNodeMixin? getFileThumbnailNode()?,
- Future<
void> setFileThumbnailNodeAsync([])?, - Future<
void> loadAllPagesAsync()?, - Array<
Array< getSlideGrid()?,SlideNode> > - void setSlideGrid()?,
Implementation
factory PluginAPI({
_i2.String? apiVersion,
_i2.String? command,
_i3.EditorType? editorType,
_i3.Mode? mode,
_i2.String? pluginId,
_i2.String? widgetId,
_i2.String? fileKey,
_i2.bool? skipInvisibleInstanceChildren,
_i3.TimerAPI? timer,
_i3.ViewportAPI? viewport,
_i3.User? currentUser,
_i2.List<_i3.ActiveUser>? activeUsers,
_i3.TextReviewAPI? textreview,
_i3.CodegenAPI? codegen,
_i3.VSCodeAPI? vscode,
_i3.DevResourcesAPI? devResources,
_i3.PaymentsAPI? payments,
_i3.Uiapi? ui,
_i3.UtilAPI? util,
_i3.ConstantsAPI? constants,
_i3.ClientStorageAPI? clientStorage,
_i3.ParametersAPI? parameters,
_i3.VariablesAPI? variables,
_i3.TeamLibraryAPI? teamLibrary,
_i3.AnnotationsAPI? annotations,
_i3.DocumentNode? root,
_i3.PageNode? currentPage,
_i2.Symbol? mixed,
_i2.bool? hasMissingFont,
void Function([_i2.String?])? closePlugin,
_i3.NotificationHandler Function(
_i2.String, [
_i3.NotificationOptions?,
])? notify,
void Function()? commitUndo,
void Function()? triggerUndo,
_i2.Future<_i3.VersionHistoryResult> Function(
_i2.String, [
_i2.String?,
])? saveVersionHistoryAsync,
void Function(_i2.String)? openExternal,
void Function(
_i2.String, [
_i3.ShowUIOptions?,
])? showUI,
_i2.Future<_i2.Object?> Function(_i2.String)? getNodeByIdAsync,
_i2.Object? Function(_i2.String)? getNodeById,
_i2.Future<_i3.BaseStyle?> Function(_i2.String)? getStyleByIdAsync,
_i3.BaseStyle? Function(_i2.String)? getStyleById,
_i2.Future<void> Function(_i3.PageNode)? setCurrentPageAsync,
_i3.RectangleNode Function()? createRectangle,
_i3.LineNode Function()? createLine,
_i3.EllipseNode Function()? createEllipse,
_i3.PolygonNode Function()? createPolygon,
_i3.StarNode Function()? createStar,
_i3.VectorNode Function()? createVector,
_i3.TextNode Function()? createText,
_i3.FrameNode Function()? createFrame,
_i3.ComponentNode Function()? createComponent,
_i3.ComponentNode Function(_i3.SceneNode)? createComponentFromNode,
_i3.PageNode Function()? createPage,
_i3.PageNode Function([_i2.String?])? createPageDivider,
_i3.SliceNode Function()? createSlice,
_i3.SlideNode Function([
_i2.num?,
_i2.num?,
])? createSlide,
_i3.SlideRowNode Function([_i2.num?])? createSlideRow,
_i3.StickyNode Function()? createSticky,
_i3.ConnectorNode Function()? createConnector,
_i3.ShapeWithTextNode Function()? createShapeWithText,
_i3.CodeBlockNode Function()? createCodeBlock,
_i3.SectionNode Function()? createSection,
_i3.TableNode Function([
_i2.num?,
_i2.num?,
])? createTable,
_i2.Future<_i3.SceneNode> Function([_i2.dynamic])? createNodeFromJSXAsync,
_i3.BooleanOperationNode Function()? createBooleanOperation,
_i3.PaintStyle Function()? createPaintStyle,
_i3.TextStyle Function()? createTextStyle,
_i3.EffectStyle Function()? createEffectStyle,
_i3.GridStyle Function()? createGridStyle,
_i2.Future<_i2.List<_i3.PaintStyle>> Function()? getLocalPaintStylesAsync,
_i2.List<_i3.PaintStyle> Function()? getLocalPaintStyles,
_i2.Future<_i2.List<_i3.TextStyle>> Function()? getLocalTextStylesAsync,
_i2.List<_i3.TextStyle> Function()? getLocalTextStyles,
_i2.Future<_i2.List<_i3.EffectStyle>> Function()? getLocalEffectStylesAsync,
_i2.List<_i3.EffectStyle> Function()? getLocalEffectStyles,
_i2.Future<_i2.List<_i3.GridStyle>> Function()? getLocalGridStylesAsync,
_i2.List<_i3.GridStyle> Function()? getLocalGridStyles,
_i2.dynamic Function()? getSelectionColors,
void Function(
_i3.PaintStyle, [
_i3.PaintStyle?,
])? moveLocalPaintStyleAfter,
void Function(
_i3.TextStyle, [
_i3.TextStyle?,
])? moveLocalTextStyleAfter,
void Function(
_i3.EffectStyle, [
_i3.EffectStyle?,
])? moveLocalEffectStyleAfter,
void Function(
_i3.GridStyle, [
_i3.GridStyle?,
])? moveLocalGridStyleAfter,
void Function(
_i2.String, [
_i2.String?,
])? moveLocalPaintFolderAfter,
void Function(
_i2.String, [
_i2.String?,
])? moveLocalTextFolderAfter,
void Function(
_i2.String, [
_i2.String?,
])? moveLocalEffectFolderAfter,
void Function(
_i2.String, [
_i2.String?,
])? moveLocalGridFolderAfter,
_i2.Future<_i3.ComponentNode> Function(_i2.String)?
importComponentByKeyAsync,
_i2.Future<_i3.ComponentSetNode> Function(_i2.String)?
importComponentSetByKeyAsync,
_i2.Future<_i3.BaseStyle> Function(_i2.String)? importStyleByKeyAsync,
_i2.Future<_i2.List<_i3.Font>> Function()? listAvailableFontsAsync,
_i2.Future<void> Function(_i3.FontName)? loadFontAsync,
_i3.FrameNode Function(_i2.String)? createNodeFromSvg,
_i3.Image Function(_i6.Uint8List)? createImage,
_i2.Future<_i3.Image> Function(_i2.String)? createImageAsync,
_i3.Image? Function(_i2.String)? getImageByHash,
_i2.Future<_i3.Video> Function(_i6.Uint8List)? createVideoAsync,
_i2.Future<_i3.OpaqueNodeMixin> Function(_i2.String)?
createLinkPreviewAsync,
_i3.MediaNode Function(_i2.String)? createGif,
_i3.ComponentSetNode Function(
_i4.ReadonlyArray<_i3.ComponentNode>,
_i2.Object, [
_i2.num?,
])? combineAsVariants,
_i3.GroupNode Function(
_i4.ReadonlyArray<_i2.Object>,
_i2.Object, [
_i2.num?,
])? group,
_i3.VectorNode Function(
_i4.ReadonlyArray<_i2.Object>, [
_i2.Object?,
_i2.num?,
])? flatten,
_i3.BooleanOperationNode Function(
_i4.ReadonlyArray<_i2.Object>,
_i2.Object, [
_i2.num?,
])? union,
_i3.BooleanOperationNode Function(
_i4.ReadonlyArray<_i2.Object>,
_i2.Object, [
_i2.num?,
])? subtract,
_i3.BooleanOperationNode Function(
_i4.ReadonlyArray<_i2.Object>,
_i2.Object, [
_i2.num?,
])? intersect,
_i3.BooleanOperationNode Function(
_i4.ReadonlyArray<_i2.Object>,
_i2.Object, [
_i2.num?,
])? exclude,
_i4.Array<_i3.SceneNode> Function(_i2.Object)? ungroup,
_i2.String Function(_i6.Uint8List)? base64Encode,
_i6.Uint8List Function(_i2.String)? base64Decode,
_i2.Future<_i3.BaseNodeMixin?> Function()? getFileThumbnailNodeAsync,
_i3.BaseNodeMixin? Function()? getFileThumbnailNode,
_i2.Future<void> Function([_i3.BaseNodeMixin?])? setFileThumbnailNodeAsync,
_i2.Future<void> Function()? loadAllPagesAsync,
_i4.Array<_i4.Array<_i3.SlideNode>> Function()? getSlideGrid,
void Function(_i4.Array<_i4.Array<_i3.SlideNode>>)? setSlideGrid,
}) =>
PluginAPI._(
apiVersion: apiVersion,
command: command,
editorType: editorType?.name ?? _i7.undefined,
mode: mode?.name ?? _i7.undefined,
pluginId: pluginId,
widgetId: widgetId,
fileKey: fileKey ?? _i7.undefined,
skipInvisibleInstanceChildren: skipInvisibleInstanceChildren,
timer: timer ?? _i7.undefined,
viewport: viewport ?? _i7.undefined,
currentUser: currentUser ?? _i7.undefined,
activeUsers: activeUsers,
textreview: textreview ?? _i7.undefined,
codegen: codegen ?? _i7.undefined,
vscode: vscode ?? _i7.undefined,
devResources: devResources ?? _i7.undefined,
payments: payments ?? _i7.undefined,
ui: ui ?? _i7.undefined,
util: util ?? _i7.undefined,
constants: constants ?? _i7.undefined,
clientStorage: clientStorage ?? _i7.undefined,
parameters: parameters ?? _i7.undefined,
variables: variables ?? _i7.undefined,
teamLibrary: teamLibrary ?? _i7.undefined,
annotations: annotations ?? _i7.undefined,
root: root ?? _i7.undefined,
currentPage: currentPage ?? _i7.undefined,
mixed: mixed ?? _i7.undefined,
hasMissingFont: hasMissingFont,
closePlugin: closePlugin == null ? null : _i5.allowInterop(closePlugin),
notify: notify == null ? null : _i5.allowInterop(notify),
commitUndo: commitUndo == null ? null : _i5.allowInterop(commitUndo),
triggerUndo: triggerUndo == null ? null : _i5.allowInterop(triggerUndo),
saveVersionHistoryAsync: saveVersionHistoryAsync == null
? null
: _i5.allowInterop(saveVersionHistoryAsync),
openExternal:
openExternal == null ? null : _i5.allowInterop(openExternal),
showUI: showUI == null ? null : _i5.allowInterop(showUI),
getNodeByIdAsync: getNodeByIdAsync == null
? null
: _i5.allowInterop(getNodeByIdAsync),
getNodeById: getNodeById == null
? null
: _i5.allowInterop((p0) =>
() => getNodeById(p0) ?? _i7.undefined ?? _i7.undefined),
getStyleByIdAsync: getStyleByIdAsync == null
? null
: _i5.allowInterop(getStyleByIdAsync),
getStyleById: getStyleById == null
? null
: _i5.allowInterop((p0) =>
() => getStyleById(p0) ?? _i7.undefined ?? _i7.undefined),
setCurrentPageAsync: setCurrentPageAsync == null
? null
: _i5.allowInterop(setCurrentPageAsync),
createRectangle:
createRectangle == null ? null : _i5.allowInterop(createRectangle),
createLine: createLine == null ? null : _i5.allowInterop(createLine),
createEllipse:
createEllipse == null ? null : _i5.allowInterop(createEllipse),
createPolygon:
createPolygon == null ? null : _i5.allowInterop(createPolygon),
createStar: createStar == null ? null : _i5.allowInterop(createStar),
createVector:
createVector == null ? null : _i5.allowInterop(createVector),
createText: createText == null ? null : _i5.allowInterop(createText),
createFrame: createFrame == null ? null : _i5.allowInterop(createFrame),
createComponent:
createComponent == null ? null : _i5.allowInterop(createComponent),
createComponentFromNode: createComponentFromNode == null
? null
: _i5.allowInterop(createComponentFromNode),
createPage: createPage == null ? null : _i5.allowInterop(createPage),
createPageDivider: createPageDivider == null
? null
: _i5.allowInterop(createPageDivider),
createSlice: createSlice == null ? null : _i5.allowInterop(createSlice),
createSlide: createSlide == null ? null : _i5.allowInterop(createSlide),
createSlideRow:
createSlideRow == null ? null : _i5.allowInterop(createSlideRow),
createSticky:
createSticky == null ? null : _i5.allowInterop(createSticky),
createConnector:
createConnector == null ? null : _i5.allowInterop(createConnector),
createShapeWithText: createShapeWithText == null
? null
: _i5.allowInterop(createShapeWithText),
createCodeBlock:
createCodeBlock == null ? null : _i5.allowInterop(createCodeBlock),
createSection:
createSection == null ? null : _i5.allowInterop(createSection),
createTable: createTable == null ? null : _i5.allowInterop(createTable),
createNodeFromJSXAsync: createNodeFromJSXAsync == null
? null
: _i5.allowInterop(createNodeFromJSXAsync),
createBooleanOperation: createBooleanOperation == null
? null
: _i5.allowInterop(createBooleanOperation),
createPaintStyle: createPaintStyle == null
? null
: _i5.allowInterop(createPaintStyle),
createTextStyle:
createTextStyle == null ? null : _i5.allowInterop(createTextStyle),
createEffectStyle: createEffectStyle == null
? null
: _i5.allowInterop(createEffectStyle),
createGridStyle:
createGridStyle == null ? null : _i5.allowInterop(createGridStyle),
getLocalPaintStylesAsync: getLocalPaintStylesAsync == null
? null
: _i5.allowInterop(getLocalPaintStylesAsync),
getLocalPaintStyles: getLocalPaintStyles == null
? null
: _i5.allowInterop(getLocalPaintStyles),
getLocalTextStylesAsync: getLocalTextStylesAsync == null
? null
: _i5.allowInterop(getLocalTextStylesAsync),
getLocalTextStyles: getLocalTextStyles == null
? null
: _i5.allowInterop(getLocalTextStyles),
getLocalEffectStylesAsync: getLocalEffectStylesAsync == null
? null
: _i5.allowInterop(getLocalEffectStylesAsync),
getLocalEffectStyles: getLocalEffectStyles == null
? null
: _i5.allowInterop(getLocalEffectStyles),
getLocalGridStylesAsync: getLocalGridStylesAsync == null
? null
: _i5.allowInterop(getLocalGridStylesAsync),
getLocalGridStyles: getLocalGridStyles == null
? null
: _i5.allowInterop(getLocalGridStyles),
getSelectionColors: getSelectionColors == null
? null
: _i5.allowInterop(
() => () => getSelectionColors() ?? _i7.undefined),
moveLocalPaintStyleAfter: moveLocalPaintStyleAfter == null
? null
: _i5.allowInterop(moveLocalPaintStyleAfter),
moveLocalTextStyleAfter: moveLocalTextStyleAfter == null
? null
: _i5.allowInterop(moveLocalTextStyleAfter),
moveLocalEffectStyleAfter: moveLocalEffectStyleAfter == null
? null
: _i5.allowInterop(moveLocalEffectStyleAfter),
moveLocalGridStyleAfter: moveLocalGridStyleAfter == null
? null
: _i5.allowInterop(moveLocalGridStyleAfter),
moveLocalPaintFolderAfter: moveLocalPaintFolderAfter == null
? null
: _i5.allowInterop(moveLocalPaintFolderAfter),
moveLocalTextFolderAfter: moveLocalTextFolderAfter == null
? null
: _i5.allowInterop(moveLocalTextFolderAfter),
moveLocalEffectFolderAfter: moveLocalEffectFolderAfter == null
? null
: _i5.allowInterop(moveLocalEffectFolderAfter),
moveLocalGridFolderAfter: moveLocalGridFolderAfter == null
? null
: _i5.allowInterop(moveLocalGridFolderAfter),
importComponentByKeyAsync: importComponentByKeyAsync == null
? null
: _i5.allowInterop(importComponentByKeyAsync),
importComponentSetByKeyAsync: importComponentSetByKeyAsync == null
? null
: _i5.allowInterop(importComponentSetByKeyAsync),
importStyleByKeyAsync: importStyleByKeyAsync == null
? null
: _i5.allowInterop(importStyleByKeyAsync),
listAvailableFontsAsync: listAvailableFontsAsync == null
? null
: _i5.allowInterop(listAvailableFontsAsync),
loadFontAsync:
loadFontAsync == null ? null : _i5.allowInterop(loadFontAsync),
createNodeFromSvg: createNodeFromSvg == null
? null
: _i5.allowInterop(createNodeFromSvg),
createImage: createImage == null ? null : _i5.allowInterop(createImage),
createImageAsync: createImageAsync == null
? null
: _i5.allowInterop(createImageAsync),
getImageByHash: getImageByHash == null
? null
: _i5.allowInterop(
(p0) => () => getImageByHash(p0) ?? _i7.undefined),
createVideoAsync: createVideoAsync == null
? null
: _i5.allowInterop(createVideoAsync),
createLinkPreviewAsync: createLinkPreviewAsync == null
? null
: _i5.allowInterop(createLinkPreviewAsync),
createGif: createGif == null ? null : _i5.allowInterop(createGif),
combineAsVariants: combineAsVariants == null
? null
: _i5.allowInterop(combineAsVariants),
group: group == null ? null : _i5.allowInterop(group),
flatten: flatten == null ? null : _i5.allowInterop(flatten),
union: union == null ? null : _i5.allowInterop(union),
subtract: subtract == null ? null : _i5.allowInterop(subtract),
intersect: intersect == null ? null : _i5.allowInterop(intersect),
exclude: exclude == null ? null : _i5.allowInterop(exclude),
ungroup: ungroup == null ? null : _i5.allowInterop(ungroup),
base64Encode:
base64Encode == null ? null : _i5.allowInterop(base64Encode),
base64Decode:
base64Decode == null ? null : _i5.allowInterop(base64Decode),
getFileThumbnailNodeAsync: getFileThumbnailNodeAsync == null
? null
: _i5.allowInterop(getFileThumbnailNodeAsync),
getFileThumbnailNode: getFileThumbnailNode == null
? null
: _i5.allowInterop(
() => () => getFileThumbnailNode() ?? _i7.undefined),
setFileThumbnailNodeAsync: setFileThumbnailNodeAsync == null
? null
: _i5.allowInterop(setFileThumbnailNodeAsync),
loadAllPagesAsync: loadAllPagesAsync == null
? null
: _i5.allowInterop(loadAllPagesAsync),
getSlideGrid:
getSlideGrid == null ? null : _i5.allowInterop(getSlideGrid),
setSlideGrid:
setSlideGrid == null ? null : _i5.allowInterop(setSlideGrid),
);