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

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

      • Overview
      • Global Object

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

        • BooleanOperationNode
        • ComponentNode
        • ComponentSetNode
        • DocumentNode
        • EllipseNode
        • 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 plug-in. As long as the user uses a certain account to open the design file in different files and different projects, when using the plug-in, the value of the preference item is the value set by him.

The data stored by pixso.serverStorage is differentiated according to the plug-in Id, so the current plug-in 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>

key key is an optional parameter. If no key is passed, all the information configured by the user under the plug-in is retrieved from the serverStorage storage (if the user did not do any configuration of the plug-in, 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>

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>

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

Prev
pixso.clientStorage