Skip to content

Commit

Permalink
chore(deps): upgrade @napi-rs/cli to 2.7.0
Browse files Browse the repository at this point in the history
generated type def on multi impl blocks napi-rs/napi-rs#1149
  • Loading branch information
yisibl committed Apr 30, 2022
1 parent 248cf8a commit 6da3df7
Show file tree
Hide file tree
Showing 7 changed files with 319 additions and 301 deletions.
5 changes: 5 additions & 0 deletions js-binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

export function renderAsync(svg: string | Buffer, options?: string | undefined | null, signal?: AbortSignal | undefined | null): Promise<RenderedImage>
export class Resvg {
constructor(svg: string | Buffer, options?: string | undefined | null)
/** Renders an SVG in Node.js */
render(): RenderedImage
/** Output usvg-simplified SVG string */
toString(): string
/** Get the SVG width */
get width(): number
/** Get the SVG height */
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
"version": "napi version"
},
"devDependencies": {
"@napi-rs/canvas": "^0.1.19",
"@napi-rs/cli": "^2.4.4",
"@swc-node/register": "^1.4.2",
"@napi-rs/canvas": "^0.1.21",
"@napi-rs/cli": "^2.7.0",
"@swc-node/register": "^1.5.1",
"@types/node": "^17.0.1",
"@types/sharp": "^0.30.0",
"@typescript-eslint/eslint-plugin": "^5.3.1",
"@typescript-eslint/parser": "^5.3.1",
"@types/sharp": "^0.30.2",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"ava": "^3.15.0",
"benny": "^3.7.1",
"copyfiles": "^2.4.1",
Expand All @@ -92,12 +92,12 @@
"eslint-plugin-sonarjs": "^0.13.0",
"husky": "^7.0.4",
"jimp": "^0.16.1",
"lint-staged": "^12.1.3",
"lint-staged": "^12.4.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"sharp": "^0.30.0",
"prettier": "^2.6.2",
"sharp": "^0.30.4",
"svg2img": "^0.9.4",
"typescript": "^4.5.4"
"typescript": "^4.6.3"
},
"lint-staged": {
"*.@(js|ts|tsx)": [
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ impl Resvg {
Ok(Resvg { tree, js_options })
}

// Renders an SVG in Node.js
/// Renders an SVG in Node.js
#[napi]
pub fn render(&self) -> Result<RenderedImage, NapiError> {
Ok(self.render_inner()?)
}

#[napi]
/// Output usvg-simplified SVG string
pub fn to_string(&self) -> String {
self.tree.to_string(&usvg::XmlOptions::default())
}
Expand Down Expand Up @@ -174,6 +175,7 @@ impl Resvg {
#[wasm_bindgen]
impl Resvg {
#[wasm_bindgen(js_name = toString)]
/// Output usvg-simplified SVG string
pub fn to_string(&self) -> String {
self.tree.to_string(&usvg::XmlOptions::default())
}
Expand All @@ -199,7 +201,7 @@ impl Resvg {
}

#[wasm_bindgen]
// Renders an SVG in Wasm
/// Renders an SVG in Wasm
pub fn render(&self) -> Result<RenderedImage, JsValue> {
Ok(self.render_inner()?)
}
Expand Down
2 changes: 1 addition & 1 deletion wasm/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by dts-bundle-generator v6.5.0
// Generated by dts-bundle-generator v6.9.0

declare class RenderedImage {
free(): void;
Expand Down
2 changes: 1 addition & 1 deletion wasm/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified wasm/index_bg.wasm
Binary file not shown.
Loading

1 comment on commit 6da3df7

@vercel
Copy link

@vercel vercel bot commented on 6da3df7 Apr 30, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

resvg-js – ./

resvg-js-git-main-yisibl.vercel.app
resvg-js.vercel.app
resvg-js-yisibl.vercel.app

Please sign in to comment.