Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions types/create-torrent/create-torrent-tests.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/// <reference types="node" />
import createTorrent, { announceList, isJunkPath } from "create-torrent";

const cb = (err: Error | null, torrent?: Buffer) => {};
const cb = (err: Error | null, torrent: Uint8Array) => {};

createTorrent("test", (err: Error | null, torrent?: Buffer) => {
createTorrent("test", (err: Error | null, torrent: Uint8Array) => {
if (err) return;
if (torrent) torrent.equals(Buffer.alloc(0));
if (torrent) Buffer.from(torrent).equals(Buffer.alloc(0));
});

createTorrent(["a.txt", "b.txt"], cb);
Expand Down
2 changes: 1 addition & 1 deletion types/create-torrent/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="node" />
import type { Readable as ReadableStream } from "node:stream";

export type CreateTorrentCallback = (err: Error | null, torrent?: Buffer) => void;
export type CreateTorrentCallback = (err: Error | null, torrent: Uint8Array) => void;

export interface CreateTorrentOptions {
// name of the torrent (default = basename of `path`, or 1st file's name)
Expand Down
8 changes: 8 additions & 0 deletions types/node/node-tests/worker_threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ import { createContext } from "node:vm";
const mp2 = new MessagePort();
}

{
// Test hasRef, ref, unref
const mp1 = new workerThreads.MessagePort();
mp1.hasRef();
mp1.ref();
mp1.unref();
}

{
// Test addEventListener, removeEventListener and dispatchEvent
if (workerThreads.isMainThread) {
Expand Down
3 changes: 3 additions & 0 deletions types/node/worker_threads.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ declare module "node:worker_threads" {
postMessage(message: any, transfer: Transferable[]): void;
postMessage(message: any, options?: StructuredSerializeOptions): void;
start(): void;
hasRef(): boolean;
ref(): void;
unref(): void;
addEventListener<K extends keyof MessagePortEventMap>(
type: K,
listener: (ev: MessagePortEventMap[K]) => void,
Expand Down
4 changes: 0 additions & 4 deletions types/nodegit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
{
"name": "Jake Murzy",
"githubUsername": "jmurzy"
},
{
"name": "Niklas Wenzel",
"githubUsername": "nikwen"
}
]
}