diff --git a/feature_tests/js/api/BorrowedFields.d.ts b/feature_tests/js/api/BorrowedFields.d.ts index d9d32cb3a..f7f77c0a4 100644 --- a/feature_tests/js/api/BorrowedFields.d.ts +++ b/feature_tests/js/api/BorrowedFields.d.ts @@ -2,6 +2,6 @@ /** */ export class BorrowedFields { - a: Uint16Array; + a: string; b: string; } diff --git a/tool/src/js/structs.rs b/tool/src/js/structs.rs index ff3c5805b..f33dbcd81 100644 --- a/tool/src/js/structs.rs +++ b/tool/src/js/structs.rs @@ -500,9 +500,10 @@ pub fn gen_ts_type( return Ok(opt); } ast::TypeName::Writeable => unreachable!(), - ast::TypeName::StrReference(_, ast::StringEncoding::UnvalidatedUtf8 | ast::StringEncoding::UnvalidatedUtf16) => { - out.write_str("string")? - } + ast::TypeName::StrReference( + _, + ast::StringEncoding::UnvalidatedUtf8 | ast::StringEncoding::UnvalidatedUtf16, + ) => out.write_str("string")?, ast::TypeName::PrimitiveSlice(.., prim) => match prim { ast::PrimitiveType::i8 => write!(out, "Int8Array")?, ast::PrimitiveType::u8 => write!(out, "Uint8Array")?,