refactor: use "as const" for constant mappings (#28980)
This commit is contained in:
parent
a699dfdf83
commit
961b74b2ac
4 changed files with 11 additions and 11 deletions
|
@ -60,7 +60,7 @@ const PDFPageSizes: Record<string, ElectronInternal.MediaSize> = {
|
|||
width_microns: 279400,
|
||||
custom_display_name: 'Tabloid'
|
||||
}
|
||||
};
|
||||
} as const;
|
||||
|
||||
// The minimum micron size Chromium accepts is that where:
|
||||
// Per printing/units.h:
|
||||
|
@ -109,7 +109,7 @@ const defaultPrintingSetting = {
|
|||
printerType: 2,
|
||||
title: undefined as string | undefined,
|
||||
url: undefined as string | undefined
|
||||
};
|
||||
} as const;
|
||||
|
||||
// JavaScript implementations of WebContents.
|
||||
const binding = process._linkedBinding('electron_browser_web_contents');
|
||||
|
@ -191,7 +191,7 @@ WebContents.prototype.executeJavaScriptInIsolatedWorld = async function (worldId
|
|||
|
||||
let pendingPromise: Promise<any> | undefined;
|
||||
WebContents.prototype.printToPDF = async function (options) {
|
||||
const printSettings = {
|
||||
const printSettings: Record<string, any> = {
|
||||
...defaultPrintingSetting,
|
||||
requestID: getNextId()
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue