From 1ab52c42b6c67db3608a8d7e3eedeff8cf6b881f Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 7 Nov 2021 00:06:20 +0800 Subject: [PATCH] Release independent packages napi@2.0.0-alpha.2 napi-derive@2.0.0-alpha.2 napi-derive-backend@1.0.3 --- README.md | 2 +- crates/backend/Cargo.toml | 2 +- crates/macro/Cargo.toml | 4 ++-- crates/napi/Cargo.toml | 2 +- examples/napi/index.d.ts | 33 ++++++++++++++++++++++++--------- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 181a963f..ab04ada4 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,7 @@ yarn test | Result<()> | Error | 1 | v8.0.0 | | T: Fn(...) -> Result | Function | 1 | v8.0.0 | | Async/Future | Promise | 4 | v10.6.0 | async | -| Task (NOT YET) | Promise | 1 | v8.5.0 | +| Task | Promise | 1 | v8.5.0 | | (NOT YET) | global | 1 | v8.0.0 | | (NOT YET) | Symbol | 1 | v8.0.0 | | (NOT YET) | ArrayBuffer/TypedArray | 1 | v8.0.0 | diff --git a/crates/backend/Cargo.toml b/crates/backend/Cargo.toml index 2fdbd358..50a24731 100644 --- a/crates/backend/Cargo.toml +++ b/crates/backend/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT" name = "napi-derive-backend" readme = "README.md" repository = "https://github.com/napi-rs/napi-rs" -version = "1.0.2" +version = "1.0.3" [features] strict = [] diff --git a/crates/macro/Cargo.toml b/crates/macro/Cargo.toml index c0caa687..6a7ed1d5 100644 --- a/crates/macro/Cargo.toml +++ b/crates/macro/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT" name = "napi-derive" readme = "README.md" repository = "https://github.com/napi-rs/napi-rs" -version = "2.0.0-alpha.1" +version = "2.0.0-alpha.2" [features] compat-mode = [] @@ -18,7 +18,7 @@ type-def = ["napi-derive-backend/type-def"] [dependencies] convert_case = "0.4" -napi-derive-backend = {version = "1.0.2", path = "../backend"} +napi-derive-backend = {version = "1.0.3", path = "../backend"} proc-macro2 = "1.0" quote = "1.0" syn = {version = "1.0", features = ["fold", "full", "extra-traits"]} diff --git a/crates/napi/Cargo.toml b/crates/napi/Cargo.toml index 7c132893..2238c3d0 100644 --- a/crates/napi/Cargo.toml +++ b/crates/napi/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT" name = "napi" readme = "README.md" repository = "https://github.com/napi-rs/napi-rs" -version = "2.0.0-alpha.1" +version = "2.0.0-alpha.2" [features] async = ["tokio_rt"] diff --git a/examples/napi/index.d.ts b/examples/napi/index.d.ts index ab2e701d..5352b880 100644 --- a/examples/napi/index.d.ts +++ b/examples/napi/index.d.ts @@ -4,7 +4,9 @@ export function sumNums(nums: Array): number export function readFileAsync(path: string): Promise export function asyncMultiTwo(arg: number): Promise export function getCwd(callback: (arg0: string) => void): void -export function readFile(callback: (arg0: Error | undefined, arg1: string | null) => void): void +export function readFile( + callback: (arg0: Error | undefined, arg1: string | null) => void, +): void export function eitherStringOrNumber(input: string | number): number export function returnEither(input: number): string | number export function either3(input: string | number | boolean): number @@ -12,8 +14,21 @@ interface Obj { v: string | number } export function either4(input: string | number | boolean | Obj): number -export enum Kind { Dog = 0, Cat = 1, Duck = 2 } -export enum CustomNumEnum { One = 1, Two = 2, Three = 3, Four = 4, Six = 6, Eight = 8, Nine = 9, Ten = 10 } +export enum Kind { + Dog = 0, + Cat = 1, + Duck = 2, +} +export enum CustomNumEnum { + One = 1, + Two = 2, + Three = 3, + Four = 4, + Six = 6, + Eight = 8, + Nine = 9, + Ten = 10, +} export function enumToI32(e: CustomNumEnum): number export function throwError(): void export function mapOption(val: number | null): number | null @@ -34,7 +49,11 @@ export function concatStr(mutS: string): string export function concatUtf16(s: string): string export function concatLatin1(s: string): string export function withoutAbortController(a: number, b: number): Promise -export function withAbortController(a: number, b: number, signal: AbortSignal): Promise +export function withAbortController( + a: number, + b: number, + signal: AbortSignal, +): Promise export function getBuffer(): Buffer export class Animal { readonly kind: Kind @@ -46,14 +65,10 @@ export class Animal { static getDogKind(): Kind } export class Blake2BHasher { - static withKey(key: Blake2bKey): Blake2BHasher } -export class Blake2BKey { - -} +export class Blake2BKey {} export class Context { - constructor() static withData(data: string): Context method(): string