diff --git a/examples/napi/__test__/typegen.spec.ts.md b/examples/napi/__test__/typegen.spec.ts.md index 9cf5bdc4..b2dd10ea 100644 --- a/examples/napi/__test__/typegen.spec.ts.md +++ b/examples/napi/__test__/typegen.spec.ts.md @@ -33,6 +33,7 @@ Generated by [AVA](https://avajs.dev). get name(): string␊ set name(name: string)␊ whoami(): string␊ + static getDogKind(): Kind␊ }␊ export class PackageJson {␊ name: string␊ diff --git a/examples/napi/__test__/typegen.spec.ts.snap b/examples/napi/__test__/typegen.spec.ts.snap index bc94ec3f..cf99096f 100644 Binary files a/examples/napi/__test__/typegen.spec.ts.snap and b/examples/napi/__test__/typegen.spec.ts.snap differ diff --git a/examples/napi/index.d.ts b/examples/napi/index.d.ts index e354a68c..655b8355 100644 --- a/examples/napi/index.d.ts +++ b/examples/napi/index.d.ts @@ -23,6 +23,7 @@ export class Animal { get name(): string set name(name: string) whoami(): string + static getDogKind(): Kind } export class PackageJson { name: string diff --git a/examples/napi/src/class.rs b/examples/napi/src/class.rs index 91c060ba..73321425 100644 --- a/examples/napi/src/class.rs +++ b/examples/napi/src/class.rs @@ -41,6 +41,11 @@ impl Animal { Kind::Duck => format!("Duck: {}", self.name), } } + + #[napi] + pub fn get_dog_kind() -> Kind { + Kind::Dog + } } #[napi(constructor)]