forked from mafintosh/tar-stream
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds typedefs for this module BREAKING CHANGE: what was not typed is now typed which may suprise typed codebases
- Loading branch information
1 parent
d584f0b
commit 6fa8818
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import BufferList from 'bl/BufferList' | ||
|
||
export interface TarEntryHeader { | ||
name: string, | ||
uid: number, | ||
gid: number, | ||
size: number, | ||
mode: number, | ||
mtime: Date, | ||
type: 'file' | 'link' | 'symlink' | 'character-device' | 'block-device' | 'directory' | 'fifo' | 'contiguous-file' | 'pax-header' | 'pax-global-header' | 'gnu-long-link-path' | 'gnu-long-path', | ||
linkname: string | null, | ||
uname: string, | ||
gname: string, | ||
devmajor: number, | ||
devminor: number | ||
} | ||
|
||
export interface TarEntry { | ||
header: TarEntryHeader | ||
body: AsyncIterable<Uint8Array> | ||
} | ||
|
||
export interface TarImportCandidate { | ||
header: Partial<TarEntryHeader> & { name: string } | ||
body?: AsyncIterable<Uint8Array> | ||
} | ||
|
||
export interface ExtractOptions { | ||
highWaterMark: number | ||
filenameEncoding: string | ||
} | ||
|
||
export function extract (options?: ExtractOptions): (source: AsyncIterable<Uint8Array>) => AsyncIterable<TarEntry> | ||
export function pack (): (source: AsyncIterable<TarImportCandidate>) => AsyncIterable<BufferList> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters