[POC] Add PrintOptions destination to Print API#3915
Draft
aaronschubert0 wants to merge 1 commit into2026-04-rcfrom
Draft
[POC] Add PrintOptions destination to Print API#3915aaronschubert0 wants to merge 1 commit into2026-04-rcfrom
aaronschubert0 wants to merge 1 commit into2026-04-rcfrom
Conversation
Add PrintDestination type and PrintOptions interface to the Print API,
enabling extensions to specify a print destination ('system' or 'receipt').
This allows printing to the physical receipt printer on POS devices.
- Add PrintDestination type: 'system' | 'receipt'
- Add PrintOptions interface with optional destination field
- Update PrintApiContent.print() to accept optional PrintOptions parameter
- Export new types from api.ts barrel file
- Update print-api.doc.ts with new type definitions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PrintDestinationtype ('system' | 'receipt') andPrintOptionsinterface to the Print APIPrintApiContent.print()method signature to accept an optionalPrintOptionssecond parameter:print(src: string, options?: PrintOptions): Promise<void>api.ts)print-api.doc.tsto includePrintOptionsandPrintDestinationin the generated documentation definitionsWhy
Extensions currently cannot print to the physical receipt printer connected to a POS device. This adds a
destinationoption to the existing Print API so extensions can choose between the system print dialog (default) and the receipt printer.The design follows the Web API alignment pattern (
Window.print()extended with an options-bag, likefetch(url, options)), making the change backward-compatible — the second parameter is optional and defaults to'system'behavior.Type Changes
Test plan
tsc --project packages/ui-extensions/tsconfig.jsonpasses)print(src)calls without options continue to work🤖 Generated with Claude Code