Skip to content
Closed
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
2 changes: 1 addition & 1 deletion types/node/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for non-npm package Node.js 16.4
// Type definitions for non-npm package Node.js 16.6
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
// DefinitelyTyped <https://github.com/DefinitelyTyped>
Expand Down
9 changes: 9 additions & 0 deletions types/node/test/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ declare var RANDOM_GLOBAL_VARIABLE: true;
gc();
}
}

// Node.js ESNEXT Support
{
const lastCharacter = 'string'.at(-1);
const lastArrayItem = [1, 2, 3].at(-1);

const typedArray: NodeJS.TypedArray = new Int8Array([0, 10, 20, 30, 40, 50]);
const lastItem = typedArray.at(-1);
}
3 changes: 3 additions & 0 deletions types/node/ts3.6/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
/// <reference lib="esnext.intl" />
/// <reference lib="esnext.bigint" />

// Reference other required types:
/// <reference types="proposal-relative-indexing-method" />

// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
/// <reference path="../assert/strict.d.ts" />
/// <reference path="../globals.d.ts" />
Expand Down