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
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5201,7 +5201,8 @@
/types/node-red__editor-client/ @alexk111 @Shaquu
/types/node-red__registry/ @alexk111 @Shaquu
/types/node-red__runtime/ @alexk111 @Shaquu
/types/node-red__util/ @alexk111 @Shaquu
/types/node-red__util/ @alexk111 @Shaquu @GogoVega
/types/node-red__util/v3/ @alexk111 @Shaquu
/types/node-redis-pubsub/ @renekeijzer
/types/node-redmine/ @grptx
/types/node-replicate/ @Ankan002
Expand Down
4 changes: 4 additions & 0 deletions notNeededPackages.json
Original file line number Diff line number Diff line change
Expand Up @@ -7963,6 +7963,10 @@
"libraryName": "@trimblemaps/trimblemaps-js",
"asOfVersion": "3.2.0"
},
"truncate-middle": {
"libraryName": "truncate-middle",
"asOfVersion": "2.0.0"
},
"ts3-nodejs-library": {
"libraryName": "ts3-nodejs-library",
"asOfVersion": "2.0.0"
Expand Down
596 changes: 376 additions & 220 deletions types/chrome/index.d.ts

Large diffs are not rendered by default.

180 changes: 111 additions & 69 deletions types/chrome/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,28 @@ function testProxy() {
});
}

// https://developer.chrome.com/docs/extensions/reference/api/publicSuffix
function testPublicSuffix() {
chrome.publicSuffix.DomainEncoding.DISPLAY === "display";
chrome.publicSuffix.DomainEncoding.PUNYCODE === "punycode";

const hostname = "developer.chrome.com";

const domainOptions: chrome.publicSuffix.DomainOptions = {
allowIPAddress: true,
allowPlainSuffix: true,
allowUnknownSuffix: true,
encoding: "display",
};

chrome.publicSuffix.getDomain(hostname); // $ExpectType string | null
chrome.publicSuffix.getDomain(hostname, domainOptions); // $ExpectType string | null

chrome.publicSuffix.getKnownSuffix(hostname); // $ExpectType string | null

chrome.publicSuffix.isKnownSuffix(hostname); // $ExpectType boolean
}

// https://developer.chrome.com/docs/extensions/reference/api/notifications
function testNotifications() {
chrome.notifications.PermissionLevel.DENIED === "denied";
Expand Down Expand Up @@ -980,6 +1002,21 @@ function testRuntime() {
details.id; // $ExpectType string | undefined
details.previousVersion; // $ExpectType string | undefined
details.reason; // $ExpectType "install" | "update" | "chrome_update" | "shared_module_update"

if (details.reason === "update") {
details.previousVersion; // $ExpectType string
details.id; // $ExpectType undefined
}

if (details.reason === "shared_module_update") {
details.id; // $ExpectType string
details.previousVersion; // $ExpectType undefined
}

if (details.reason === "install" || details.reason === "chrome_update") {
details.id; // $ExpectType undefined
details.previousVersion; // $ExpectType undefined
}
});

