Skip to content

Allow bitwise setOptions flag types#971

Open
chrisx9z wants to merge 1 commit into
stellar:masterfrom
chrisx9z:fix/set-options-bitwise-flag-types
Open

Allow bitwise setOptions flag types#971
chrisx9z wants to merge 1 commit into
stellar:masterfrom
chrisx9z:fix/set-options-bitwise-flag-types

Conversation

@chrisx9z
Copy link
Copy Markdown

Summary

  • Allows setOptions setFlags and clearFlags inputs to accept bitwise bitmap values without TypeScript casts.
  • Adds AuthFlagInput for user-provided numeric/string flag values while keeping operation output flags numeric.
  • Updates the dtslint coverage to use bitwise flag expressions directly and cover string flag inputs.

Fixes #347.

Verification

  • corepack yarn dtslint --localTs node_modules/typescript/lib types/
  • node --check types/test.ts
  • git diff --check

Copilot AI review requested due to automatic review settings May 27, 2026 14:39
Comment: Lets setOptions flag inputs accept bitwise bitmap values without TypeScript casts.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / introduced AuthFlagInput and updated setOptions flag 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.

Comment thread types/test.ts
clearFlags: "4",
setFlags: "8",
});
stringFlagSetOptions.toXDR("hex");
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.

TypeScript definition for clearFlags and setFlags don't allow bitwise operations.

2 participants