transcend-io / conflux

Zip/unzip files of any size in the browser using streams.
MIT License
96 stars 14 forks source link

Create `d.ts` #18

Open jimmywarting opened 5 years ago

jimmywarting commented 5 years ago

Depends on #2

eligrey commented 4 years ago

I ended up using this type declaration for Conflux in Penumbra:

declare module '@transcend-io/conflux' {
  // TypeScript isn't aware of TransformStream
  /* eslint-disable no-undef */
  /** Conflux Zip Writer class */
  export class Writer extends TransformStream {
    /* eslint-enable no-undef */
    constructor();

    /** Write stream to zip */
    write(params: {
      name: string;
      lastModified: Date;
      stream(): ReadableStream;
    }): void;

    close(): void;
  }
}