Skip to content

Instantly share code, notes, and snippets.

@malerba118
Last active July 5, 2023 19:59
Show Gist options
  • Save malerba118/797baed6f0db4b233edfbe5e25150ded to your computer and use it in GitHub Desktop.
Save malerba118/797baed6f0db4b233edfbe5e25150ded to your computer and use it in GitHub Desktop.
type Book = {
id: string
image: string
title: string
description: string
duration: number // (milliseconds?)
audio: string
chapters: Chapter[]
}
type Chapter = {
id: string
title: string
start: number /* 0-1 */
stop: number /* 0-1 */
}
type Account = {
user_id: string
books: [{
book_id: string
progress: number /* 0-1 */
}]
}
api.books.list({ genre: 'Science Fiction' })
api.books.search({ query: 'Harry Potter' })
api.books.getById('123')
api.account.get()
api.account.updateBookProgress({ book_id, progress })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment