Skip to content

Feature: VID

Аниса edited this page Sep 12, 2022 · 7 revisions

━ What's the Objective?

Vital's kit implements custom VID (Virtual-ID) to serialize entities w/ unique IDs which can be used for various identification purposes.

━ APIs

━ vKit.vid.create() (Shared)

@Objective: Creates a new VID.
const string: vid = vKit.vid.create()

━ vKit.vid.blacklist() (Shared)

@Objective: Blacklists provided VID.
const bool: state = vKit.vid.blacklist(
  string: vid
)

━ vKit.vid.fetch() (Shared)

@Objective: Serializes provided entity.
⚠️ Entity once serialized can't further be re/de-serialized for safety purposes
const string: vid = vKit.vid.fetch(
  ~: parent, // Entity which you prefer to serialize 
  string: assignVID, // (Optional): VID to assign incase if entity isn't serialized
  bool: isReadOnly // (Optional): Boolean indicating whether its read/write access
)