Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Addsqlite3Worker1Promiser type declarations#54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
tomayac wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromtypes-improvement

Conversation

@tomayac
Copy link
Collaborator

Fixes#53

@jbaiter
Copy link
Contributor

This is going to need lots of overloads:

A Promiser object is a function with two call signatures:

   ( messageType, messageArguments ) is equivalent to:   ( {type: messageType, args: type-specific value} )

where the type is always a string and the args value is message-type specific. It always returns a Promise object which resolves to an object:

{  type: messageType,  result: type-specific result value,  ... possibly other metadata ...}

https://sqlite.org/wasm/doc/tip/api-worker1.md#promiser

@tomayactomayac changed the titleStart work onsqlite3Worker1Promiser type declarationsAddsqlite3Worker1Promiser type declarationsJan 9, 2024
@GabrielDelepine
Copy link

Hi, I wanted to let you know that I am currently working on writing the types. I expect to be in a position to share my work with you in the next few days.

jbaiter, tomayac, and hikaruna reacted with heart emoji

@NoelDeMartin
Copy link

Hey, I just added some partial types to a project recently. They are not comprehensive by any means, but maybe they can serve to get started or to get some ideas:https://github.com/moodlehq/moodleapp/blob/main/src/types/sqlite-wasm.d.ts

GabrielDelepine and vui611 reacted with thumbs up emoji

@GabrielDelepine
Copy link

Hi,
Still working on it, fine-tuningmessageId to unlock its full potential

@sgbeal
Copy link
Collaborator

Note that the messageId is an internal-use property used for dispatching messages between the worker and callbacks. It is hypothetically conceivable for clients to tinker with but no actual use for that comes to mind. FWIW, IMO messageId should be flagged as an opaque type of no interest to clients.

GabrielDelepine reacted with thumbs up emoji

@tomayactomayac mentioned this pull requestMay 21, 2024
@sameoldlab
Copy link

Hi, I made a PR to merge with this adding most of theSqlite3Worker1Promiser related types#76. Still have a few things left to do mainly withPromiserMethods, but would appreciate a second look from anyone interested

pubkey reacted with thumbs up emoji

@sameoldlab
Copy link

Also copying over myprogress comment avoid splitting overall progress discussion:

Progress:

  • Mostly done withSqlite3Worker1PromiserConfig. Not sure what goes in for the args ofgenerateMessageId
  • Need clearer documentation forPromiser Methodopen'sfilename andvfs
  • exec needs to add a full list of arguments, js eqivalent for sqlVALUE value used in row and bind
  • There is additional metadata returned byPromiser. Described as "// possibly other metadata ..." on sqlite docs. Not sure how stable these are / if they should be documented here.
  • Need to add type forPromiser response error stack trace array

As the methods are very similar to worker1, I'm hoping I can reduce what is specified here and reuse the existing types where possible.

Add types for `Sqlite3Worker1Promiser`
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Missing typing for sqlite3Worker1Promiser

7 participants

@tomayac@jbaiter@GabrielDelepine@NoelDeMartin@sgbeal@sameoldlab

[8]ページ先頭

©2009-2025 Movatter.jp