mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-17 23:34:14 +01:00
Replace typescript compiler with native tsgo compiler
This commit is contained in:
@@ -147,7 +147,7 @@ class SmallChunksTransform extends Transform {
|
||||
}
|
||||
|
||||
override _transform(
|
||||
incomingChunk: Buffer | undefined,
|
||||
incomingChunk: Buffer<ArrayBuffer> | undefined,
|
||||
_encoding: string,
|
||||
done: (error?: Error) => void
|
||||
) {
|
||||
@@ -179,7 +179,7 @@ class SmallChunksTransform extends Transform {
|
||||
}
|
||||
}
|
||||
|
||||
function generateAvatar(): Uint8Array {
|
||||
function generateAvatar(): Uint8Array<ArrayBuffer> {
|
||||
const result = new Uint8Array(255);
|
||||
for (let i = 0; i < result.length; i += 1) {
|
||||
result[i] = i;
|
||||
@@ -187,11 +187,11 @@ function generateAvatar(): Uint8Array {
|
||||
return result;
|
||||
}
|
||||
|
||||
function getTestBuffer(): Uint8Array {
|
||||
function getTestBuffer(): Uint8Array<ArrayBuffer> {
|
||||
const avatarBuffer = generateAvatar();
|
||||
const prefixedContact = generatePrefixedContact(avatarBuffer);
|
||||
|
||||
const chunks: Array<Uint8Array> = [];
|
||||
const chunks: Array<Uint8Array<ArrayBuffer>> = [];
|
||||
for (let i = 0; i < 3; i += 1) {
|
||||
chunks.push(...prefixedContact);
|
||||
chunks.push(avatarBuffer);
|
||||
@@ -201,9 +201,9 @@ function getTestBuffer(): Uint8Array {
|
||||
}
|
||||
|
||||
function generatePrefixedContact(
|
||||
avatarBuffer: Uint8Array | undefined,
|
||||
avatarBuffer: Uint8Array<ArrayBuffer> | undefined,
|
||||
aci: AciString | null = DEFAULT_ACI
|
||||
): [Uint8Array, Uint8Array] {
|
||||
): [Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>] {
|
||||
const contactInfoBuffer = Proto.ContactDetails.encode({
|
||||
name: 'Zero Cool',
|
||||
number: '+10000000000',
|
||||
|
||||
@@ -728,9 +728,9 @@ describe('Crypto', () => {
|
||||
overrideSize,
|
||||
}: {
|
||||
path?: string;
|
||||
data: Uint8Array;
|
||||
plaintextHash?: Uint8Array;
|
||||
encryptionKeys?: Uint8Array;
|
||||
data: Uint8Array<ArrayBuffer>;
|
||||
plaintextHash?: Uint8Array<ArrayBuffer>;
|
||||
encryptionKeys?: Uint8Array<ArrayBuffer>;
|
||||
modifyIncrementalMac?: boolean;
|
||||
overrideSize?: number;
|
||||
}): Promise<DecryptedAttachmentV2> {
|
||||
@@ -986,8 +986,8 @@ describe('Crypto', () => {
|
||||
outerKeys,
|
||||
}: {
|
||||
plaintextAbsolutePath: string;
|
||||
innerKeys: Uint8Array;
|
||||
outerKeys: Uint8Array;
|
||||
innerKeys: Uint8Array<ArrayBuffer>;
|
||||
outerKeys: Uint8Array<ArrayBuffer>;
|
||||
}) {
|
||||
let innerCiphertextPath;
|
||||
let outerCiphertextPath;
|
||||
|
||||
@@ -179,10 +179,12 @@ describe('backup/calling', () => {
|
||||
beforeEach(async () => {
|
||||
const adminRootKey = CallLinkRootKey.generate();
|
||||
const adminKey = CallLinkRootKey.generateAdminPassKey();
|
||||
// @ts-expect-error needs ringrtc update
|
||||
const adminKeyBytes: Uint8Array<ArrayBuffer> = adminKey;
|
||||
adminCallLink = {
|
||||
rootKey: adminRootKey.toString(),
|
||||
roomId: getRoomIdFromRootKey(adminRootKey),
|
||||
adminKey: fromAdminKeyBytes(adminKey),
|
||||
adminKey: fromAdminKeyBytes(adminKeyBytes),
|
||||
name: "Let's Talk Rocks",
|
||||
restrictions: CallLinkRestrictions.AdminApproval,
|
||||
revoked: false,
|
||||
|
||||
@@ -18,7 +18,9 @@ import {
|
||||
fetchLinkPreviewMetadata,
|
||||
} from '../../linkPreviews/linkPreviewFetch.preload.js';
|
||||
|
||||
async function readFixtureImage(filename: string): Promise<Uint8Array> {
|
||||
async function readFixtureImage(
|
||||
filename: string
|
||||
): Promise<Uint8Array<ArrayBuffer>> {
|
||||
const result = await fs.promises.readFile(
|
||||
path.join(__dirname, '..', '..', '..', 'fixtures', filename)
|
||||
);
|
||||
@@ -60,11 +62,15 @@ describe('link preview fetching', () => {
|
||||
}: {
|
||||
status?: number;
|
||||
headers?: { [key: string]: null | string };
|
||||
body?: null | string | Uint8Array | AsyncIterable<Uint8Array>;
|
||||
body?:
|
||||
| null
|
||||
| string
|
||||
| Uint8Array<ArrayBuffer>
|
||||
| AsyncIterable<Uint8Array<ArrayBuffer>>;
|
||||
url?: string;
|
||||
} = {}) => {
|
||||
let bodyLength: null | number;
|
||||
let bodyStream: null | AsyncIterable<Uint8Array>;
|
||||
let bodyStream: null | AsyncIterable<Uint8Array<ArrayBuffer>>;
|
||||
if (!body) {
|
||||
bodyLength = 0;
|
||||
bodyStream = null;
|
||||
|
||||
@@ -955,6 +955,7 @@ describe('AttachmentDownloadManager.runDownloadAttachmentJobInner', () => {
|
||||
.returns(Promise.resolve(downloadedAttachment));
|
||||
cleanupAttachmentFiles = sandbox.stub();
|
||||
maybeDeleteAttachmentFile = sandbox.stub();
|
||||
deleteDownloadFile = sandbox.stub();
|
||||
processNewAttachment = sandbox.stub().callsFake(attachment => attachment);
|
||||
});
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import { DAY } from '../../util/durations/constants.std.js';
|
||||
|
||||
describe('SenderCertificateService', () => {
|
||||
let fakeValidCertificate: SenderCertificate;
|
||||
let fakeValidEncodedCertificate: Uint8Array;
|
||||
let fakeValidEncodedCertificate: Uint8Array<ArrayBuffer>;
|
||||
let fakeValidCertificateExpiry: number;
|
||||
let fakeServer: any;
|
||||
let fakeEvents: Pick<typeof window.Whisper.events, 'on' | 'off'>;
|
||||
|
||||
@@ -16,7 +16,10 @@ import { DataWriter } from '../../sql/Client.preload.js';
|
||||
import { signalProtocolStore } from '../../SignalProtocolStore.preload.js';
|
||||
import { itemStorage } from '../../textsecure/Storage.preload.js';
|
||||
|
||||
const assertEqualBuffers = (a: Uint8Array, b: Uint8Array) => {
|
||||
const assertEqualBuffers = (
|
||||
a: Uint8Array<ArrayBuffer>,
|
||||
b: Uint8Array<ArrayBuffer>
|
||||
) => {
|
||||
assert.isTrue(constantTimeEqual(a, b));
|
||||
};
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { generateAci } from '../../types/ServiceId.std.js';
|
||||
import { encryptProfileData } from '../../util/encryptProfileData.preload.js';
|
||||
|
||||
describe('encryptProfileData', () => {
|
||||
let keyBuffer: Uint8Array;
|
||||
let keyBuffer: Uint8Array<ArrayBuffer>;
|
||||
let conversation: ConversationType;
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user