mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-20 00:18:45 +01:00
Replace typescript compiler with native tsgo compiler
This commit is contained in:
@@ -69,7 +69,7 @@ export type LinkPreviewMetadata = {
|
||||
};
|
||||
|
||||
export type LinkPreviewImage = {
|
||||
data: Uint8Array;
|
||||
data: Uint8Array<ArrayBuffer>;
|
||||
contentType: MIMEType;
|
||||
};
|
||||
|
||||
@@ -228,7 +228,7 @@ const emptyHtmlDocument = (): HTMLDocument =>
|
||||
// (This fallback could, perhaps, be smarter based on user locale.)
|
||||
// [0]: https://www.w3.org/International/questions/qa-html-encoding-declarations.en
|
||||
const parseHtmlBytes = (
|
||||
bytes: Readonly<Uint8Array>,
|
||||
bytes: Readonly<Uint8Array<ArrayBuffer>>,
|
||||
httpCharset: string | null
|
||||
): HTMLDocument => {
|
||||
const hasBom = bytes[0] === 0xef && bytes[1] === 0xbb && bytes[2] === 0xbf;
|
||||
@@ -288,7 +288,7 @@ const parseHtmlBytes = (
|
||||
};
|
||||
|
||||
const getHtmlDocument = async (
|
||||
body: AsyncIterable<string | Uint8Array>,
|
||||
body: AsyncIterable<string | Uint8Array<ArrayBuffer>>,
|
||||
httpCharset: string | null,
|
||||
abortSignal: AbortSignal,
|
||||
logger: Pick<LoggerType, 'warn'> = log
|
||||
@@ -522,6 +522,7 @@ export async function fetchLinkPreviewMetadata(
|
||||
}
|
||||
|
||||
const document = await getHtmlDocument(
|
||||
// @ts-expect-error ReadableStream should actually be giving us ArrayBuffers
|
||||
response.body,
|
||||
contentType.charset,
|
||||
abortSignal,
|
||||
@@ -614,7 +615,7 @@ async function processImageResponse(
|
||||
return null;
|
||||
}
|
||||
|
||||
let data: Uint8Array;
|
||||
let data: Uint8Array<ArrayBuffer>;
|
||||
try {
|
||||
data = await response.buffer();
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user