Skip to main content

Editor.Assets.JavaScriptAsset

Class

A script asset that is written in JavaScript.

Index

Example

#script-assetshttps://docs.snap.com/lens-studio/5.0.0/essential-skills/scripting/scripting-introduction

Extends

Properties

attachments

attachments: Asset[]

Array of assets attached to this script.

Inherited from

ScriptAsset.attachments


cacheFile

readonly cacheFile: Path

Path to the cached asset file.

Inherited from

ScriptAsset.cacheFile


componentId

readonly componentId: Uuid

Id associated with the script asset.

Inherited from

TypeScriptAsset.componentId


declarationFile

declarationFile: ScriptAsset

TypeScript declaration file path for this script's type definitions.

Inherited from

ScriptAsset.declarationFile


description

description: string

Description associated with the script asset

Inherited from

ScriptAsset.description


exportId

readonly exportId: Uuid

Export id associated with the script asset.

Inherited from

TypeScriptAsset.exportId


fileMeta

readonly fileMeta: AssetImportMetadata

Import metadata for the asset.

Inherited from

ScriptAsset.fileMeta


icon

icon: Icon

Icon associated with the script asset.

Inherited from

ScriptAsset.icon


id

readonly id: Uuid

The unique id of the entity.

Inherited from

ScriptAsset.id


meta

readonly meta: Meta

Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

Inherited from

ScriptAsset.meta


name

readonly name: string

The name of the asset.

Inherited from

ScriptAsset.name


readMe

readMe: MarkdownAsset

Documentation string for this script.

Inherited from

ScriptAsset.readMe


scriptInputInfo

readonly scriptInputInfo: any

Read-only information about the script's input parameters.


scriptType

scriptType: ScriptType

The kind of script this asset defines. See Editor.Assets.ScriptType.

Inherited from

ScriptAsset.scriptType


tags

tags: string[]

Array of tags categorizing this script.

Inherited from

ScriptAsset.tags


type

readonly type: string

The entity's type.

Inherited from

ScriptAsset.type


version

version: Version

Version associated with the script asset.

Inherited from

ScriptAsset.version

Methods

getDirectlyReferencedEntities()

getDirectlyReferencedEntities(): Entity[]

A list of entities which this entity has a reference to.

Returns

Entity[]

Inherited from

ScriptAsset.getDirectlyReferencedEntities


getMeta()

static getMeta(): Meta

Returns metadata about this type.

Returns

Meta

Overrides

ScriptAsset.getMeta


getOwnedEntities()

getOwnedEntities(): Entity[]

A list of entities which has a reference to this entity.

Returns

Entity[]

Inherited from

ScriptAsset.getOwnedEntities


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

ScriptAsset.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptAsset.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptAsset.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptAsset.isSame


isScriptInputHidden()

isScriptInputHidden(inputName): boolean

Returns true if the script inpput is hidden from the scene.

Parameters

ParameterType
inputNamestring

Returns

boolean

Inherited from

ScriptAsset.isScriptInputHidden


setScriptInputHidden()

setScriptInputHidden(inputName, hidden): void

Used when you'd like to hide inputs from users in the scene.

Parameters

ParameterType
inputNamestring
hiddenboolean

Returns

void

Inherited from

ScriptAsset.setScriptInputHidden