Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about exporting some query option type #84

Open
hyoban opened this issue Mar 4, 2024 · 1 comment
Open

How about exporting some query option type #84

hyoban opened this issue Mar 4, 2024 · 1 comment

Comments

@hyoban
Copy link
Member

hyoban commented Mar 4, 2024

Like NoteQueryOptions. Otherwise, we must use type NoteQueryOptions = Parameters<typeof indexer.note.getMany>[0]

@songkeys
Copy link
Member

Absolutely! We can definitely make these adjustments. Currently, some functions have varying parameter types, with some separated and some not. It would be great to separate and export them accordingly.

Regarding the function parameter style:

// Some are like this:
getNote(characterId: number, noteId: number)

// While some are like this:
getNotes(options: NoteQueryOptions)

I believe sticking to the second format consistently is the way to go. It's a significant change that we should implement in v2.

// Example:
type GetNoteQueryOptions = {
  characterId: number
  noteId: number
}
getNote(options: GetNoteQueryOptions)

But for the current v1, we can do the exporting anyway.

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

No branches or pull requests

2 participants