Skip to content

types: export Sink, Source and HeaderArgument - #182

Open
PE39806 wants to merge 1 commit into
mafintosh:masterfrom
PE39806:chore/update-ts-types
Open

PE39806 wants to merge 1 commit into
mafintosh:masterfrom
PE39806:chore/update-ts-types

Conversation

@PE39806

@PE39806 PE39806 commented Sep 2, 2026

Copy link
Copy Markdown

Sink, Source and HeaderArgument are all reachable from the public API but are declared locally and left out of the export list, so consumers cannot use them.

  • Sink is the return type of pack.entry()
  • Source is the stream passed to the entry event, and the item type of Extract's AsyncIterable
  • HeaderArgument is the parameter type of pack.entry()

Without them, anything that wraps, mocks or delegates to entry(), or declares a standalone entry handler, has to fall back on ReturnType<Pack['entry']> and Parameters<Pack['entry']>[0].

This also fills in Sink, which was declared as an empty interface. pack.js sets header and written on it (without an underscore prefix, unlike the internal fields). entry() normalises size, type, mode, uid, gid and mtime before constructing the sink, so these will always be present. The remaining header fields stay optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant