typings: share Sign and Verify handle methods

Extract SignBaseHandle for the shared init and update methods.
Preserve existing signatures and runtime behavior.

Assisted-by: Codex
Signed-off-by: leah-1ee <selee3196@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66499
Reviewed-By: Tim Perry <pimterry@gmail.com>
This commit is contained in:
Seongeun Lee authored and GitHub committed 2026-10-29 08:47:51 +00:00
1 parent 510d84c330
commit 2eded683c5
1 file changed
+5 -4
+5 -4
View File
@@ -665,9 +665,12 @@ declare namespace InternalCryptoBinding {
setPrivateKey(key: ByteSource): void;
}
interface SignHandle {
interface SignBaseHandle {
init(algorithm: string): void;
update(data: ByteSource, encoding?: string): void;
}
interface SignHandle extends SignBaseHandle {
sign(
...args: [
...key: PreparedAsymmetricKeyArgs,
@@ -678,9 +681,7 @@ declare namespace InternalCryptoBinding {
): Buffer;
}
interface VerifyHandle {
init(algorithm: string): void;
update(data: ByteSource, encoding?: string): void;
interface VerifyHandle extends SignBaseHandle {
verify(
...args: [
...key: PreparedAsymmetricKeyArgs,