Pixso Open Documentation
guide
  • 中文
  • English
guide
  • 中文
  • English
  • Plugin API

    • Introduction
    • Prerequisites
    • manifest
    • Development Guide
    • Change Log
    • Plugin API Documentation

      • Overview
      • Global Object

        • pixso
        • pixso.ui
        • pixso.host
        • pixso.mouse
        • pixso.editor
        • pixso.codegen
        • pixso.keyboard
        • pixso.fieldset
        • pixso.viewport
        • pixso.vectorEditor
        • pixso.clientStorage
        • pixso.serverStorage
      • Node Types

        • BooleanOperationNode
        • ComponentNode
        • ComponentSetNode
        • DocumentNode
        • EllipseNode
        • FolderNode
        • FrameNode
        • GroupNode
        • InstanceNode
        • LineNode
        • PageNode
        • PolygonNode
        • RectangleNode
        • SectionNode
        • SliceNode
        • StarNode
        • TextNode
        • VectorNode
      • Data Types

        • Action
        • ArcData
        • BlendMode
        • CommandItem
        • ComponentProperties-Related
        • Constraints
        • DialogType
        • DocumentationLink
        • Effect
        • EmbedData
        • ExportSettings
        • FontName
        • Guide
        • HandleMirroring
        • HyperlinkTarget
        • Image
        • LayoutGrid
        • LetterSpacing
        • Library
        • LineHeight
        • NodeChangeProperty
        • OverflowDirection
        • Overlay
        • Paint
        • PublishStatus
        • Reaction
        • Rect-related
        • RGB & RGBA
        • StrokeCap
        • StrokeJoin
        • StyleChangeProperty
        • TextCase
        • TextDecoration
        • TextListOptions
        • ThemeType
        • ToolType
        • Transition
        • Trigger
        • Vector
    • Host API Documentation

      • Overview
      • Host API
  • Open API

    • OpenAPI Doc

pixso.serverStorage

The pixso.serverStorage API records the user's Settings on the plugin. As long as the user uses a certain account to open the design file in different files and different projects, when using the plugin, the value of the preference item is the value set by him.

The data stored by pixso.serverStorage is differentiated according to the plugin Id, so the current plugin cannot read the configuration data stored by other plug-ins.

pixso.serverStorage API read and write delete operations are asynchronous, there are getAsync, setAsync, deleteAsync three methods.

getAsync

  • Type: getAsync(key?: string): Promise<any | undefined>
  • Tip: Cross-thread Communication

key key is an optional parameter. If no key is passed, all the information configured by the user under the plugin is retrieved from the serverStorage storage (if the user did not do any configuration of the plugin, asynchronously return {}); If the key key is passed, the corresponding configuration item content is retrieved according to the key key (if the key does not store any value, the asynchronous return undefined).

setAsync

  • Type: setAsync(key: string, value: string): Promise<void>
  • Tip: Cross-thread Communication

Store a value to a key in serverStorage, asynchronously return the plugin's latest configuration when the storage is successful, otherwise reject()

deleteAsync

  • Type: deleteAsync(key?: string): Promise<void>
  • Tip: Cross-thread Communication

key key is an optional parameter. If no key is passed, all configuration information of the plugin is deleted. If passed, key key deletes the key value pair stored in serverStorage according to the key key.

Prev
pixso.clientStorage