From d425e9c7f0ac3a8e730e198c77d310053e8ca821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norbert=20Sz=C3=A9kely?= <60083754+sznorbert07@users.noreply.github.com> Date: Wed, 8 Apr 2026 18:35:16 +0200 Subject: [PATCH 01/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74815=20[goo?= =?UTF-8?q?gle-apps-script-oauth2]=20Update=20types=20for=20version=2043?= =?UTF-8?q?=20by=20@sznorbert07?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../google-apps-script-oauth2-tests.ts | 69 ++++++++++++++++++- types/google-apps-script-oauth2/index.d.ts | 32 +++++++++ types/google-apps-script-oauth2/package.json | 4 +- 3 files changed, 102 insertions(+), 3 deletions(-) diff --git a/types/google-apps-script-oauth2/google-apps-script-oauth2-tests.ts b/types/google-apps-script-oauth2/google-apps-script-oauth2-tests.ts index a4b767e003d1a0..f92d095c05cb06 100644 --- a/types/google-apps-script-oauth2/google-apps-script-oauth2-tests.ts +++ b/types/google-apps-script-oauth2/google-apps-script-oauth2-tests.ts @@ -1,4 +1,4 @@ -// Examples from https://github.com/googlesamples/apps-script-oauth2 +// Examples from https://github.com/googleworkspace/apps-script-oauth2 /** * Create the OAuth2 service. @@ -17,6 +17,73 @@ function getDriveService() { .setParam("approval_prompt", "force"); } +/** + * Create sample service for Twitter. + */ +function getTwitterService() { + const userProps = PropertiesService.getUserProperties(); + const clientId = "sampleClientId"; + const clientSecret = "sampleClientSecret"; + + return OAuth2.createService("Twitter") + .setAuthorizationBaseUrl("https://twitter.com/i/oauth2/authorize") + .setTokenUrl("https://api.twitter.com/2/oauth2/token") + .setClientId(clientId) + .setClientSecret(clientSecret) + .setCallbackFunction("authCallback") + .setPropertyStore(userProps) + .setScope("users.read tweet.read offline.access") + .generateCodeVerifier() + .setTokenHeaders({ + "Authorization": "Basic " + Utilities.base64Encode(clientId + ":" + clientSecret), + "Content-Type": "application/x-www-form-urlencoded", + }); +} + +/** + * Create sample service with custom token method. + */ +function getTestClientWithCustomTokenMethod() { + return OAuth2.createService("TestService") + .setAuthorizationBaseUrl("https://example.com/auth") + .setTokenUrl("https://example.com/token") + .setClientId("sampleClientId") + .setClientSecret("sampleClientSecret") + .setCallbackFunction("authCallback") + .setPropertyStore(PropertiesService.getUserProperties()) + .setTokenMethod("PUT"); +} + +/** + * Create sample service with code verifier and S256 code challenge method. + */ +function getTestClientWithAutoCodeVerifierAndS256ChallengeMethod() { + return OAuth2.createService("TestService") + .setAuthorizationBaseUrl("https://example.com/auth") + .setTokenUrl("https://example.com/token") + .setClientId("sampleClientId") + .setClientSecret("sampleClientSecret") + .setCallbackFunction("authCallback") + .setPropertyStore(PropertiesService.getUserProperties()) + .generateCodeVerifier() + .setCodeChallengeMethod(GoogleAppsScriptOAuth2.CodeChallengeMethod.S256); +} + +/** + * Create sample service with code verifier and S256 code challenge method. + */ +function getTestClientWithManualCodeVerifierAndPlainChallengeMethod() { + return OAuth2.createService("TestService") + .setAuthorizationBaseUrl("https://example.com/auth") + .setTokenUrl("https://example.com/token") + .setClientId("sampleClientId") + .setClientSecret("sampleClientSecret") + .setCallbackFunction("authCallback") + .setPropertyStore(PropertiesService.getUserProperties()) + .setCodeVerififer("sampleCodeVerifier") + .setCodeChallengeMethod(GoogleAppsScriptOAuth2.CodeChallengeMethod.PLAIN); +} + /** * Handle the callback. */ diff --git a/types/google-apps-script-oauth2/index.d.ts b/types/google-apps-script-oauth2/index.d.ts index ca70f3e969ec27..509ec16898c447 100644 --- a/types/google-apps-script-oauth2/index.d.ts +++ b/types/google-apps-script-oauth2/index.d.ts @@ -17,6 +17,13 @@ declare namespace GoogleAppsScriptOAuth2 { * Often this URI needs to be entered into a configuration screen of your OAuth provider. */ getRedirectUri(scriptId?: string): string; + /** + * Gets the list of services with tokens stored in the given property store. + * This is useful if you connect to the same API with multiple accounts and + * need to keep track of them. If no stored tokens are found this will return + * an empty array. + */ + getServiceNames(propertyStore: GoogleAppsScript.Properties.PropertiesService): string[]; } interface Storage { @@ -217,6 +224,26 @@ declare namespace GoogleAppsScriptOAuth2 { * For Google services this URL should be `https://accounts.google.com/o/oauth2/token`. */ setTokenUrl(tokenUrl: string): OAuth2Service; + /** + * Sets the HTTP method to use when retrieving or refreshing the access token. + * Default: `post`. + */ + setTokenMethod(tokenMethod: string): OAuth2Service; + /** + * Set the code verifier used for PKCE. For most use cases, + * prefer `generateCodeVerifier` to automatically initialize the + * value with a generated challenge string. + */ + setCodeVerififer(codeVerifier: string): OAuth2Service; + /** + * Sets the code verifier to a randomly generated challenge string. + */ + generateCodeVerifier(): OAuth2Service; + /** + * Set the code challenge method for PKCE. The default value method + * when a code verifier is set is `S256`. + */ + setCodeChallengeMethod(method: CodeChallengeMethod): OAuth2Service; } enum TokenFormat { @@ -230,6 +257,11 @@ declare namespace GoogleAppsScriptOAuth2 { FORM_URL_ENCODED = "application/x-www-form-urlencoded", } + enum CodeChallengeMethod { + S256 = "S256", + PLAIN = "plain", + } + interface TokenPayload { code: string; client_id: string; diff --git a/types/google-apps-script-oauth2/package.json b/types/google-apps-script-oauth2/package.json index 2edb31abb24c13..7678d53519c6d3 100644 --- a/types/google-apps-script-oauth2/package.json +++ b/types/google-apps-script-oauth2/package.json @@ -1,11 +1,11 @@ { "private": true, "name": "@types/google-apps-script-oauth2", - "version": "38.0.9999", + "version": "43.0.9999", "nonNpm": true, "nonNpmDescription": "google-apps-script-oauth2", "projects": [ - "https://github.com/googlesamples/apps-script-oauth2" + "https://github.com/googleworkspace/apps-script-oauth2" ], "dependencies": { "@types/google-apps-script": "*" From 1e54343f186db6b90e22afd8afc7dbbafadfa4c3 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:53:24 -0700 Subject: [PATCH 02/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74835=20[spd?= =?UTF-8?q?x-expression-parse]=20Update=20to=20v4,=20add=20missing=20excep?= =?UTF-8?q?tion=20field=20by=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-expression-parse/index.d.ts | 1 + types/spdx-expression-parse/package.json | 2 +- .../spdx-expression-parse/spdx-expression-parse-tests.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/types/spdx-expression-parse/index.d.ts b/types/spdx-expression-parse/index.d.ts index 27a1fde8191051..ff0b3d268b80e1 100644 --- a/types/spdx-expression-parse/index.d.ts +++ b/types/spdx-expression-parse/index.d.ts @@ -10,6 +10,7 @@ declare namespace parse { interface LicenseInfo { license: string; plus?: true | undefined; + exception?: string | undefined; } interface ConjunctionInfo { diff --git a/types/spdx-expression-parse/package.json b/types/spdx-expression-parse/package.json index ef72a0f686cc7d..3650d739c88647 100644 --- a/types/spdx-expression-parse/package.json +++ b/types/spdx-expression-parse/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/spdx-expression-parse", - "version": "3.0.9999", + "version": "4.0.9999", "projects": [ "https://github.com/jslicense/spdx-expression-parse.js#readme" ], diff --git a/types/spdx-expression-parse/spdx-expression-parse-tests.ts b/types/spdx-expression-parse/spdx-expression-parse-tests.ts index 5e4d8235e8b7b8..aff5b56697db03 100644 --- a/types/spdx-expression-parse/spdx-expression-parse-tests.ts +++ b/types/spdx-expression-parse/spdx-expression-parse-tests.ts @@ -22,6 +22,15 @@ const infos: Info[] = [ { license: "MIT", }, + { + license: "GPL-2.0-only", + exception: "Classpath-exception-2.0", + }, + { + license: "Apache-2.0", + plus: true, + exception: "LLVM-exception", + }, { left: { license: "MIT", From aa1a63427f9fdebfb36975c6db3d77a2aa7127c8 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:57:41 -0700 Subject: [PATCH 03/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74844=20[npm?= =?UTF-8?q?-license-corrections]=20Add=20type=20definitions=20for=20npm-li?= =?UTF-8?q?cense-corrections=20by=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/npm-license-corrections/.npmignore | 5 +++++ types/npm-license-corrections/index.d.ts | 8 ++++++++ .../npm-license-corrections-tests.ts | 15 +++++++++++++++ types/npm-license-corrections/package.json | 17 +++++++++++++++++ types/npm-license-corrections/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 types/npm-license-corrections/.npmignore create mode 100644 types/npm-license-corrections/index.d.ts create mode 100644 types/npm-license-corrections/npm-license-corrections-tests.ts create mode 100644 types/npm-license-corrections/package.json create mode 100644 types/npm-license-corrections/tsconfig.json diff --git a/types/npm-license-corrections/.npmignore b/types/npm-license-corrections/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/npm-license-corrections/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/npm-license-corrections/index.d.ts b/types/npm-license-corrections/index.d.ts new file mode 100644 index 00000000000000..5440ca499bd7d9 --- /dev/null +++ b/types/npm-license-corrections/index.d.ts @@ -0,0 +1,8 @@ +interface NpmLicenseCorrection { + name: string; + version: string; + license: string; +} + +declare const npmLicenseCorrections: NpmLicenseCorrection[]; +export = npmLicenseCorrections; diff --git a/types/npm-license-corrections/npm-license-corrections-tests.ts b/types/npm-license-corrections/npm-license-corrections-tests.ts new file mode 100644 index 00000000000000..1811b57e127e26 --- /dev/null +++ b/types/npm-license-corrections/npm-license-corrections-tests.ts @@ -0,0 +1,15 @@ +import npmLicenseCorrections = require("npm-license-corrections"); + +// $ExpectType NpmLicenseCorrection[] +npmLicenseCorrections; + +const correction = npmLicenseCorrections[0]; + +// $ExpectType string +correction.name; + +// $ExpectType string +correction.version; + +// $ExpectType string +correction.license; diff --git a/types/npm-license-corrections/package.json b/types/npm-license-corrections/package.json new file mode 100644 index 00000000000000..c77d3f5eeed53a --- /dev/null +++ b/types/npm-license-corrections/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/npm-license-corrections", + "version": "1.9.9999", + "projects": [ + "https://github.com/jslicense/npm-license-corrections.json" + ], + "devDependencies": { + "@types/npm-license-corrections": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/npm-license-corrections/tsconfig.json b/types/npm-license-corrections/tsconfig.json new file mode 100644 index 00000000000000..000f4a5a5fbace --- /dev/null +++ b/types/npm-license-corrections/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npm-license-corrections-tests.ts" + ] +} From 825be079dd8081516703560e8392f4a020556fce Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:57:58 -0700 Subject: [PATCH 04/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74845=20[spd?= =?UTF-8?q?x-expression-validate=20Add=20type=20definitions=20for=20spdx-e?= =?UTF-8?q?xpression-validate=20by=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-expression-validate/.npmignore | 5 +++++ types/spdx-expression-validate/index.d.ts | 2 ++ types/spdx-expression-validate/package.json | 17 +++++++++++++++++ .../spdx-expression-validate-tests.ts | 10 ++++++++++ types/spdx-expression-validate/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 53 insertions(+) create mode 100644 types/spdx-expression-validate/.npmignore create mode 100644 types/spdx-expression-validate/index.d.ts create mode 100644 types/spdx-expression-validate/package.json create mode 100644 types/spdx-expression-validate/spdx-expression-validate-tests.ts create mode 100644 types/spdx-expression-validate/tsconfig.json diff --git a/types/spdx-expression-validate/.npmignore b/types/spdx-expression-validate/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-expression-validate/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-expression-validate/index.d.ts b/types/spdx-expression-validate/index.d.ts new file mode 100644 index 00000000000000..b2e498c9f0bfa2 --- /dev/null +++ b/types/spdx-expression-validate/index.d.ts @@ -0,0 +1,2 @@ +declare function spdxExpressionValidate(expression: string): boolean; +export = spdxExpressionValidate; diff --git a/types/spdx-expression-validate/package.json b/types/spdx-expression-validate/package.json new file mode 100644 index 00000000000000..7c2e305b6de8d5 --- /dev/null +++ b/types/spdx-expression-validate/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/spdx-expression-validate", + "version": "2.0.9999", + "projects": [ + "https://github.com/jslicense/spdx-expression-validate.js" + ], + "devDependencies": { + "@types/spdx-expression-validate": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-expression-validate/spdx-expression-validate-tests.ts b/types/spdx-expression-validate/spdx-expression-validate-tests.ts new file mode 100644 index 00000000000000..f26a9780c857cd --- /dev/null +++ b/types/spdx-expression-validate/spdx-expression-validate-tests.ts @@ -0,0 +1,10 @@ +import spdxExpressionValidate = require("spdx-expression-validate"); + +// $ExpectType boolean +spdxExpressionValidate("MIT"); + +// $ExpectType boolean +spdxExpressionValidate("(MIT OR Apache-2.0)"); + +// $ExpectType boolean +spdxExpressionValidate("Invalid-Identifier"); diff --git a/types/spdx-expression-validate/tsconfig.json b/types/spdx-expression-validate/tsconfig.json new file mode 100644 index 00000000000000..5a5f7778f804a9 --- /dev/null +++ b/types/spdx-expression-validate/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-expression-validate-tests.ts" + ] +} From aa1359fe0794b76b7d427bd3f34541a607924702 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:58:09 -0700 Subject: [PATCH 05/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74843=20[spd?= =?UTF-8?q?x-id-to-url]=20Add=20type=20definitions=20for=20spdx-id-to-url?= =?UTF-8?q?=20by=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-id-to-url/.npmignore | 5 +++++ types/spdx-id-to-url/index.d.ts | 2 ++ types/spdx-id-to-url/package.json | 17 +++++++++++++++++ types/spdx-id-to-url/spdx-id-to-url-tests.ts | 7 +++++++ types/spdx-id-to-url/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 types/spdx-id-to-url/.npmignore create mode 100644 types/spdx-id-to-url/index.d.ts create mode 100644 types/spdx-id-to-url/package.json create mode 100644 types/spdx-id-to-url/spdx-id-to-url-tests.ts create mode 100644 types/spdx-id-to-url/tsconfig.json diff --git a/types/spdx-id-to-url/.npmignore b/types/spdx-id-to-url/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-id-to-url/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-id-to-url/index.d.ts b/types/spdx-id-to-url/index.d.ts new file mode 100644 index 00000000000000..19d8b629b2ac43 --- /dev/null +++ b/types/spdx-id-to-url/index.d.ts @@ -0,0 +1,2 @@ +declare function spdxIdToUrl(id: string): string; +export = spdxIdToUrl; diff --git a/types/spdx-id-to-url/package.json b/types/spdx-id-to-url/package.json new file mode 100644 index 00000000000000..986811024b5e8c --- /dev/null +++ b/types/spdx-id-to-url/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/spdx-id-to-url", + "version": "1.0.9999", + "projects": [ + "https://github.com/jslicense/spdx-id-to-url.js" + ], + "devDependencies": { + "@types/spdx-id-to-url": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-id-to-url/spdx-id-to-url-tests.ts b/types/spdx-id-to-url/spdx-id-to-url-tests.ts new file mode 100644 index 00000000000000..e0919101d52507 --- /dev/null +++ b/types/spdx-id-to-url/spdx-id-to-url-tests.ts @@ -0,0 +1,7 @@ +import spdxIdToUrl = require("spdx-id-to-url"); + +// $ExpectType string +spdxIdToUrl("MIT"); + +// $ExpectType string +spdxIdToUrl("Apache-2.0"); diff --git a/types/spdx-id-to-url/tsconfig.json b/types/spdx-id-to-url/tsconfig.json new file mode 100644 index 00000000000000..a866a6f5650268 --- /dev/null +++ b/types/spdx-id-to-url/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-id-to-url-tests.ts" + ] +} From b5d0c4ca923b0b277a147d7fe8cd75ce4918c26e Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:58:21 -0700 Subject: [PATCH 06/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74837=20[spd?= =?UTF-8?q?x-exceptions]=20Add=20type=20definitions=20for=20spdx-exception?= =?UTF-8?q?s=20by=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-exceptions/.npmignore | 5 +++++ types/spdx-exceptions/deprecated.d.ts | 2 ++ types/spdx-exceptions/index.d.ts | 4 ++++ types/spdx-exceptions/package.json | 17 +++++++++++++++++ .../spdx-exceptions/spdx-exceptions-tests.ts | 8 ++++++++ types/spdx-exceptions/tsconfig.json | 19 +++++++++++++++++++ 6 files changed, 55 insertions(+) create mode 100644 types/spdx-exceptions/.npmignore create mode 100644 types/spdx-exceptions/deprecated.d.ts create mode 100644 types/spdx-exceptions/index.d.ts create mode 100644 types/spdx-exceptions/package.json create mode 100644 types/spdx-exceptions/spdx-exceptions-tests.ts create mode 100644 types/spdx-exceptions/tsconfig.json diff --git a/types/spdx-exceptions/.npmignore b/types/spdx-exceptions/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-exceptions/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-exceptions/deprecated.d.ts b/types/spdx-exceptions/deprecated.d.ts new file mode 100644 index 00000000000000..4a816354925cde --- /dev/null +++ b/types/spdx-exceptions/deprecated.d.ts @@ -0,0 +1,2 @@ +declare const deprecatedSpdxExceptions: string[]; +export = deprecatedSpdxExceptions; diff --git a/types/spdx-exceptions/index.d.ts b/types/spdx-exceptions/index.d.ts new file mode 100644 index 00000000000000..27a248ee681680 --- /dev/null +++ b/types/spdx-exceptions/index.d.ts @@ -0,0 +1,4 @@ +/// + +declare const spdxExceptions: string[]; +export = spdxExceptions; diff --git a/types/spdx-exceptions/package.json b/types/spdx-exceptions/package.json new file mode 100644 index 00000000000000..0a40ea47a01816 --- /dev/null +++ b/types/spdx-exceptions/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/spdx-exceptions", + "version": "2.5.9999", + "projects": [ + "https://github.com/jslicense/spdx-exceptions.json" + ], + "devDependencies": { + "@types/spdx-exceptions": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-exceptions/spdx-exceptions-tests.ts b/types/spdx-exceptions/spdx-exceptions-tests.ts new file mode 100644 index 00000000000000..96ef0d1c0f4467 --- /dev/null +++ b/types/spdx-exceptions/spdx-exceptions-tests.ts @@ -0,0 +1,8 @@ +import spdxExceptions = require("spdx-exceptions"); +import deprecatedExceptions = require("spdx-exceptions/deprecated"); + +// $ExpectType string[] +spdxExceptions; + +// $ExpectType string[] +deprecatedExceptions; diff --git a/types/spdx-exceptions/tsconfig.json b/types/spdx-exceptions/tsconfig.json new file mode 100644 index 00000000000000..524f3e56e38cba --- /dev/null +++ b/types/spdx-exceptions/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-exceptions-tests.ts" + ] +} From 04d84e0d1780cd5c2be487bd6e02a6a00f434769 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:58:36 -0700 Subject: [PATCH 07/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74842=20[spd?= =?UTF-8?q?x-is-osi]=20Add=20type=20definitions=20for=20spdx-is-osi=20by?= =?UTF-8?q?=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-is-osi/.npmignore | 5 +++++ types/spdx-is-osi/index.d.ts | 2 ++ types/spdx-is-osi/package.json | 17 +++++++++++++++++ types/spdx-is-osi/spdx-is-osi-tests.ts | 7 +++++++ types/spdx-is-osi/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 types/spdx-is-osi/.npmignore create mode 100644 types/spdx-is-osi/index.d.ts create mode 100644 types/spdx-is-osi/package.json create mode 100644 types/spdx-is-osi/spdx-is-osi-tests.ts create mode 100644 types/spdx-is-osi/tsconfig.json diff --git a/types/spdx-is-osi/.npmignore b/types/spdx-is-osi/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-is-osi/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-is-osi/index.d.ts b/types/spdx-is-osi/index.d.ts new file mode 100644 index 00000000000000..602a80a61c23e7 --- /dev/null +++ b/types/spdx-is-osi/index.d.ts @@ -0,0 +1,2 @@ +declare function spdxIsOsi(expression: string): boolean; +export = spdxIsOsi; diff --git a/types/spdx-is-osi/package.json b/types/spdx-is-osi/package.json new file mode 100644 index 00000000000000..d144405dce11d3 --- /dev/null +++ b/types/spdx-is-osi/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/spdx-is-osi", + "version": "1.0.9999", + "projects": [ + "https://github.com/jslicense/spdx-is-osi.js" + ], + "devDependencies": { + "@types/spdx-is-osi": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-is-osi/spdx-is-osi-tests.ts b/types/spdx-is-osi/spdx-is-osi-tests.ts new file mode 100644 index 00000000000000..8a74d67c3088da --- /dev/null +++ b/types/spdx-is-osi/spdx-is-osi-tests.ts @@ -0,0 +1,7 @@ +import spdxIsOsi = require("spdx-is-osi"); + +// $ExpectType boolean +spdxIsOsi("MIT"); + +// $ExpectType boolean +spdxIsOsi("(MIT OR Apache-2.0)"); diff --git a/types/spdx-is-osi/tsconfig.json b/types/spdx-is-osi/tsconfig.json new file mode 100644 index 00000000000000..49e7e7cdb10b72 --- /dev/null +++ b/types/spdx-is-osi/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-is-osi-tests.ts" + ] +} From ece903b27ea8a9d5704c9466cc561da891961e45 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:58:39 -0700 Subject: [PATCH 08/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74841=20[spd?= =?UTF-8?q?x-ranges]=20Add=20type=20definitions=20for=20spdx-ranges=20by?= =?UTF-8?q?=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-ranges/.npmignore | 5 +++++ types/spdx-ranges/index.d.ts | 2 ++ types/spdx-ranges/package.json | 17 +++++++++++++++++ types/spdx-ranges/spdx-ranges-tests.ts | 9 +++++++++ types/spdx-ranges/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 52 insertions(+) create mode 100644 types/spdx-ranges/.npmignore create mode 100644 types/spdx-ranges/index.d.ts create mode 100644 types/spdx-ranges/package.json create mode 100644 types/spdx-ranges/spdx-ranges-tests.ts create mode 100644 types/spdx-ranges/tsconfig.json diff --git a/types/spdx-ranges/.npmignore b/types/spdx-ranges/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-ranges/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-ranges/index.d.ts b/types/spdx-ranges/index.d.ts new file mode 100644 index 00000000000000..47a04eaffbda46 --- /dev/null +++ b/types/spdx-ranges/index.d.ts @@ -0,0 +1,2 @@ +declare const spdxRanges: Array>; +export = spdxRanges; diff --git a/types/spdx-ranges/package.json b/types/spdx-ranges/package.json new file mode 100644 index 00000000000000..fda2a26d369b48 --- /dev/null +++ b/types/spdx-ranges/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/spdx-ranges", + "version": "2.1.9999", + "projects": [ + "https://github.com/jslicense/spdx-ranges.js" + ], + "devDependencies": { + "@types/spdx-ranges": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-ranges/spdx-ranges-tests.ts b/types/spdx-ranges/spdx-ranges-tests.ts new file mode 100644 index 00000000000000..6b99376f9438ba --- /dev/null +++ b/types/spdx-ranges/spdx-ranges-tests.ts @@ -0,0 +1,9 @@ +import spdxRanges = require("spdx-ranges"); + +// $ExpectType (string | string[])[][] +spdxRanges; + +const range = spdxRanges[0]; + +// $ExpectType (string | string[])[] +range; diff --git a/types/spdx-ranges/tsconfig.json b/types/spdx-ranges/tsconfig.json new file mode 100644 index 00000000000000..e084c1e0e5442d --- /dev/null +++ b/types/spdx-ranges/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-ranges-tests.ts" + ] +} From c42a3ff9f9152e6c317676ce5719c060273256cc Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:58:55 -0700 Subject: [PATCH 09/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74838=20[spd?= =?UTF-8?q?x-to-html]=20Add=20type=20definitions=20for=20spdx-to-html=20by?= =?UTF-8?q?=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-to-html/.npmignore | 5 +++++ types/spdx-to-html/index.d.ts | 2 ++ types/spdx-to-html/package.json | 17 +++++++++++++++++ types/spdx-to-html/spdx-to-html-tests.ts | 10 ++++++++++ types/spdx-to-html/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 53 insertions(+) create mode 100644 types/spdx-to-html/.npmignore create mode 100644 types/spdx-to-html/index.d.ts create mode 100644 types/spdx-to-html/package.json create mode 100644 types/spdx-to-html/spdx-to-html-tests.ts create mode 100644 types/spdx-to-html/tsconfig.json diff --git a/types/spdx-to-html/.npmignore b/types/spdx-to-html/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-to-html/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-to-html/index.d.ts b/types/spdx-to-html/index.d.ts new file mode 100644 index 00000000000000..6920b5a3954b62 --- /dev/null +++ b/types/spdx-to-html/index.d.ts @@ -0,0 +1,2 @@ +declare function spdxToHtml(expression: string): string | null; +export = spdxToHtml; diff --git a/types/spdx-to-html/package.json b/types/spdx-to-html/package.json new file mode 100644 index 00000000000000..266a500f55c5f0 --- /dev/null +++ b/types/spdx-to-html/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/spdx-to-html", + "version": "1.0.9999", + "projects": [ + "https://github.com/jslicense/spdx-to-html.js" + ], + "devDependencies": { + "@types/spdx-to-html": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-to-html/spdx-to-html-tests.ts b/types/spdx-to-html/spdx-to-html-tests.ts new file mode 100644 index 00000000000000..c68145e1517c16 --- /dev/null +++ b/types/spdx-to-html/spdx-to-html-tests.ts @@ -0,0 +1,10 @@ +import spdxToHtml = require("spdx-to-html"); + +// $ExpectType string | null +spdxToHtml("MIT"); + +// $ExpectType string | null +spdxToHtml("(MIT OR Apache-2.0)"); + +// $ExpectType string | null +spdxToHtml("Invalid-Expression"); diff --git a/types/spdx-to-html/tsconfig.json b/types/spdx-to-html/tsconfig.json new file mode 100644 index 00000000000000..e21ef51dd4d290 --- /dev/null +++ b/types/spdx-to-html/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-to-html-tests.ts" + ] +} From 141bb4d3fdb48bf9808c1b3bdffe3368dbbc8808 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:59:10 -0700 Subject: [PATCH 10/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74839=20[spd?= =?UTF-8?q?x-copyleft]=20Add=20type=20definitions=20for=20spdx-copyleft=20?= =?UTF-8?q?by=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-copyleft/.npmignore | 5 +++++ types/spdx-copyleft/index.d.ts | 2 ++ types/spdx-copyleft/package.json | 17 +++++++++++++++++ types/spdx-copyleft/spdx-copyleft-tests.ts | 4 ++++ types/spdx-copyleft/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 47 insertions(+) create mode 100644 types/spdx-copyleft/.npmignore create mode 100644 types/spdx-copyleft/index.d.ts create mode 100644 types/spdx-copyleft/package.json create mode 100644 types/spdx-copyleft/spdx-copyleft-tests.ts create mode 100644 types/spdx-copyleft/tsconfig.json diff --git a/types/spdx-copyleft/.npmignore b/types/spdx-copyleft/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-copyleft/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-copyleft/index.d.ts b/types/spdx-copyleft/index.d.ts new file mode 100644 index 00000000000000..3014f900e5c272 --- /dev/null +++ b/types/spdx-copyleft/index.d.ts @@ -0,0 +1,2 @@ +declare const spdxCopyleft: string[]; +export = spdxCopyleft; diff --git a/types/spdx-copyleft/package.json b/types/spdx-copyleft/package.json new file mode 100644 index 00000000000000..1931dd3dff3d7a --- /dev/null +++ b/types/spdx-copyleft/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/spdx-copyleft", + "version": "1.0.9999", + "projects": [ + "https://github.com/jslicense/spdx-copyleft.json" + ], + "devDependencies": { + "@types/spdx-copyleft": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-copyleft/spdx-copyleft-tests.ts b/types/spdx-copyleft/spdx-copyleft-tests.ts new file mode 100644 index 00000000000000..7378108abfa04d --- /dev/null +++ b/types/spdx-copyleft/spdx-copyleft-tests.ts @@ -0,0 +1,4 @@ +import spdxCopyleft = require("spdx-copyleft"); + +// $ExpectType string[] +spdxCopyleft; diff --git a/types/spdx-copyleft/tsconfig.json b/types/spdx-copyleft/tsconfig.json new file mode 100644 index 00000000000000..e36b8155abac8c --- /dev/null +++ b/types/spdx-copyleft/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-copyleft-tests.ts" + ] +} From e5fd33d92cc77fd1354007901d1b90eccae50b99 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 11:59:24 -0700 Subject: [PATCH 11/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74836=20[spd?= =?UTF-8?q?x-osi]=20Add=20type=20definitions=20for=20spdx-osi=20by=20@Jami?= =?UTF-8?q?eMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-osi/.npmignore | 5 +++++ types/spdx-osi/index.d.ts | 2 ++ types/spdx-osi/package.json | 17 +++++++++++++++++ types/spdx-osi/spdx-osi-tests.ts | 4 ++++ types/spdx-osi/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 47 insertions(+) create mode 100644 types/spdx-osi/.npmignore create mode 100644 types/spdx-osi/index.d.ts create mode 100644 types/spdx-osi/package.json create mode 100644 types/spdx-osi/spdx-osi-tests.ts create mode 100644 types/spdx-osi/tsconfig.json diff --git a/types/spdx-osi/.npmignore b/types/spdx-osi/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-osi/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-osi/index.d.ts b/types/spdx-osi/index.d.ts new file mode 100644 index 00000000000000..8354a6480c3334 --- /dev/null +++ b/types/spdx-osi/index.d.ts @@ -0,0 +1,2 @@ +declare const spdxOsi: string[]; +export = spdxOsi; diff --git a/types/spdx-osi/package.json b/types/spdx-osi/package.json new file mode 100644 index 00000000000000..cdb4f9e9396e2b --- /dev/null +++ b/types/spdx-osi/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/spdx-osi", + "version": "3.0.9999", + "projects": [ + "https://github.com/jslicense/spdx-osi.json" + ], + "devDependencies": { + "@types/spdx-osi": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-osi/spdx-osi-tests.ts b/types/spdx-osi/spdx-osi-tests.ts new file mode 100644 index 00000000000000..462b9c6b66317f --- /dev/null +++ b/types/spdx-osi/spdx-osi-tests.ts @@ -0,0 +1,4 @@ +import spdxOsi = require("spdx-osi"); + +// $ExpectType string[] +spdxOsi; diff --git a/types/spdx-osi/tsconfig.json b/types/spdx-osi/tsconfig.json new file mode 100644 index 00000000000000..671dc5235a027d --- /dev/null +++ b/types/spdx-osi/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-osi-tests.ts" + ] +} From 44a71eebd1fa4665be585d990fa1e9d375b41c78 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 12:10:04 -0700 Subject: [PATCH 12/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74840=20[cor?= =?UTF-8?q?rect-license-metadata]=20Add=20type=20definitions=20for=20corre?= =?UTF-8?q?ct-license-metadata=20by=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/correct-license-metadata/.npmignore | 5 +++++ .../correct-license-metadata-tests.ts | 16 ++++++++++++++++ types/correct-license-metadata/index.d.ts | 14 ++++++++++++++ types/correct-license-metadata/package.json | 17 +++++++++++++++++ types/correct-license-metadata/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 types/correct-license-metadata/.npmignore create mode 100644 types/correct-license-metadata/correct-license-metadata-tests.ts create mode 100644 types/correct-license-metadata/index.d.ts create mode 100644 types/correct-license-metadata/package.json create mode 100644 types/correct-license-metadata/tsconfig.json diff --git a/types/correct-license-metadata/.npmignore b/types/correct-license-metadata/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/correct-license-metadata/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/correct-license-metadata/correct-license-metadata-tests.ts b/types/correct-license-metadata/correct-license-metadata-tests.ts new file mode 100644 index 00000000000000..ea248e8980456e --- /dev/null +++ b/types/correct-license-metadata/correct-license-metadata-tests.ts @@ -0,0 +1,16 @@ +import correctLicenseMetadata = require("correct-license-metadata"); + +// $ExpectType string | false +correctLicenseMetadata({ license: "MIT" }); + +// $ExpectType string | false +correctLicenseMetadata({ licenses: [{ type: "MIT" }] }); + +// $ExpectType string | false +correctLicenseMetadata({ license: "Apache 2" }); + +// $ExpectType string | false +correctLicenseMetadata({ licenses: ["MIT"] }); + +// @ts-expect-error +correctLicenseMetadata("MIT"); diff --git a/types/correct-license-metadata/index.d.ts b/types/correct-license-metadata/index.d.ts new file mode 100644 index 00000000000000..7eddc143cb3a7e --- /dev/null +++ b/types/correct-license-metadata/index.d.ts @@ -0,0 +1,14 @@ +declare function correctLicenseMetadata(metadata: correctLicenseMetadata.PackageMetadata): string | false; + +declare namespace correctLicenseMetadata { + interface PackageMetadata { + license?: string | { type?: string; license?: string } | undefined; + licenses?: + | Array + | string + | { type?: string; license?: string } + | undefined; + } +} + +export = correctLicenseMetadata; diff --git a/types/correct-license-metadata/package.json b/types/correct-license-metadata/package.json new file mode 100644 index 00000000000000..633b6993c32b0f --- /dev/null +++ b/types/correct-license-metadata/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/correct-license-metadata", + "version": "1.5.9999", + "projects": [ + "https://github.com/jslicense/correct-license-metadata.js" + ], + "devDependencies": { + "@types/correct-license-metadata": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/correct-license-metadata/tsconfig.json b/types/correct-license-metadata/tsconfig.json new file mode 100644 index 00000000000000..caebd724a2c153 --- /dev/null +++ b/types/correct-license-metadata/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "correct-license-metadata-tests.ts" + ] +} From c4936e98e8365aae8117544ffd081b342110a466 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 14:01:13 -0700 Subject: [PATCH 13/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74858=20[lic?= =?UTF-8?q?ensee]=20Add=20type=20definitions=20for=20licensee=20by=20@Jami?= =?UTF-8?q?eMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/licensee/.npmignore | 5 +++ types/licensee/index.d.ts | 55 ++++++++++++++++++++++++++ types/licensee/licensee-tests.ts | 67 ++++++++++++++++++++++++++++++++ types/licensee/package.json | 17 ++++++++ types/licensee/tsconfig.json | 19 +++++++++ 5 files changed, 163 insertions(+) create mode 100644 types/licensee/.npmignore create mode 100644 types/licensee/index.d.ts create mode 100644 types/licensee/licensee-tests.ts create mode 100644 types/licensee/package.json create mode 100644 types/licensee/tsconfig.json diff --git a/types/licensee/.npmignore b/types/licensee/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/licensee/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/licensee/index.d.ts b/types/licensee/index.d.ts new file mode 100644 index 00000000000000..51af56b6b74c7f --- /dev/null +++ b/types/licensee/index.d.ts @@ -0,0 +1,55 @@ +declare function licensee( + configuration: licensee.Configuration, + path: string, + callback: (error: Error | null, results?: licensee.Result[]) => void, +): void; + +declare namespace licensee { + interface LicensesConfiguration { + spdx?: string[] | undefined; + blueOak?: string | undefined; + osi?: boolean | undefined; + } + + interface IgnoreScope { + scope: string; + } + + interface IgnorePrefix { + prefix: string; + } + + interface IgnoreAuthor { + author: string; + } + + type IgnoreRule = IgnoreScope | IgnorePrefix | IgnoreAuthor; + + interface Configuration { + licenses: LicensesConfiguration; + packages?: Record | undefined; + corrections?: boolean | undefined; + ignore?: IgnoreRule[] | undefined; + productionOnly?: boolean | undefined; + filterPackages?: ((dependencies: any[]) => any[]) | undefined; + } + + interface Result { + name: string; + version: string; + license: string; + author: any; + contributors: any; + repository: any; + homepage: string; + parent: any; + path: string; + approved: boolean; + corrected?: "manual" | "automatic" | undefined; + ignored?: boolean | undefined; + package?: boolean | undefined; + duplicates?: Result[] | undefined; + } +} + +export = licensee; diff --git a/types/licensee/licensee-tests.ts b/types/licensee/licensee-tests.ts new file mode 100644 index 00000000000000..618dd3009e51aa --- /dev/null +++ b/types/licensee/licensee-tests.ts @@ -0,0 +1,67 @@ +import licensee = require("licensee"); + +const configuration: licensee.Configuration = { + licenses: { + spdx: ["MIT", "BSD-2-Clause", "BSD-3-Clause", "Apache-2.0"], + }, + packages: { + optimist: "<=0.6.1", + }, + corrections: true, + ignore: [ + { scope: "kemitchell" }, + { prefix: "commonform-" }, + { author: "Kyle E. Mitchell" }, + ], +}; + +licensee(configuration, "/path/to/package", (error, results) => { + if (error) { + return; + } + if (results) { + const result: licensee.Result = results[0]; + } +}); + +const exampleResult: licensee.Result = { + name: "example", + version: "1.0.0", + license: "MIT", + author: null, + contributors: null, + repository: null, + homepage: "", + parent: null, + path: "/path", + approved: true, +}; + +// $ExpectType string +exampleResult.name; + +// $ExpectType string +exampleResult.version; + +// $ExpectType string +exampleResult.license; + +// $ExpectType boolean +exampleResult.approved; + +const blueOakConfig: licensee.Configuration = { + licenses: { + blueOak: "bronze", + }, +}; + +const osiConfig: licensee.Configuration = { + licenses: { + spdx: ["CC-BY-4.0"], + blueOak: "gold", + osi: true, + }, + productionOnly: true, +}; + +licensee(osiConfig, ".", (err, results) => {}); diff --git a/types/licensee/package.json b/types/licensee/package.json new file mode 100644 index 00000000000000..98632f50814686 --- /dev/null +++ b/types/licensee/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/licensee", + "version": "12.0.9999", + "projects": [ + "https://github.com/jslicense/licensee.js" + ], + "devDependencies": { + "@types/licensee": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/licensee/tsconfig.json b/types/licensee/tsconfig.json new file mode 100644 index 00000000000000..618a54d10fd5f1 --- /dev/null +++ b/types/licensee/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "licensee-tests.ts" + ] +} From 90dea4c40c59310df3c50a0c736b25ffa62d90d2 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 14:01:18 -0700 Subject: [PATCH 14/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74859=20[spd?= =?UTF-8?q?x-compare]=20Add=20type=20definitions=20for=20spdx-compare=20by?= =?UTF-8?q?=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-compare/.npmignore | 5 +++++ types/spdx-compare/index.d.ts | 3 +++ types/spdx-compare/package.json | 17 +++++++++++++++++ types/spdx-compare/spdx-compare-tests.ts | 10 ++++++++++ types/spdx-compare/tsconfig.json | 19 +++++++++++++++++++ 5 files changed, 54 insertions(+) create mode 100644 types/spdx-compare/.npmignore create mode 100644 types/spdx-compare/index.d.ts create mode 100644 types/spdx-compare/package.json create mode 100644 types/spdx-compare/spdx-compare-tests.ts create mode 100644 types/spdx-compare/tsconfig.json diff --git a/types/spdx-compare/.npmignore b/types/spdx-compare/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-compare/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-compare/index.d.ts b/types/spdx-compare/index.d.ts new file mode 100644 index 00000000000000..1ea651afa8d85e --- /dev/null +++ b/types/spdx-compare/index.d.ts @@ -0,0 +1,3 @@ +export function gt(first: string, second: string): boolean; +export function lt(first: string, second: string): boolean; +export function eq(first: string, second: string): boolean; diff --git a/types/spdx-compare/package.json b/types/spdx-compare/package.json new file mode 100644 index 00000000000000..d26db30e57616d --- /dev/null +++ b/types/spdx-compare/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/spdx-compare", + "version": "1.0.9999", + "projects": [ + "https://github.com/jslicense/spdx-compare.js" + ], + "devDependencies": { + "@types/spdx-compare": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-compare/spdx-compare-tests.ts b/types/spdx-compare/spdx-compare-tests.ts new file mode 100644 index 00000000000000..e21ef0c2db7b7e --- /dev/null +++ b/types/spdx-compare/spdx-compare-tests.ts @@ -0,0 +1,10 @@ +import { eq, gt, lt } from "spdx-compare"; + +// $ExpectType boolean +gt("GPL-3.0", "GPL-2.0"); + +// $ExpectType boolean +lt("GPL-2.0", "GPL-3.0"); + +// $ExpectType boolean +eq("GPL-2.0", "GPL-2.0"); diff --git a/types/spdx-compare/tsconfig.json b/types/spdx-compare/tsconfig.json new file mode 100644 index 00000000000000..cb11641f264ba9 --- /dev/null +++ b/types/spdx-compare/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-compare-tests.ts" + ] +} From 45a53d8c1a1221b4648a587d92a97426dc6f908d Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 8 Apr 2026 14:01:36 -0700 Subject: [PATCH 15/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74860=20[spd?= =?UTF-8?q?x-whitelisted]=20Add=20type=20definitions=20for=20spdx-whitelis?= =?UTF-8?q?ted=20by=20@JamieMagee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-whitelisted/.npmignore | 5 +++++ types/spdx-whitelisted/index.d.ts | 8 ++++++++ types/spdx-whitelisted/package.json | 20 +++++++++++++++++++ .../spdx-whitelisted-tests.ts | 20 +++++++++++++++++++ types/spdx-whitelisted/tsconfig.json | 19 ++++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 types/spdx-whitelisted/.npmignore create mode 100644 types/spdx-whitelisted/index.d.ts create mode 100644 types/spdx-whitelisted/package.json create mode 100644 types/spdx-whitelisted/spdx-whitelisted-tests.ts create mode 100644 types/spdx-whitelisted/tsconfig.json diff --git a/types/spdx-whitelisted/.npmignore b/types/spdx-whitelisted/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/spdx-whitelisted/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/spdx-whitelisted/index.d.ts b/types/spdx-whitelisted/index.d.ts new file mode 100644 index 00000000000000..a2e93b35e184d2 --- /dev/null +++ b/types/spdx-whitelisted/index.d.ts @@ -0,0 +1,8 @@ +import type { ConjunctionInfo, LicenseInfo } from "spdx-expression-parse"; + +declare function spdxWhitelisted( + first: LicenseInfo | ConjunctionInfo, + second: LicenseInfo[], +): boolean; + +export = spdxWhitelisted; diff --git a/types/spdx-whitelisted/package.json b/types/spdx-whitelisted/package.json new file mode 100644 index 00000000000000..47d9ac22bbd6a1 --- /dev/null +++ b/types/spdx-whitelisted/package.json @@ -0,0 +1,20 @@ +{ + "private": true, + "name": "@types/spdx-whitelisted", + "version": "1.0.9999", + "projects": [ + "https://github.com/jslicense/spdx-whitelisted.js" + ], + "dependencies": { + "@types/spdx-expression-parse": "*" + }, + "devDependencies": { + "@types/spdx-whitelisted": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] +} diff --git a/types/spdx-whitelisted/spdx-whitelisted-tests.ts b/types/spdx-whitelisted/spdx-whitelisted-tests.ts new file mode 100644 index 00000000000000..abcc04da0c2009 --- /dev/null +++ b/types/spdx-whitelisted/spdx-whitelisted-tests.ts @@ -0,0 +1,20 @@ +import spdxWhitelisted = require("spdx-whitelisted"); +import parse = require("spdx-expression-parse"); + +// $ExpectType boolean +spdxWhitelisted({ license: "MIT" }, [{ license: "MIT" }]); + +// $ExpectType boolean +spdxWhitelisted(parse("MIT"), [ + parse("ISC") as parse.LicenseInfo, + parse("MIT") as parse.LicenseInfo, +]); + +// $ExpectType boolean +spdxWhitelisted({ license: "GPL-3.0" }, [{ license: "GPL-2.0", plus: true }]); + +// $ExpectType boolean +spdxWhitelisted( + { conjunction: "or", left: { license: "MIT" }, right: { license: "ISC" } }, + [{ license: "MIT" }], +); diff --git a/types/spdx-whitelisted/tsconfig.json b/types/spdx-whitelisted/tsconfig.json new file mode 100644 index 00000000000000..c399eb3d08dfb3 --- /dev/null +++ b/types/spdx-whitelisted/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-whitelisted-tests.ts" + ] +} From 2de9b746ba3f62c27737538534602708f74a1ce1 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 8 Apr 2026 21:02:34 +0000 Subject: [PATCH 16/18] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/spdx-compare/package.json | 30 ++++++++++++++-------------- types/spdx-compare/tsconfig.json | 34 ++++++++++++++++---------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/types/spdx-compare/package.json b/types/spdx-compare/package.json index d26db30e57616d..6a0e08212a41c1 100644 --- a/types/spdx-compare/package.json +++ b/types/spdx-compare/package.json @@ -1,17 +1,17 @@ { - "private": true, - "name": "@types/spdx-compare", - "version": "1.0.9999", - "projects": [ - "https://github.com/jslicense/spdx-compare.js" - ], - "devDependencies": { - "@types/spdx-compare": "workspace:." - }, - "owners": [ - { - "name": "Jamie Magee", - "githubUsername": "JamieMagee" - } - ] + "private": true, + "name": "@types/spdx-compare", + "version": "1.0.9999", + "projects": [ + "https://github.com/jslicense/spdx-compare.js" + ], + "devDependencies": { + "@types/spdx-compare": "workspace:." + }, + "owners": [ + { + "name": "Jamie Magee", + "githubUsername": "JamieMagee" + } + ] } diff --git a/types/spdx-compare/tsconfig.json b/types/spdx-compare/tsconfig.json index cb11641f264ba9..dde35102039905 100644 --- a/types/spdx-compare/tsconfig.json +++ b/types/spdx-compare/tsconfig.json @@ -1,19 +1,19 @@ { - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "spdx-compare-tests.ts" - ] + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "spdx-compare-tests.ts" + ] } From 6d002616a90c2de803cf0682e6f0ba698a30127e Mon Sep 17 00:00:00 2001 From: Erwan Jugand <47392755+erwanjugand@users.noreply.github.com> Date: Wed, 8 Apr 2026 23:32:22 +0200 Subject: [PATCH 17/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74847=20[chr?= =?UTF-8?q?ome]=20update=20manifest=20keys=20by=20@erwanjugand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 184 ++++++++++++++++++++++--------------- types/chrome/test/index.ts | 74 +++++++++++++++ 2 files changed, 184 insertions(+), 74 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index ad335f7a19396f..a10aeb3f9b6aba 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -9264,36 +9264,37 @@ declare namespace chrome { export interface ManifestBase { // Required + /** An integer specifying the version of the manifest file format that your extension uses. */ manifest_version: number; + /** A string that identifies the extension in the Chrome Web Store, the install dialog, and the user's Chrome Extensions page (`chrome://extensions`). The maximum length is 75 characters. */ name: string; + /** A string that identifies the extension's version number. */ version: string; // Recommended + /** A string that defines the default language of an extension that supports multiple locales. Examples include "en" and "pt_BR". This key is required in localized extensions, and must not be used in extensions that aren't localized. */ default_locale?: string | undefined; + /** A string that describes the extension on both the Chrome Web Store and the user's extension management page. The maximum length is 132 characters. */ description?: string | undefined; + /** One or more icons that represent your extension. */ icons?: ManifestIcons | undefined; // Optional - author?: { - email: string; - } | undefined; - background_page?: string | undefined; + /** @deprecated As of February 2024, the `author` key is no longer supported by Chrome or the Chrome Web Store. If present, it's silently ignored. */ + author?: { email: string } | undefined; + /** Defines overrides for selected Chrome settings. */ chrome_settings_overrides?: { homepage?: string | undefined; search_provider?: SearchProvider | undefined; startup_pages?: string[] | undefined; } | undefined; - chrome_ui_overrides?: { - bookmarks_ui?: { - remove_bookmark_shortcut?: boolean | undefined; - remove_button?: boolean | undefined; - } | undefined; - } | undefined; + /** Defines overrides for default Chrome pages. */ chrome_url_overrides?: { bookmarks?: string | undefined; history?: string | undefined; newtab?: string | undefined; } | undefined; + /** Defines keyboard shortcuts within the extension. */ commands?: { [name: string]: { suggested_key?: { @@ -9311,38 +9312,30 @@ declare namespace chrome { matches?: string[] | undefined; permissions?: string[] | undefined; } | undefined; - content_scripts?: - | Array<{ - matches?: string[] | undefined; - exclude_matches?: string[] | undefined; - css?: string[] | undefined; - js?: string[] | undefined; - run_at?: string | undefined; - all_frames?: boolean | undefined; - match_about_blank?: boolean | undefined; - include_globs?: string[] | undefined; - exclude_globs?: string[] | undefined; - }> - | undefined; converted_from_user_script?: boolean | undefined; + /** Specifies a value for the Cross-Origin-Embedder-Policy HTTP header, which configures embedding of cross-origin resources in an extension page. */ + cross_origin_embedder_policy?: { value: string } | undefined; + /** Specifies a value for the Cross-Origin-Opener-Policy HTTP header, which lets you ensure that a top-level extension page doesn't share a browsing context group with cross-origin documents. */ + cross_origin_opener_policy?: { value: string } | undefined; current_locale?: string | undefined; + /** Defines static rules for the declarativeNetRequest API, which allows blocking and modifying of network requests. */ + declarative_net_request?: { rule_resources?: declarativeNetRequest.Ruleset[] } | undefined; + /** Defines pages that use the DevTools APIs. */ devtools_page?: string | undefined; event_rules?: | Array<{ event?: string | undefined; - actions?: - | Array<{ - type: string; - }> - | undefined; + actions?: Array<{ type: string }> | undefined; conditions?: chrome.declarativeContent.PageStateMatcherProperties[] | undefined; }> | undefined; + /** Specifies what other pages and extensions can connect to your extensions. */ externally_connectable?: { ids?: string[] | undefined; matches?: string[] | undefined; accepts_tls_channel_id?: boolean | undefined; } | undefined; + /** Provides access to the fileBrowserHandler API, which lets extensions access the ChromeOS file browser. */ file_browser_handlers?: | Array<{ id?: string | undefined; @@ -9350,35 +9343,44 @@ declare namespace chrome { file_filters?: string[] | undefined; }> | undefined; + /** Allows access to the fileSystemProvider API, which lets extensions create file systems that ChromeOS can use. */ file_system_provider_capabilities?: { + /** Whether configuring via onConfigureRequested is supported. By default: false. */ configurable?: boolean | undefined; + /** Whether setting watchers and notifying about changes is supported. By default: false. */ watchable?: boolean | undefined; + /** Whether multiple (more than one) mounted file systems are supported. By default: false. */ multiple_mounts?: boolean | undefined; - source?: string | undefined; + /** Files app uses above information in order to render related UI elements appropriately. For example, if `configurable` is set to true, then a menu item for configuring volumes will be rendered. Similarly, if `multiple_mounts` is set to true, then Files app will allow to add more than one mount points from the UI. If `watchable` is false, then a refresh button will be rendered. Note, that if possible you should add support for watchers, so changes on the file system can be reflected immediately and automatically. */ + source: "file" | "device" | "network"; } | undefined; + /** string specifying a URL for the extension's homepage. If this is undefined, the homepage defaults to the extension's Chrome Web Store page. This field is particularly useful if you host the extension on your own site. */ homepage_url?: string | undefined; + /** Allows resources to be imported into the extension. */ import?: | Array<{ id: string; minimum_version?: string | undefined; }> | undefined; - export?: { - whitelist?: string[] | undefined; - } | undefined; - incognito?: string | undefined; + /** Allows resources to be exported from the extension. */ + export?: { allowlist?: string[] | undefined } | undefined; + /** Defines how the extension behaves in incognito mode. */ + incognito?: "spanning" | "split" | "not_allowed" | undefined; + /** Allows the use of the Input Method Editor API. */ input_components?: | Array<{ - name?: string | undefined; - type?: string | undefined; + name: string; id?: string | undefined; - description?: string | undefined; language?: string[] | string | undefined; - layouts?: string[] | undefined; - indicator?: string | undefined; + layouts?: string[] | string | undefined; + input_view?: string | undefined; + options_page?: string | undefined; }> | undefined; + /** Specifies your extension's ID for various development use cases. */ key?: string | undefined; + /** Defines the oldest Chrome version that can install your extension. The value must be a substring of an existing Chrome browser version string, such as "107" or "107.0.5304.87". Users with versions of Chrome older than the minimum version see a "Not compatible" warning in the Chrome Web Store, and are unable to install your extension. If you add this to an existing extension, users whose Chrome version is older won't receive automatic updates to your extension. This includes business users in ephemeral mode. */ minimum_chrome_version?: string | undefined; nacl_modules?: | Array<{ @@ -9386,53 +9388,39 @@ declare namespace chrome { mime_type: string; }> | undefined; + /** Allows the use of an OAuth 2.0 security ID. The value of this key must be an object with "client_id" and "scopes" properties. */ oauth2?: { client_id: string; scopes?: string[] | undefined; } | undefined; offline_enabled?: boolean | undefined; - omnibox?: { - keyword: string; - } | undefined; + /** Allows the extension to register a keyword in Chrome's address bar. */ + omnibox?: { keyword: string } | undefined; + /** Specifies a path to an options.html file for the extension to use as an options page. */ options_page?: string | undefined; + /** Specifies a path to an HTML file that lets a user change extension options from the Chrome Extensions page. */ options_ui?: { - page?: string | undefined; - chrome_style?: boolean | undefined; - open_in_tab?: boolean | undefined; + /** Path to the options page, relative to the extension's root. */ + page: string; + /** Specify as `false` to declare an embedded options page. If `true`, the extension's options page will be opened in a new tab rather than embedded in `chrome://extensions`. */ + open_in_tab: boolean; } | undefined; - platforms?: - | Array<{ - nacl_arch?: string | undefined; - sub_package_path: string; - }> - | undefined; - plugins?: - | Array<{ - path: string; - }> - | undefined; + /** Lists technologies required to use the extension. */ requirements?: { - "3D"?: { - features?: string[] | undefined; - } | undefined; - plugins?: { - npapi?: boolean | undefined; - } | undefined; + "3D"?: { features?: string[] | undefined } | undefined; + /** @deprecated NPAPI Plugin support for extensions has been discontinued as of Chrome version 45 */ + plugins?: { npapi?: boolean | undefined } | undefined; } | undefined; + /** Defines a set of extension pages that don't have access to extension APIs or direct access to non-sandboxed pages. */ sandbox?: { pages: string[]; content_security_policy?: string | undefined; } | undefined; + /** A string containing a shortened version of the extension's name to be used when character space is limited. The maximum length is 12 characters. If this is undefined, a truncated version of the "name" key displays instead. */ short_name?: string | undefined; - spellcheck?: { - dictionary_language?: string | undefined; - dictionary_locale?: string | undefined; - dictionary_format?: string | undefined; - dictionary_path?: string | undefined; - } | undefined; - storage?: { - managed_schema: string; - } | undefined; + /** Declares a JSON schema for the managed storage area. */ + storage?: { managed_schema: string } | undefined; + /** Registers the extension as a text to speech engine. */ tts_engine?: { voices: Array<{ voice_name: string; @@ -9441,13 +9429,14 @@ declare namespace chrome { event_types?: string[] | undefined; }>; } | undefined; + /** A string containing the URL of the extension's updates page. Use this key if you're hosting your extension outside the Chrome Web Store. */ update_url?: string | undefined; + /** A string describing the extension's version. Examples include "1.0 beta" and "build rc2". If this is unspecified, the "version" value displays on the extension management page instead. */ version_name?: string | undefined; [key: string]: any; } export interface ManifestV2 extends ManifestBase { - // Required manifest_version: 2; // Pick one (or none) @@ -9462,24 +9451,50 @@ declare namespace chrome { persistent?: boolean | undefined; } | undefined; + /** Specifies JavaScript or CSS files to be used when the user opens certain web pages. */ + content_scripts?: + | Array<{ + matches?: string[] | undefined; + exclude_matches?: string[] | undefined; + css?: string[] | undefined; + js?: string[] | undefined; + run_at?: string | undefined; + all_frames?: boolean | undefined; + match_about_blank?: boolean | undefined; + include_globs?: string[] | undefined; + exclude_globs?: string[] | undefined; + }> + | undefined; + /** Defines restrictions on the scripts, styles, and other resources an extension can use. */ content_security_policy?: string | undefined; + /** Declares optional permissions for your extension. */ optional_permissions?: (ManifestOptionalPermission | string)[] | undefined; + /** Enables use of particular extension APIs. */ permissions?: (ManifestPermission | string)[] | undefined; + platforms?: + | Array<{ + nacl_arch?: string | undefined; + sub_package_path: string; + }> + | undefined; + /** Defines files within the extension that can be accessed by web pages or other extensions. */ web_accessible_resources?: string[] | undefined; } export interface ManifestV3 extends ManifestBase { - // Required manifest_version: 3; // Optional + /** Defines the appearance and behavior of the extension's icon in the Google Toolbar. */ action?: ManifestAction | undefined; + /** Specifies the JavaScript file containing the extension's service worker, which acts as an event handler. */ background?: | { service_worker: string; - type?: "module"; // If the service worker uses ES modules + type?: "module"; } | undefined; + /** Specifies JavaScript or CSS files to be used when the user opens certain web pages. */ content_scripts?: | Array<{ matches?: string[] | undefined; @@ -9494,14 +9509,35 @@ declare namespace chrome { world?: "ISOLATED" | "MAIN" | undefined; }> | undefined; + /** Defines restrictions on the scripts, styles, and other resources an extension can use. */ content_security_policy?: { extension_pages?: string; sandbox?: string; - }; + } | undefined; + /** Specifies file types for ChromeOS extensions to handle. */ + file_handlers?: + | Array<{ + /** Specifies an HTML file to show when a file is opened. The file must be within your extension. Processing the file, whether it's displayed or used in some other way, is done with JavaScript using appropriate web platform APIs. This code must be in a separate JavaScript file included via a `