add static method example
This commit is contained in:
parent
f4c0b0639b
commit
8c281fd174
4 changed files with 7 additions and 0 deletions
|
@ -33,6 +33,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
get name(): string␊
|
get name(): string␊
|
||||||
set name(name: string)␊
|
set name(name: string)␊
|
||||||
whoami(): string␊
|
whoami(): string␊
|
||||||
|
static getDogKind(): Kind␊
|
||||||
}␊
|
}␊
|
||||||
export class PackageJson {␊
|
export class PackageJson {␊
|
||||||
name: string␊
|
name: string␊
|
||||||
|
|
Binary file not shown.
1
examples/napi/index.d.ts
vendored
1
examples/napi/index.d.ts
vendored
|
@ -23,6 +23,7 @@ export class Animal {
|
||||||
get name(): string
|
get name(): string
|
||||||
set name(name: string)
|
set name(name: string)
|
||||||
whoami(): string
|
whoami(): string
|
||||||
|
static getDogKind(): Kind
|
||||||
}
|
}
|
||||||
export class PackageJson {
|
export class PackageJson {
|
||||||
name: string
|
name: string
|
||||||
|
|
|
@ -41,6 +41,11 @@ impl Animal {
|
||||||
Kind::Duck => format!("Duck: {}", self.name),
|
Kind::Duck => format!("Duck: {}", self.name),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[napi]
|
||||||
|
pub fn get_dog_kind() -> Kind {
|
||||||
|
Kind::Dog
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[napi(constructor)]
|
#[napi(constructor)]
|
||||||
|
|
Loading…
Reference in a new issue