Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
Comment thread
tlancina marked this conversation as resolved.
Outdated
}
Binary file added src/android/utils/.apk.ts.swp
Binary file not shown.
10 changes: 5 additions & 5 deletions src/utils/unzip.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Readable } from 'stream';
import { promisify } from 'util';
import { Entry, Options, ZipFile } from 'yauzl';
import { Entry, Options, ZipFile, ZipFileOptions } from 'yauzl';

// Override so promisify typing correctly infers params
export type YauzlOpenReadStream = (entry: Entry, callback?: (err: Error, stream: Readable) => void) => Promise<Readable>;
type YauzlOpen = (path: string, options: Options, callback?: (err: Error, zipfile: ZipFile) => void) => void;
type UnzipOnEntry = (entry: Entry, zipfile: ZipFile, openReadStream: YauzlOpenReadStream) => void;
// Specify which of possible overloads is being promisified
type YauzlOpenReadStream = (entry: Entry, options?: ZipFileOptions, callback?: (err: Error, stream: Readable) => void) => void;
type YauzlOpen = (path: string, options?: Options, callback?: (err: Error, zipfile: ZipFile) => void) => void;
type UnzipOnEntry = (entry: Entry, zipfile: ZipFile, openReadStream: (arg1: Entry, arg2?: ZipFileOptions) => Promise<Readable>) => void;

export async function unzip(srcPath: string, onEntry: UnzipOnEntry) {
const yauzl = await import('yauzl');
Expand Down