Skip to content

Commit db9cd77

Browse files
committed
undo prettier
1 parent 8f91a22 commit db9cd77

File tree

1 file changed

+23
-56
lines changed

1 file changed

+23
-56
lines changed

index.d.ts

Lines changed: 23 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface JSZipSupport {
1313
nodebuffer: boolean;
1414
}
1515

16-
type Compression = "STORE" | "DEFLATE";
16+
type Compression = 'STORE' | 'DEFLATE';
1717

1818
/**
1919
* Depends on the compression type. With `STORE` (no compression), these options are ignored. With
@@ -23,7 +23,7 @@ interface CompressionOptions {
2323
level: number;
2424
}
2525

26-
interface Metadata {
26+
interface Metadata {
2727
percent: number;
2828
currentFile: string | null;
2929
}
@@ -64,9 +64,7 @@ interface OutputByType {
6464
// compressedContent: string|ArrayBuffer|Uint8Array|Buffer;
6565
// }
6666

67-
type InputFileFormat =
68-
| InputByType[keyof InputByType]
69-
| Promise<InputByType[keyof InputByType]>;
67+
type InputFileFormat = InputByType[keyof InputByType] | Promise<InputByType[keyof InputByType]>;
7068

7169
declare namespace JSZip {
7270
type InputType = keyof InputByType;
@@ -95,14 +93,8 @@ declare namespace JSZip {
9593
* @param onUpdate a function to call on each internal update.
9694
* @return Promise the promise of the result.
9795
*/
98-
async<T extends OutputType>(
99-
type: T,
100-
onUpdate?: OnUpdateCallback
101-
): Promise<OutputByType[T]>;
102-
nodeStream(
103-
type?: "nodebuffer",
104-
onUpdate?: OnUpdateCallback
105-
): NodeJS.ReadableStream;
96+
async<T extends OutputType>(type: T, onUpdate?: OnUpdateCallback): Promise<OutputByType[T]>;
97+
nodeStream(type?: 'nodebuffer', onUpdate?: OnUpdateCallback): NodeJS.ReadableStream;
10698
}
10799

