From f090f0acc06a9eeb43e3a01c8d9b259144c4c853 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 26 Aug 2020 10:25:48 +0800 Subject: [PATCH] modify d.ts, modify function name --- index.d.ts | 5 ++++- src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 9b08de9..aa31e57 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1 +1,4 @@ -export const diff: (left: string, right: string) => [] +export const diffChars: ( + left: string, + right: string, +) => [{ count: number; value: string; added: boolean; removed: boolean }] diff --git a/src/lib.rs b/src/lib.rs index 59177df..b3c2d02 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,7 +16,7 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; register_module!(example, init); fn init(module: &mut Module) -> Result<()> { - module.create_named_method("diff", diff_char)?; + module.create_named_method("diffChars", diff_char)?; Ok(()) }