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

Revise saving API #74

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Revise saving API #74

merged 1 commit into from
Nov 21, 2024

Conversation

tinyjin
Copy link
Member

@tinyjin tinyjin commented Nov 18, 2024

Regarding to gif saving enhancement at thorvg/thorvg@a85470b, this patch aligns with changed interface.

JavaScript interface changed:
*Outdated

  • public save(target: ExportableType)
  • enum ExportableType

*Introduced

  • public save2png(): void
  • public async save2gif(src: string): Promise

Regarding to gif saving enhancement at thorvg/thorvg@a85470b, this patch aligns with changed interface.

JavaScript interface changed:
*Outdated
- public save(target: ExportableType)
- enum ExportableType

*Introduced
- public save2png(): void
- public async save2gif(src: string): Promise<void>
@tinyjin tinyjin added the APIs Update / Revise APIs label Nov 18, 2024
@tinyjin tinyjin requested a review from hermet November 18, 2024 10:14
@tinyjin tinyjin self-assigned this Nov 18, 2024
Copy link

vercel bot commented Nov 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thorvg-perf-test ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 10:14am

* @since 1.0
*/
public save(target: ExportableType): void {
Copy link
Member

Choose a reason for hiding this comment

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

Please check this, I think we can retain this common API for future extension.

save(src: string, export: string)  {
   if (export == "png") save2png()
   else if (export == "gif") save2gif()
   else //not support
} 

@hermet
Copy link
Member

hermet commented Nov 21, 2024

  • async save2gif

Does it need to be async ??

@tinyjin
Copy link
Member Author

tinyjin commented Nov 21, 2024

  • async save2gif

Does it need to be async ??

@hermet Yes, file uploading and reading require async call

@hermet hermet merged commit c7104ae into main Nov 21, 2024
2 checks passed
@hermet hermet deleted the jinny/revise-saving-api branch November 21, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIs Update / Revise APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants