Skip to content

Commit 21532a6

Browse files
committed
chore(javascript): Update napi to 3
Signed-off-by: Dmitry Dygalo <[email protected]>
1 parent 0bfbd6f commit 21532a6

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

bindings/javascript/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ mimalloc = "0.1"
2222
mimalloc = { version = "0.1", features = ["local_dynamic_tls"] }
2323

2424
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
25-
napi = { version = "2.16.0", default-features = false, features = ["napi4"] }
26-
napi-derive = "2.16.0"
25+
napi = { version = "3.1.3", default-features = false, features = ["napi4"] }
26+
napi-derive = "3.1.0"
2727

2828
[target.'cfg(target_arch = "wasm32")'.dependencies]
2929
wasm-bindgen = "=0.2.100"
@@ -43,7 +43,7 @@ version = "*"
4343
default-features = false
4444

4545
[build-dependencies]
46-
napi-build = "2.1.0"
46+
napi-build = "2.2.0"
4747

4848
[profile.release]
4949
lto = true

bindings/javascript/index.d.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
/* tslint:disable */
1+
/* auto-generated by NAPI-RS */
22
/* eslint-disable */
3+
/** Inline CSS styles from <style> tags to matching elements in the HTML tree and return a string. */
4+
export declare function inline(html: string, options?: Options | undefined | null): string
35

4-
/* auto-generated by NAPI-RS */
6+
/** Inline CSS styles into an HTML fragment. */
7+
export declare function inlineFragment(html: string, css: string, options?: Options | undefined | null): string
58

6-
export interface StylesheetCache {
7-
/** Cache size. */
8-
size: number
9-
}
109
export interface Options {
1110
/**
1211
* Whether to inline CSS from "style" tags.
@@ -19,6 +18,8 @@ export interface Options {
1918
keepStyleTags?: boolean
2019
/** Keep "link" tags after inlining. */
2120
keepLinkTags?: boolean
21+
/** Keep "at-rules" after inlining. */
22+
keepAtRules?: boolean
2223
/** Used for loading external stylesheets via relative URLs. */
2324
baseUrl?: string
2425
/** Whether remote stylesheets should be loaded or not. */
@@ -33,9 +34,11 @@ export interface Options {
3334
*/
3435
preallocateNodeCapacity?: number
3536
}
36-
/** Inline CSS styles from <style> tags to matching elements in the HTML tree and return a string. */
37-
export declare function inline(html: string, options?: Options | undefined | null): string
38-
/** Inline CSS styles into an HTML fragment. */
39-
export declare function inlineFragment(html: string, css: string, options?: Options | undefined | null): string
37+
38+
export interface StylesheetCache {
39+
/** Cache size. */
40+
size: number
41+
}
42+
4043
/** Get the package version. */
4144
export declare function version(): string

bindings/javascript/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
],
2020
"types": "index.d.ts",
2121
"napi": {
22-
"name": "css-inline",
23-
"triples": {
22+
"binaryName": "css-inline",
23+
"targets": {
2424
"additional": [
2525
"aarch64-apple-darwin",
2626
"aarch64-linux-android",
@@ -36,7 +36,7 @@
3636
"license": "MIT",
3737
"devDependencies": {
3838
"@ava/typescript": "^4.1.0",
39-
"@napi-rs/cli": "^2.17.0",
39+
"@napi-rs/cli": "^3.0.4",
4040
"@swc-node/register": "^1.6.8",
4141
"@swc/core": "^1.3.101",
4242
"@types/copyfiles": "^2",

0 commit comments

Comments
 (0)