108100
interface JSZipFileOptions {
@@ -167,7 +159,7 @@ declare namespace JSZip {
167159
/** Stream the files and create file descriptors */
168160
streamFiles?: boolean;
169161
/** DOS (default) or UNIX */
170-
platform?: "DOS" | "UNIX";
162+
platform?: 'DOS' | 'UNIX';
171163
}
172164

173165
interface JSZipLoadOptions {
@@ -183,27 +175,25 @@ declare namespace JSZip {
183175
currentFile: string;
184176
}
185177

186-
type DataEventCallback<T> = (dataChunk: T, metadata: JSZipMetadata) => void;
187-
type EndEventCallback = () => void;
188-
type ErrorEventCallback = (error: Error) => void;
178+
type DataEventCallback<T> = (dataChunk: T, metadata: JSZipMetadata) => void
179+
type EndEventCallback = () => void
180+
type ErrorEventCallback = (error: Error) => void
189181

190182
interface JSZipStreamHelper<T> {
191183
/**
192184
* Register a listener on an event
193185
*/
194-
on(event: "data", callback: DataEventCallback<T>): this;
195-
on(event: "end", callback: EndEventCallback): this;
196-
on(event: "error", callback: ErrorEventCallback): this;
186+
on(event: 'data', callback: DataEventCallback<T>): this;
187+
on(event: 'end', callback: EndEventCallback): this;
188+
on(event: 'error', callback: ErrorEventCallback): this;
197189

198190
/**
199191
* Read the whole stream and call a callback with the complete content
200192
*
201193
* @param updateCallback The function called every time the stream updates
202194
* @return A Promise of the full content
203195
*/
204-
accumulate(
205-
updateCallback?: (metadata: JSZipMetadata) => void
206-
): Promise<T>;
196+
accumulate(updateCallback?: (metadata: JSZipMetadata) => void): Promise<T>;
207197

208198
/**
209199
* Resume the stream if the stream is paused. Once resumed, the stream starts sending data events again
@@ -222,7 +212,7 @@ declare namespace JSZip {
222212
}
223213

224214
interface JSZip {
225-
files: { [key: string]: JSZip.JSZipObject };
215+
files: {[key: string]: JSZip.JSZipObject};
226216

227217
/**
228218
* Get a file from the archive
@@ -248,16 +238,8 @@ interface JSZip {
248238
* @param options Optional information about the file
249239
* @return JSZip object
250240
*/
251-
file<T extends JSZip.InputType>(
252-
path: string,
253-
data: InputByType[T] | Promise<InputByType[T]>,
254-
options?: JSZip.JSZipFileOptions
255-
): this;
256-
file<T extends JSZip.InputType>(
257-
path: string,
258-
data: null,
259-
options?: JSZip.JSZipFileOptions & { dir: true }
260-
): this;
241+
file<T extends JSZip.InputType>(path: string, data: InputByType[T] | Promise<InputByType[T]>, options?: JSZip.JSZipFileOptions): this;
242+
file<T extends JSZip.InputType>(path: string, data: null, options?: JSZip.JSZipFileOptions & { dir: true }): this;
261243

262244
/**
263245
* Returns an new JSZip instance with the given folder as root
@@ -280,19 +262,15 @@ interface JSZip {
280262
*
281263
* @param callback function
282264
*/
283-
forEach(
284-
callback: (relativePath: string, file: JSZip.JSZipObject) => void
285-
): void;
265+
forEach(callback: (relativePath: string, file: JSZip.JSZipObject) => void): void;
286266

287267
/**
288268
* Get all files which match the given filter function
289269
*
290270
* @param predicate Filter function
291271
* @return Array of matched elements
292272
*/
293-
filter(
294-
predicate: (relativePath: string, file: JSZip.JSZipObject) => boolean
295-
): JSZip.JSZipObject[];
273+
filter(predicate: (relativePath: string, file: JSZip.JSZipObject) => boolean): JSZip.JSZipObject[];
296274

297275
/**
298276
* Removes the file or folder from the archive
@@ -309,10 +287,7 @@ interface JSZip {
309287
* @param onUpdate The optional function called on each internal update with the metadata.
310288
* @return The serialized archive
311289
*/
312-
generateAsync<T extends JSZip.OutputType>(
313-
options?: JSZip.JSZipGeneratorOptions<T>,
314-
onUpdate?: OnUpdateCallback
315-
): Promise<OutputByType[T]>;
290+
generateAsync<T extends JSZip.OutputType>(options?: JSZip.JSZipGeneratorOptions<T>, onUpdate?: OnUpdateCallback): Promise<OutputByType[T]>;
316291

317292
/**
318293
* Generates a new archive asynchronously
@@ -321,20 +296,15 @@ interface JSZip {
321296
* @param onUpdate The optional function called on each internal update with the metadata.
322297
* @return A Node.js `ReadableStream`
323298
*/
324-
generateNodeStream(
325-
options?: JSZip.JSZipGeneratorOptions<"nodebuffer">,
326-
onUpdate?: OnUpdateCallback
327-
): NodeJS.ReadableStream;
299+
generateNodeStream(options?: JSZip.JSZipGeneratorOptions<'nodebuffer'>, onUpdate?: OnUpdateCallback): NodeJS.ReadableStream;
328300

329301
/**
330302
* Generates the complete zip file with the internal stream implementation
331303
*
332304
* @param options Optional options for the generator
333305
* @return a StreamHelper
334306
*/
335-
generateInternalStream<T extends JSZip.OutputType>(
336-
options?: JSZip.JSZipGeneratorOptions<T>
337-
): JSZip.JSZipStreamHelper<OutputByType[T]>;
307+
generateInternalStream<T extends JSZip.OutputType>(options?: JSZip.JSZipGeneratorOptions<T>): JSZip.JSZipStreamHelper<OutputByType[T]>;
338308

339309
/**
340310
* Deserialize zip file asynchronously
@@ -343,15 +313,12 @@ interface JSZip {
343313
* @param options Options for deserializing
344314
* @return Returns promise
345315
*/
346-
loadAsync(
347-
data: InputFileFormat,
348-
options?: JSZip.JSZipLoadOptions
349-
): Promise<JSZip>;
316+
loadAsync(data: InputFileFormat, options?: JSZip.JSZipLoadOptions): Promise<JSZip>;
350317

351318
/**
352319
* Create JSZip instance
353320
*/
354-
new (): this;
321+
new(): this;
355322

356323
(): JSZip;
357324

0 commit comments

Comments
 (0)