checkChromeEvent(chrome.runtime.onMessage, (message, sender, sendResponse) => {
Expand Down Expand Up @@ -1115,6 +1152,9 @@ function testGetManifest() {
manifest.oauth2.scopes; // $ExpectType string[]
}

manifest.replacement_web_app; // $ExpectType string | undefined
manifest.trial_tokens; // $ExpectType string[] | undefined

if (manifest.sandbox) {
manifest.sandbox.pages; // $ExpectType string[]
manifest.sandbox.content_security_policy; // $ExpectType string | undefined
Expand Down Expand Up @@ -1177,6 +1217,8 @@ function testGetManifest() {
sandbox: "default-src 'self'",
};

manifest.message_serialization; // $ExpectType "json" | "structured_clone" | undefined

manifest.host_permissions; // $ExpectType string[] | undefined
manifest.optional_permissions; // $ExpectType ManifestOptionalPermission[] | undefined
manifest.optional_host_permissions; // $ExpectType string[] | undefined
Expand Down Expand Up @@ -5801,17 +5843,17 @@ function testFontSettings() {
chrome.fontSettings.ScriptCode.ZSYM === "Zsym";
chrome.fontSettings.ScriptCode.ZYYY === "Zyyy";

chrome.fontSettings.clearDefaultFixedFontSize(); // Expected Promise<void>
chrome.fontSettings.clearDefaultFontSize(() => void 0); // Expected void
chrome.fontSettings.clearDefaultFixedFontSize(); // Expected Promise<void>
chrome.fontSettings.clearDefaultFixedFontSize({}, () => void 0); // Expected void
chrome.fontSettings.clearDefaultFixedFontSize(); // $Expected Promise<void>
chrome.fontSettings.clearDefaultFontSize(() => void 0); // $Expected void
chrome.fontSettings.clearDefaultFixedFontSize(); // $Expected Promise<void>
chrome.fontSettings.clearDefaultFixedFontSize({}, () => void 0); // $Expected void
// @ts-expect-error
chrome.fontSettings.clearDefaultFixedFontSize({}, () => {}).then(() => {});

chrome.fontSettings.clearDefaultFontSize(); // Expected Promise<void>
chrome.fontSettings.clearDefaultFontSize(() => void 0); // Expected void
chrome.fontSettings.clearDefaultFontSize({}); // Expected Promise<void>
chrome.fontSettings.clearDefaultFontSize({}, () => void 0); // Expected void
chrome.fontSettings.clearDefaultFontSize(); // $Expected Promise<void>
chrome.fontSettings.clearDefaultFontSize(() => void 0); // $Expected void
chrome.fontSettings.clearDefaultFontSize({}); // $Expected Promise<void>
chrome.fontSettings.clearDefaultFontSize({}, () => void 0); // $Expected void
// @ts-expect-error
chrome.fontSettings.clearDefaultFontSize({}, () => {}).then(() => {});

Expand All @@ -5820,40 +5862,40 @@ function testFontSettings() {
script: "Afak",
};

chrome.fontSettings.clearFont(clearFontDetails); // Expected Promise<void>
chrome.fontSettings.clearFont(clearFontDetails, () => void 0); // Expected void
chrome.fontSettings.clearFont(clearFontDetails); // $Expected Promise<void>
chrome.fontSettings.clearFont(clearFontDetails, () => void 0); // $Expected void
// @ts-expect-error
chrome.fontSettings.clearFont(clearFontDetails, () => {}).then(() => {});

chrome.fontSettings.clearMinimumFontSize(); // Expected Promise<void>
chrome.fontSettings.clearMinimumFontSize(() => void 0); // Expected void
chrome.fontSettings.clearMinimumFontSize({}); // Expected Promise<void>
chrome.fontSettings.clearMinimumFontSize({}, () => void 0); // Expected void
chrome.fontSettings.clearMinimumFontSize(); // $Expected Promise<void>
chrome.fontSettings.clearMinimumFontSize(() => void 0); // $Expected void
chrome.fontSettings.clearMinimumFontSize({}); // $Expected Promise<void>
chrome.fontSettings.clearMinimumFontSize({}, () => void 0); // $Expected void
// @ts-expect-error
chrome.fontSettings.clearMinimumFontSize(() => {}).then(() => {});

chrome.fontSettings.getDefaultFixedFontSize(); // Expected Promise<FontSizeResult>
chrome.fontSettings.getDefaultFixedFontSize((details) => { // Expected void
details.pixelSize; // Expected number
details.levelOfControl; // Expected LevelOfControl
chrome.fontSettings.getDefaultFixedFontSize(); // $Expected Promise<FontSizeResult>
chrome.fontSettings.getDefaultFixedFontSize((details) => { // $Expected void
details.pixelSize; // $Expected number
details.levelOfControl; // $Expected LevelOfControl
});
chrome.fontSettings.getDefaultFixedFontSize({}); // Expected Promise<FontSizeResult>
chrome.fontSettings.getDefaultFixedFontSize({}, (details) => { // Expected void
details.pixelSize; // Expected number
details.levelOfControl; // Expected LevelOfControl
chrome.fontSettings.getDefaultFixedFontSize({}); // $Expected Promise<FontSizeResult>
chrome.fontSettings.getDefaultFixedFontSize({}, (details) => { // $Expected void
details.pixelSize; // $Expected number
details.levelOfControl; // $Expected LevelOfControl
});
// @ts-expect-error
chrome.fontSettings.getDefaultFixedFontSize(() => {}).then(() => {});

chrome.fontSettings.getDefaultFontSize(); // Expected Promise<FontSizeResult>
chrome.fontSettings.getDefaultFontSize((details) => { // Expected void
details.pixelSize; // Expected number
details.levelOfControl; // Expected LevelOfControl
chrome.fontSettings.getDefaultFontSize(); // $Expected Promise<FontSizeResult>
chrome.fontSettings.getDefaultFontSize((details) => { // $Expected void
details.pixelSize; // $Expected number
details.levelOfControl; // $Expected LevelOfControl
});
chrome.fontSettings.getDefaultFontSize({}); // Expected Promise<FontSizeResult>
chrome.fontSettings.getDefaultFontSize({}, (details) => { // Expected void
details.pixelSize; // Expected number
details.levelOfControl; // Expected LevelOfControl
chrome.fontSettings.getDefaultFontSize({}); // $Expected Promise<FontSizeResult>
chrome.fontSettings.getDefaultFontSize({}, (details) => { // $Expected void
details.pixelSize; // $Expected number
details.levelOfControl; // $Expected LevelOfControl
});
// @ts-expect-error
chrome.fontSettings.getDefaultFontSize({}, () => {}).then(() => {});
Expand All @@ -5863,29 +5905,29 @@ function testFontSettings() {
script: "Afak",
};

chrome.fontSettings.getFont(getFontDetails); // Expected Promise<GetFontResult>
chrome.fontSettings.getFont(getFontDetails, (details) => { // Expected void
details.fontId; // Expected string
details.levelOfControl; // Expected LevelOfControl
chrome.fontSettings.getFont(getFontDetails); // $Expected Promise<GetFontResult>
chrome.fontSettings.getFont(getFontDetails, (details) => { // $Expected void
details.fontId; // $Expected string
details.levelOfControl; // $Expected LevelOfControl
});
// @ts-expect-error
chrome.fontSettings.getFont({}, (details) => {});

chrome.fontSettings.getFontList(); // Expected Promise<FontName[]>
chrome.fontSettings.getFontList(([result]) => { // Expected void
result.fontId; // Expected string
result.displayName; // Expected string
chrome.fontSettings.getFontList(); // $Expected Promise<FontName[]>
chrome.fontSettings.getFontList(([result]) => { // $Expected void
result.fontId; // $Expected string
result.displayName; // $Expected string
});

chrome.fontSettings.getMinimumFontSize(); // Expected Promise<FontSizeResult>
chrome.fontSettings.getMinimumFontSize((details) => { // Expected void
details.pixelSize; // Expected number
details.levelOfControl; // Expected LevelOfControl
chrome.fontSettings.getMinimumFontSize(); // $Expected Promise<FontSizeResult>
chrome.fontSettings.getMinimumFontSize((details) => { // $Expected void
details.pixelSize; // $Expected number
details.levelOfControl; // $Expected LevelOfControl
});
chrome.fontSettings.getMinimumFontSize({}); // Expected Promise<FontSizeResult>
chrome.fontSettings.getMinimumFontSize({}, (details) => { // Expected void
details.pixelSize; // Expected number
details.levelOfControl; // Expected LevelOfControl
chrome.fontSettings.getMinimumFontSize({}); // $Expected Promise<FontSizeResult>
chrome.fontSettings.getMinimumFontSize({}, (details) => { // $Expected void
details.pixelSize; // $Expected number
details.levelOfControl; // $Expected LevelOfControl
});
// @ts-expect-error
chrome.fontSettings.getMinimumFontSize({}, () => {}).then(() => {});
Expand All @@ -5894,52 +5936,52 @@ function testFontSettings() {
pixelSize: 12,
};

chrome.fontSettings.setDefaultFixedFontSize(setFontSizeDetails); // Expected Promise<void>
chrome.fontSettings.setDefaultFixedFontSize(setFontSizeDetails, () => void 0); // Expected void
chrome.fontSettings.setDefaultFixedFontSize(setFontSizeDetails); // $Expected Promise<void>
chrome.fontSettings.setDefaultFixedFontSize(setFontSizeDetails, () => void 0); // $Expected void
// @ts-expect-error
chrome.fontSettings.setDefaultFixedFontSize(() => {}).then(() => {});
chrome.fontSettings.setDefaultFixedFontSize(setFontSizeDetails, () => {}).then(() => {});

chrome.fontSettings.setDefaultFontSize(setFontSizeDetails); // Expected Promise<void>
chrome.fontSettings.setDefaultFontSize(setFontSizeDetails, () => void 0); // Expected void
chrome.fontSettings.setDefaultFontSize(setFontSizeDetails); // $Expected Promise<void>
chrome.fontSettings.setDefaultFontSize(setFontSizeDetails, () => void 0); // $Expected void
// @ts-expect-error
chrome.fontSettings.setDefaultFontSize(() => {}).then(() => {});
chrome.fontSettings.setDefaultFontSize(setFontSizeDetails, () => {}).then(() => {});

const setFontDetails: chrome.fontSettings.SetFontDetails = {
genericFamily: "standard",
script: "Afak",
fontId: "fontId",
};

chrome.fontSettings.setFont(setFontDetails); // Expected Promise<void>
chrome.fontSettings.setFont(setFontDetails, () => void 0); // Expected void
chrome.fontSettings.setFont(setFontDetails); // $Expected Promise<void>
chrome.fontSettings.setFont(setFontDetails, () => void 0); // $Expected void
// @ts-expect-error
chrome.fontSettings.setFont(() => {}).then(() => {});
chrome.fontSettings.setFont(setFontDetails, () => {}).then(() => {});

chrome.fontSettings.setMinimumFontSize(setFontSizeDetails); // Expected Promise<void>
chrome.fontSettings.setMinimumFontSize(setFontSizeDetails, () => void 0); // Expected void
chrome.fontSettings.setMinimumFontSize(setFontSizeDetails); // $Expected Promise<void>
chrome.fontSettings.setMinimumFontSize(setFontSizeDetails, () => void 0); // $Expected void
// @ts-expect-error
chrome.fontSettings.setMinimumFontSize(() => {}).then(() => {});
chrome.fontSettings.setMinimumFontSize(setFontSizeDetails, () => {}).then(() => {});

checkChromeEvent(chrome.fontSettings.onDefaultFixedFontSizeChanged, (details) => {
details.pixelSize; // Expected number
details.levelOfControl; // Expected LevelOfControl
details.pixelSize; // $Expected number
details.levelOfControl; // $Expected LevelOfControl
});

checkChromeEvent(chrome.fontSettings.onDefaultFontSizeChanged, (details) => {
details.pixelSize; // Expected number
details.levelOfControl; // Expected LevelOfControl
details.pixelSize; // $Expected number
details.levelOfControl; // $Expected LevelOfControl
});

checkChromeEvent(chrome.fontSettings.onFontChanged, (details) => {
details.fontId; // Expected string
details.genericFamily; // Expected GenericFamily
details.levelOfControl; // Expected LevelOfControl
details.script; // Expected ScriptCode | undefined
details.fontId; // $Expected string
details.genericFamily; // $Expected GenericFamily
details.levelOfControl; // $Expected LevelOfControl
details.script; // $Expected ScriptCode | undefined
});

checkChromeEvent(chrome.fontSettings.onMinimumFontSizeChanged, (details) => {
details.pixelSize; // Expected number
details.levelOfControl; // Expected LevelOfControl
details.pixelSize; // $Expected number
details.levelOfControl; // $Expected LevelOfControl
});
}

Expand Down Expand Up @@ -6958,7 +7000,7 @@ function testPrinterProvider() {

checkChromeEvent(chrome.printerProvider.onGetCapabilityRequested, (printerId, resultCallback) => {
printerId; // $ExpectType string
resultCallback({ capabilities: {} }); // $ExpectType void
resultCallback({ version: "1.0", printer: { supported_content_type: [{ content_type: "application/pdf" }] } }); // $ExpectType void
});

checkChromeEvent(chrome.printerProvider.onGetPrintersRequested, (resultCallback) => {
Expand Down
4 changes: 3 additions & 1 deletion types/multer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,16 @@ declare namespace multer {
* at https://github.com/mscdex/busboy#busboy-methods.
*/
limits?: {
/** Maximum size of each form field name in bytes. (Default: 100) */
/** Maximum size of each form field name in bytes. (Default: Infinity) */
fieldNameSize?: number | undefined;
/** Maximum size of each form field value in bytes. (Default: 1048576) */
fieldSize?: number | undefined;
/** Maximum number of non-file form fields. (Default: Infinity) */
fields?: number | undefined;
/** Maximum number of nesting levels for field names, e.g. `a[b][c]` has 2 levels. (Default: Infinity) */
fieldNestingDepth?: number | undefined;
/** Maximum numeric array index accepted for field names. (Default: Infinity) */
fieldArrayIndexLimit?: number | undefined;
/** Maximum size of each file in bytes. (Default: Infinity) */
fileSize?: number | undefined;
/** Maximum number of file fields. (Default: Infinity) */
Expand Down
1 change: 1 addition & 0 deletions types/multer/multer-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const upload_with_limits = multer({
fieldSize: 1048576,
fields: 10,
fieldNestingDepth: 2,
fieldArrayIndexLimit: 100,
fileSize: Infinity,
files: Infinity,
parts: Infinity,
Expand Down
2 changes: 1 addition & 1 deletion types/multer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/multer",
"version": "2.2.9999",
"version": "2.3.9999",
"projects": [
"https://github.com/expressjs/multer"
],
Expand Down
4 changes: 2 additions & 2 deletions types/react-virtualized/dist/es/CellMeasurer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export class CellMeasurerCache implements CellMeasurerCacheInterface {
readonly defaultWidth: number;
hasFixedHeight(): boolean;
hasFixedWidth(): boolean;
getHeight(rowIndex: number, columnIndex: number): number;
getWidth(rowIndex: number, columnIndex: number): number;
getHeight(rowIndex: number, columnIndex?: number): number;
getWidth(rowIndex: number, columnIndex?: number): number;
has(rowIndex: number, columnIndex: number): boolean;
rowHeight: (params: { index: number }) => number;
set(rowIndex: number, columnIndex: number, width: number, height: number): void;
Expand Down
4 changes: 4 additions & 0 deletions types/react-virtualized/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
{
"name": "Adam Zmenak",
"githubUsername": "azmenak"
},
{
"name": "Viktor Kolyshkin",
"githubUsername": "Viktor-Kolyshkin"
}
]
}
8 changes: 8 additions & 0 deletions types/react-virtualized/react-virtualized-tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1810,3 +1810,11 @@ export class GridCellRangeRendererExample extends PureComponent<{}, any> {
return renderedCells;
}
}

// CellMeasurerCache.getHeight / getWidth: columnIndex is optional (the library
// defaults it to 0), matching CellMeasurerCacheInterface. Common for single-column List/Table.
const singleColumnMeasurerCache = new CellMeasurerCache({ fixedWidth: true });
const measuredRowHeight: number = singleColumnMeasurerCache.getHeight(0);
const measuredRowWidth: number = singleColumnMeasurerCache.getWidth(0);
const measuredCellHeight: number = singleColumnMeasurerCache.getHeight(0, 1);
const measuredCellWidth: number = singleColumnMeasurerCache.getWidth(0, 1);
5 changes: 0 additions & 5 deletions types/truncate-middle/.npmignore

This file was deleted.

8 changes: 0 additions & 8 deletions types/truncate-middle/index.d.ts

This file was deleted.

Loading