DSP | Title | Author | Status | Type | Created |
---|---|---|---|---|---|
0181 |
Portable Experiences Interface |
World Team |
Draft |
Standards |
2021-01-19 |
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>>
}