Skip to content

Commit 3a0c56f

Browse files
🤖 Merge PR DefinitelyTyped#72254 [electron-to-chromium]: Add types for electron-to-chromium by @MysteryBlokHed
1 parent 5b18fbe commit 3a0c56f

File tree

9 files changed

+113
-0
lines changed

9 files changed

+113
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
!**/*.d.ts
3+
!**/*.d.cts
4+
!**/*.d.mts
5+
!**/*.d.*.ts
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const _default: Record<string, string>;
2+
export = _default;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import e2c = require("electron-to-chromium");
2+
3+
e2c.versions;
4+
e2c.fullVersions;
5+
e2c.chromiumVersions;
6+
e2c.fullChromiumVersions;
7+
8+
e2c.electronToChromium("123");
9+
e2c.electronToChromium(123);
10+
e2c.chromiumToElectron("123");
11+
e2c.chromiumToElectron(123);
12+
e2c.electronToBrowserList("123");
13+
e2c.electronToBrowserList(123);
14+
15+
import _versions = require("electron-to-chromium/versions");
16+
import _fullVersions = require("electron-to-chromium/full-versions");
17+
import _chromiumVersions = require("electron-to-chromium/chromium-versions");
18+
import _fullChromiumVersions = require("electron-to-chromium/full-chromium-versions");
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const _default: Record<string, string>;
2+
export = _default;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const _default: Record<string, string>;
2+
export = _default;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* An object of key-value pairs with a major Electron version as the key,
3+
* and the corresponding major Chromium version as the value.
4+
*/
5+
export const versions: typeof import("./versions");
6+
/**
7+
* An object of key-value pairs with a Electron version as the key,
8+
* and the corresponding full Chromium version as the value.
9+
*/
10+
export const fullVersions: typeof import("./full-versions");
11+
/**
12+
* An object of key-value pairs with a major Chromium version as the key,
13+
* and the corresponding major Electron version as the value.
14+
*/
15+
export const chromiumVersions: typeof import("./chromium-versions");
16+
/**
17+
* An object of key-value pairs with a Chromium version as the key,
18+
* and an array of the corresponding major Electron versions as the value.
19+
*/
20+
export const fullChromiumVersions: typeof import("./full-chromium-versions");
21+
22+
/**
23+
* A function that returns the corresponding Chromium version for a given Electron function.
24+
* If you provide it with a major Electron version, it will return a major Chromium version.
25+
* If you provide it with a full Electron version, it will return the full Chromium version.
26+
* If a query does not match a Chromium version, it will return `undefined`.
27+
*/
28+
export function electronToChromium(query: string | number): string | undefined;
29+
30+
/**
31+
* Returns a string with the corresponding Electron version for a given Chromium query.
32+
* If you provide it with a major Chromium version, it will return a major Electron version.
33+
* If you provide it with a full Chrome version, it will return an array of full Electron versions.
34+
* If a query does not match an Electron version, it will return `undefined`.
35+
*/
36+
export function chromiumToElectron(query: string | number): string | undefined;
37+
38+
/**
39+
* @deprecated
40+
* A function that returns a {@link https://github.com/browserslist/browserslist Browserslist} query
41+
* that matches the given major Electron version.
42+
* If you provide it with a major Electron version,
43+
* it will return a Browserlist query string that matches the Chromium capabilities.
44+
* If a query does not match a Chromium version, it will return `undefined`.
45+
*/
46+
export function electronToBrowserList(query: string | number): string | undefined;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"private": true,
3+
"name": "@types/electron-to-chromium",
4+
"version": "1.5.9999",
5+
"projects": [
6+
"https://github.com/kilian/electron-to-chromium#readme"
7+
],
8+
"devDependencies": {
9+
"@types/electron-to-chromium": "workspace:."
10+
},
11+
"owners": [
12+
{
13+
"name": "Adam Thompson-Sharpe",
14+
"githubUsername": "MysteryBlokHed"
15+
}
16+
]
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"module": "node16",
4+
"lib": [
5+
"es6"
6+
],
7+
"noImplicitAny": true,
8+
"noImplicitThis": true,
9+
"strictFunctionTypes": true,
10+
"strictNullChecks": true,
11+
"types": [],
12+
"noEmit": true,
13+
"forceConsistentCasingInFileNames": true
14+
},
15+
"files": [
16+
"index.d.ts",
17+
"electron-to-chromium-tests.ts"
18+
]
19+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare const _default: Record<string, string>;
2+
export = _default;

0 commit comments

Comments
 (0)