Skip to content

Interface: SsResource ​

Defined in: packages/react-native-spritestudio/src/specs/SsRuntime.nitro.ts:338

A loaded .ssab. Shareable across contexts; the Brain refcounts it internally.

Extends ​

  • HybridObject<{ android: "c++"; ios: "c++"; }>

Properties ​

byteLength ​

readonly byteLength: number

Defined in: packages/react-native-spritestudio/src/specs/SsRuntime.nitro.ts:340


name ​

readonly name: string

Defined in: node_modules/.pnpm/nitro-core@0.37.2/node_modules/nitro-core/js/lib/typescript/module/HybridObject.d.ts:52

The HybridObject's name.

Inherited from ​

HybridObject.name

Methods ​

dispose() ​

dispose(): void

Defined in: node_modules/.pnpm/nitro-core@0.37.2/node_modules/nitro-core/js/lib/typescript/module/HybridObject.d.ts:94

Disposes any resources this HybridObject might hold natively, and releases this HybridObject's NativeState.

After calling (), this object can no longer be used.

Eagerly disposing a HybridObject could be beneficial for a queue-/handler-architecture where a bunch of Hybrid Objects are allocated, and later deallocated once a callback (e.g. a render function) completes.

Returns ​

void

Note ​

It is NOT required to call () manually, as the JavaScript Garbage Collector automatically disposes and releases any resources when needed. It is purely optional to eagerly-, and manually-, call () here - use with caution!

Inherited from ​

HybridObject.dispose


equals() ​

equals(other): boolean

Defined in: node_modules/.pnpm/nitro-core@0.37.2/node_modules/nitro-core/js/lib/typescript/module/HybridObject.d.ts:79

Returns whether this HybridObject is the same object as other.

While two HybridObjects might not be equal when compared with ==, they might still hold the same underlying HybridObject, in which case equals(other) will return true.

Parameters ​

other ​

HybridObject<{ android: "c++"; ios: "c++"; }>

Returns ​

boolean

Example ​

ts
const hybridA = SomeModule.getExistingHybridInstance()
const hybridB = SomeModule.getExistingHybridInstance()
console.log(hybridA.equals(hybridB)) // true

Inherited from ​

HybridObject.equals


getExternalInstancePackNames() ​

getExternalInstancePackNames(): string[]

Defined in: packages/react-native-spritestudio/src/specs/SsRuntime.nitro.ts:355

The packs this one's Instance parts reach into, as bare names.

From the .ssab's own external_instances manifest, so a same-file sub-animation is correctly absent and the caller only fetches what is genuinely elsewhere. Read once when the resource is created, because the Brain offers no way to get a .ssab back out of a resource and creating a throwaway context to ask would be the alternative.

Resolution is transitive and that walk is the caller's: an external pack can reach further still, so a loader has to ask each pack it loads. One pack reaching another is one level; nothing stops there being more.

Returns ​

string[]


toString() ​

toString(): string

Defined in: node_modules/.pnpm/nitro-core@0.37.2/node_modules/nitro-core/js/lib/typescript/module/HybridObject.d.ts:64

Returns a string representation of the given HybridObject.

Unless overridden by the HybridObject, this will return the name of the object.

Returns ​

string

Example ​

ts
const hybridA = SomeModule.getExistingHybridInstance()
console.log(hybridA.toString()) // [HybridObject HybridA]

Inherited from ​

HybridObject.toString