Allow bitwise setOptions flag types#971
Open
chrisx9z wants to merge 1 commit into
Open
Conversation
Comment: Lets setOptions flag inputs accept bitwise bitmap values without TypeScript casts.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the TypeScript typings for Operation.setOptions to accept flag bitmasks more ergonomically (including runtime-style string inputs), and adjusts type tests accordingly.
Changes:
- Widened
AuthFlag/ introducedAuthFlagInputand updatedsetOptionsflag fields to use it. - Updated type tests to remove casts for bitwise OR flag expressions.
- Added a new type test covering string inputs for
setFlags/clearFlags.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| types/test.ts | Adjusts and extends type tests to validate new accepted flag input forms. |
| types/index.d.ts | Expands flag-related types and updates OperationOptions.SetOptions to accept the new input type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| clearFlags: "4", | ||
| setFlags: "8", | ||
| }); | ||
| stringFlagSetOptions.toXDR("hex"); |
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
setOptionssetFlagsandclearFlagsinputs to accept bitwise bitmap values without TypeScript casts.AuthFlagInputfor user-provided numeric/string flag values while keeping operation output flags numeric.Fixes #347.
Verification
corepack yarn dtslint --localTs node_modules/typescript/lib types/node --check types/test.tsgit diff --check