Skip to content

Variable: assets ​

ts
const assets: {
  ready(): Promise<void>;
  resolve(ref): Promise<ResolvedAsset>;
  url(ref): string;
  load(ref): Promise<Blob>;
  loadTexture(ref): Promise<Texture<TextureSource<any>>>;
  loadAudio(ref): Promise<HTMLAudioElement>;
};

Asset helpers backed by the global SuityAssets SDK (suity-assets.js).

Call assets.ready() before using key-based helpers. Textures are loaded on the main thread so editor preview service-worker routing works.

Type Declaration ​

NameTypeDescription
ready()() => Promise<void>Waits for the asset manifest/SDK to be ready.
resolve()(ref) => Promise<ResolvedAsset>Resolves an Addressable Key/uid to { uid, url, ... }.
url()(ref) => stringReturns the URL for an already-resolved key/uid.
load()(ref) => Promise<Blob>Loads the asset bytes.
loadTexture()(ref) => Promise<Texture<TextureSource<any>>>Loads a texture through Pixi Assets.
loadAudio()(ref) => Promise<HTMLAudioElement>Creates an HTMLAudioElement for an audio asset.

Suity developer documentation · API generated by TypeDoc