Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Latest commit

 

History

History
66 lines (54 loc) · 1.58 KB

0181.md

File metadata and controls

66 lines (54 loc) · 1.58 KB
DSP Title Author Status Type Created
0181
Portable Experiences Interface
World Team
Draft
Standards
2021-01-19

Portable experiences interface for the SDK

The interface would be included from the SDK using the identifier

import * as PortableExperiences from '@decentraland/PortableExperiences'
 enum ExecutorType {
  SCENE = 'SCENE',
  WEARABLE = 'WEARABLE',
  QUEST_UI = 'QUEST_UI'
}

type Executor = {
  type: ExecutorType
  identifier: string
}

type PortableExperienceIdentifier = string

type PortableExperienceHandle = {
  pid: string
  identifier: PortableExperienceIdentifier
  parentProcess: Executor
}

type SpawnPortableExperienceParameters = {
  contentIdentifier: PortableExperienceIdentifier
}

export interface IPortableExperiencesController {
  /**
   * Starts a portable experience.
   * @param  {SpawnPortableExperienceParameters} [spawnParams] - Information to identify the PE
   *
   * Returns the handle of the portable experience.
   */
  spawn(spawnParams: SpawnPortableExperienceParameters): Promise<PortableExperienceHandle>

  /**
   * Stops a portable experience. Only the executor that spawned the portable experience has permission to kill it.
   * @param {Executor} [executor] - The executor that will stop the PE
   * @param  {string} [pid] - The portable experience process id
   *
   * Returns true if was able to kill the portable experience, false if not.
   */
  kill(pid: string): Promise<boolean>

  /**
  * Lists all portable experiences running from the session
  */
  list(): Promise<List<PortableExperienceHandle>>
}