Skip to main content

Interface: UnzipTask

Defined in: src/specs/Unzip.nitro.ts:46

A single extraction operation. Each call to Unzip.extract() returns an UnzipTask instance that can be observed and cancelled independently.

This is a proper HybridObject — a native instance you interact with directly, not an opaque task ID.

Extends

  • HybridObject<{ android: "kotlin"; ios: "swift"; }>

Properties

name

readonly name: string

Defined in: node_modules/react-native-nitro-modules/lib/typescript/HybridObject.d.ts:52

The HybridObject's name.

Inherited from

HybridObject.name


taskId

readonly taskId: string

Defined in: src/specs/Unzip.nitro.ts:49

Unique identifier for this extraction task

Methods

await()

await(): Promise<UnzipResult>

Defined in: src/specs/Unzip.nitro.ts:65

Await the extraction result. Resolves when extraction completes, rejects if cancelled or an error occurs.

Returns

Promise<UnzipResult>


cancel()

cancel(): void

Defined in: src/specs/Unzip.nitro.ts:59

Cancel this extraction. Safe to call multiple times.

Returns

void


dispose()

dispose(): void

Defined in: node_modules/react-native-nitro-modules/lib/typescript/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/react-native-nitro-modules/lib/typescript/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

ParameterType
otherHybridObject<{ android: "kotlin"; ios: "swift"; }>

Returns

boolean

Example

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

Inherited from

HybridObject.equals


onProgress()

onProgress(callback): void

Defined in: src/specs/Unzip.nitro.ts:56

Register a callback to receive progress updates. Progress is throttled to ~1 update per second to avoid bridge overhead. The first file and final file always trigger a callback.

Parameters

ParameterType
callback(progress) => void

Returns

void


toString()

toString(): string

Defined in: node_modules/react-native-nitro-modules/lib/typescript/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

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

Inherited from

HybridObject.toString