Skip to content

[jsbox-app] Improve API accuracy, narrow types and fix bugs - #75383

Open
Gandum2077 wants to merge 3 commits into
DefinitelyTyped:masterfrom
Gandum2077:master
Open

[jsbox-app] Improve API accuracy, narrow types and fix bugs#75383
Gandum2077 wants to merge 3 commits into
DefinitelyTyped:masterfrom
Gandum2077:master

Conversation

@Gandum2077

Copy link
Copy Markdown
Contributor

This PR improves type accuracy and fixes several bugs based on the JSBox documentation and runtime behavior verified on real devices.

Main changes:

  • Narrow broad number and string types to their corresponding JSBox constants or literal unions across UI, input, media, Photo, Widget, Socket, and other APIs.
  • Convert relevant comments to JSDoc and clarify defaults, valid values, undocumented behavior, deprecated or unusable APIs, and documentation errors.
  • Correct SQLite error and transaction callback types to reflect the actual commit/rollback behavior.
  • Correct return and error types for SSH and SFTP operations and add Promise overloads.
  • Fix incorrect overloads in the Photo declarations and expand the image metadata types.
  • Improve HTTP upload typing by requiring either image or data content, reuse request options for downloads, and add structured network proxy settings.
  • Account for Widget family raw-value differences between pre-iOS 26 and iOS 26+, and narrow Widget date style and alignment values.
  • Correct several API details, including server response fields, Socket state mutability, picker defaults, optional NSError fields, and support for NSData or Uint8Array where applicable.

Test cases have been added to the package test file to cover the updated declarations.

No package version change is required because this PR corrects and refines the declarations for the existing JSBox runtime.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://docs.xteko.com/
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json.

@typescript-automation

typescript-automation Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@Gandum2077 Thank you for submitting this PR!

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners, DT maintainers or others

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 75383,
  "author": "Gandum2077",
  "headCommitOid": "6e9ce88112a5b3492cccd92143a46a05e180ea37",
  "mergeBaseOid": "8883b899108653d7d047bbc898793f387b2f472e",
  "lastPushDate": "2026-08-13T03:50:23.000Z",
  "lastActivityDate": "2026-08-13T08:19:29.000Z",
  "mergeOfferDate": "2026-08-13T08:20:08.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "jsbox-app",
      "kind": "edit",
      "files": [
        {
          "path": "types/jsbox-app/jsbox-app-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/jsbox-app/src/basic.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/constant.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/drive.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/extend/qrcode.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/extend/share.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/extend/text.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/foundation/app.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/foundation/clipboard.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/foundation/device.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/foundation/http.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/foundation/network.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/foundation/prefs.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/foundation/system.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/function.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/input.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/media/audio.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/media/imagekit.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/media/pdf.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/media/photo.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/media/quicklook.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/network/server.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/network/socket.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/picker.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/sdk/contact.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/sdk/location.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/sdk/message.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/sdk/safari.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/sqlite.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/ssh.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/ui.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/jsbox-app/src/widget.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "Gandum2077"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "Bashamega",
      "date": "2026-08-13T08:19:29.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 5275733189,
  "ciResult": "pass"
}

@typescript-automation typescript-automation Bot added Author is Owner The author of this PR is a listed owner of the package. No Other Owners This DT module only has one owner, so we can't have someone verify the change. labels Aug 13, 2026
@typescript-automation typescript-automation Bot moved this to Waiting for Code Reviews in Pull Request Status Board Aug 13, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

🔔 @Gandum2077 — you're the only owner, but it would still be good if you find someone to review this PR in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...)

@typescript-automation typescript-automation Bot added Other Approved This PR was reviewed and signed-off by a community member. Self Merge This PR can now be self-merged by the PR author or an owner labels Aug 13, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

@Gandum2077: Everything looks good here. I am ready to merge this PR (at 6e9ce88) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

@typescript-automation typescript-automation Bot moved this from Waiting for Code Reviews to Waiting for Author to Merge in Pull Request Status Board Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author is Owner The author of this PR is a listed owner of the package. No Other Owners This DT module only has one owner, so we can't have someone verify the change. Other Approved This PR was reviewed and signed-off by a community member. Self Merge This PR can now be self-merged by the PR author or an owner

Projects

Status: Waiting for Author to Merge

Development

Successfully merging this pull request may close these issues.

2 participants