@types/chrome 0.0.326 → 0.0.328
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chrome/README.md +1 -1
- chrome/index.d.ts +48 -31
- chrome/package.json +2 -2
chrome/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated: Sat,
|
11
|
+
* Last updated: Sat, 28 Jun 2025 08:37:16 GMT
|
12
12
|
* Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
|
13
13
|
|
14
14
|
# Credits
|
chrome/index.d.ts
CHANGED
@@ -6939,6 +6939,11 @@ declare namespace chrome {
|
|
6939
6939
|
installType: string;
|
6940
6940
|
/** The version of this extension, app, or theme. */
|
6941
6941
|
version: string;
|
6942
|
+
/**
|
6943
|
+
* The version name of this extension, app, or theme if the manifest specified one.
|
6944
|
+
* @since Chrome 50
|
6945
|
+
*/
|
6946
|
+
versionName?: string;
|
6942
6947
|
/** The extension's unique identifier. */
|
6943
6948
|
id: string;
|
6944
6949
|
/**
|
@@ -7808,73 +7813,80 @@ declare namespace chrome {
|
|
7808
7813
|
export interface Match {
|
7809
7814
|
/** The DER encoding of a X.509 certificate. */
|
7810
7815
|
certificate: ArrayBuffer;
|
7811
|
-
/** The
|
7816
|
+
/** The KeyAlgorithm of the certified key. This contains algorithm parameters that are inherent to the key of the certificate (e.g. the key length). Other parameters like the hash function used by the sign function are not included. */
|
7812
7817
|
keyAlgorithm: KeyAlgorithm;
|
7813
7818
|
}
|
7814
7819
|
|
7815
|
-
export interface
|
7816
|
-
/** This field is a list of the types of certificates requested, sorted in order of the server's preference. Only certificates of a type contained in this list will be retrieved. If certificateTypes is the empty list, however, certificates of any type will be returned. */
|
7817
|
-
certificateTypes:
|
7820
|
+
export interface ClientCertificateRequest {
|
7821
|
+
/** This field is a list of the types of certificates requested, sorted in order of the server's preference. Only certificates of a type contained in this list will be retrieved. If `certificateTypes` is the empty list, however, certificates of any type will be returned. */
|
7822
|
+
certificateTypes: `${ClientCertificateType}`[];
|
7818
7823
|
/** List of distinguished names of certificate authorities allowed by the server. Each entry must be a DER-encoded X.509 DistinguishedName. */
|
7819
7824
|
certificateAuthorities: ArrayBuffer[];
|
7820
7825
|
}
|
7821
7826
|
|
7822
|
-
export
|
7827
|
+
export enum ClientCertificateType {
|
7828
|
+
ECDSA_SIGN = "ecdsaSign",
|
7829
|
+
RAS_SIGN = "rasSign",
|
7830
|
+
}
|
7831
|
+
|
7832
|
+
export interface SelectDetails {
|
7823
7833
|
/** Only certificates that match this request will be returned. */
|
7824
|
-
request:
|
7825
|
-
/**
|
7826
|
-
* Optional.
|
7827
|
-
* If given, the selectClientCertificates operates on this list. Otherwise, obtains the list of all certificates from the platform's certificate stores that are available to this extensions. Entries that the extension doesn't have permission for or which doesn't match the request, are removed.
|
7828
|
-
*/
|
7834
|
+
request: ClientCertificateRequest;
|
7835
|
+
/** If given, the `selectClientCertificates` operates on this list. Otherwise, obtains the list of all certificates from the platform's certificate stores that are available to this extensions. Entries that the extension doesn't have permission for or which doesn't match the request, are removed. */
|
7829
7836
|
clientCerts?: ArrayBuffer[] | undefined;
|
7830
7837
|
/** If true, the filtered list is presented to the user to manually select a certificate and thereby granting the extension access to the certificate(s) and key(s). Only the selected certificate(s) will be returned. If is false, the list is reduced to all certificates that the extension has been granted access to (automatically or manually). */
|
7831
7838
|
interactive: boolean;
|
7832
7839
|
}
|
7833
7840
|
|
7834
|
-
export interface
|
7841
|
+
export interface VerificationDetails {
|
7835
7842
|
/** Each chain entry must be the DER encoding of a X.509 certificate, the first entry must be the server certificate and each entry must certify the entry preceding it. */
|
7836
7843
|
serverCertificateChain: ArrayBuffer[];
|
7837
|
-
/** The hostname of the server to verify the certificate for, e.g. the server that presented the serverCertificateChain
|
7844
|
+
/** The hostname of the server to verify the certificate for, e.g. the server that presented the `serverCertificateChain`. */
|
7838
7845
|
hostname: string;
|
7839
7846
|
}
|
7840
7847
|
|
7841
|
-
export interface
|
7848
|
+
export interface VerificationResult {
|
7842
7849
|
/** The result of the trust verification: true if trust for the given verification details could be established and false if trust is rejected for any reason. */
|
7843
7850
|
trusted: boolean;
|
7844
7851
|
/**
|
7845
7852
|
* If the trust verification failed, this array contains the errors reported by the underlying network layer. Otherwise, this array is empty.
|
7853
|
+
*
|
7846
7854
|
* Note: This list is meant for debugging only and may not contain all relevant errors. The errors returned may change in future revisions of this API, and are not guaranteed to be forwards or backwards compatible.
|
7847
7855
|
*/
|
7848
7856
|
debug_errors: string[];
|
7849
7857
|
}
|
7850
7858
|
|
7851
7859
|
/**
|
7852
|
-
* This
|
7853
|
-
*
|
7860
|
+
* This method filters from a list of client certificates the ones that are known to the platform, match `request` and for which the extension has permission to access the certificate and its private key. If `interactive` is true, the user is presented a dialog where they can select from matching certificates and grant the extension access to the certificate. The selected/filtered client certificates will be passed to `callback`.
|
7861
|
+
*
|
7862
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 121.
|
7854
7863
|
*/
|
7864
|
+
export function selectClientCertificates(details: SelectDetails): Promise<Match[]>;
|
7855
7865
|
export function selectClientCertificates(
|
7856
|
-
details:
|
7866
|
+
details: SelectDetails,
|
7857
7867
|
callback: (matches: Match[]) => void,
|
7858
7868
|
): void;
|
7869
|
+
|
7859
7870
|
/**
|
7860
|
-
* Passes the key pair of certificate for usage with platformKeys.subtleCrypto to callback
|
7861
|
-
* @param certificate The certificate of a Match returned by selectClientCertificates.
|
7862
|
-
* @param parameters Determines signature/hash algorithm parameters additionally to the parameters fixed by the key itself. The same parameters are
|
7863
|
-
*
|
7864
|
-
*
|
7871
|
+
* Passes the key pair of `certificate` for usage with {@link platformKeys.subtleCrypto} to `callback`.
|
7872
|
+
* @param certificate The certificate of a {@link Match} returned by {@link selectClientCertificates}.
|
7873
|
+
* @param parameters Determines signature/hash algorithm parameters additionally to the parameters fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. `RsaHashedImportParams` for a RSASSA-PKCS1-v1_5 key and `EcKeyImportParams` for EC key. Additionally for RSASSA-PKCS1-v1_5 keys, hashing algorithm name parameter can be specified with one of the following values: "none", "SHA-1", "SHA-256", "SHA-384", or "SHA-512", e.g. `{"hash": { "name": "none" } }`. The sign function will then apply PKCS#1 v1.5 padding but not hash the given data.
|
7874
|
+
*
|
7875
|
+
* Currently, this method only supports the "RSASSA-PKCS1-v1\_5" and "ECDSA" algorithms.
|
7865
7876
|
*/
|
7866
7877
|
export function getKeyPair(
|
7867
7878
|
certificate: ArrayBuffer,
|
7868
7879
|
parameters: { [key: string]: unknown },
|
7869
7880
|
callback: (publicKey: CryptoKey, privateKey: CryptoKey | null) => void,
|
7870
7881
|
): void;
|
7882
|
+
|
7871
7883
|
/**
|
7872
|
-
* Passes the key pair
|
7884
|
+
* Passes the key pair identified by `publicKeySpkiDer` for usage with {@link platformKeys.subtleCrypto} to `callback`.
|
7885
|
+
*
|
7873
7886
|
* @param publicKeySpkiDer A DER-encoded X.509 SubjectPublicKeyInfo, obtained e.g. by calling WebCrypto's exportKey function with format="spki".
|
7874
|
-
* @param parameters Provides signature and hash algorithm parameters, in addition to those fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-
|
7875
|
-
*
|
7876
|
-
*
|
7877
|
-
* Optional parameter privateKey: Might be null if this extension does not have access to it.
|
7887
|
+
* @param parameters Provides signature and hash algorithm parameters, in addition to those fixed by the key itself. The same parameters are accepted as by WebCrypto's [importKey](https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey) function, e.g. `RsaHashedImportParams` for a RSASSA-PKCS1-v1\_5 key. For RSASSA-PKCS1-v1\_5 keys, we need to also pass a "hash" parameter `{ "hash": { "name": string } }`. The "hash" parameter represents the name of the hashing algorithm to be used in the digest operation before a sign. It is possible to pass "none" as the hash name, in which case the sign function will apply PKCS#1 v1.5 padding and but not hash the given data.
|
7888
|
+
*
|
7889
|
+
* Currently, this method supports the "ECDSA" algorithm with named-curve P-256 and "RSASSA-PKCS1-v1\_5" algorithm with one of the hashing algorithms "none", "SHA-1", "SHA-256", "SHA-384", and "SHA-512".
|
7878
7890
|
* @since Chrome 85
|
7879
7891
|
*/
|
7880
7892
|
export function getKeyPairBySpki(
|
@@ -7882,14 +7894,19 @@ declare namespace chrome {
|
|
7882
7894
|
parameters: { [key: string]: unknown },
|
7883
7895
|
callback: (publicKey: CryptoKey, privateKey: CryptoKey | null) => void,
|
7884
7896
|
): void;
|
7885
|
-
|
7886
|
-
|
7897
|
+
|
7898
|
+
/** An implementation of WebCrypto's SubtleCrypto that allows crypto operations on keys of client certificates that are available to this extension. */
|
7899
|
+
export function subtleCrypto(): SubtleCrypto | undefined;
|
7900
|
+
|
7887
7901
|
/**
|
7888
|
-
* Checks whether details.serverCertificateChain can be trusted for details.hostname according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names.
|
7902
|
+
* Checks whether `details.serverCertificateChain` can be trusted for `details.hostname` according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names.
|
7903
|
+
*
|
7904
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 121.
|
7889
7905
|
*/
|
7906
|
+
export function verifyTLSServerCertificate(details: VerificationDetails): Promise<VerificationResult>;
|
7890
7907
|
export function verifyTLSServerCertificate(
|
7891
|
-
details:
|
7892
|
-
callback: (result:
|
7908
|
+
details: VerificationDetails,
|
7909
|
+
callback: (result: VerificationResult) => void,
|
7893
7910
|
): void;
|
7894
7911
|
}
|
7895
7912
|
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.328",
|
4
4
|
"description": "TypeScript definitions for chrome",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
6
6
|
"license": "MIT",
|
@@ -94,6 +94,6 @@
|
|
94
94
|
"@types/har-format": "*"
|
95
95
|
},
|
96
96
|
"peerDependencies": {},
|
97
|
-
"typesPublisherContentHash": "
|
97
|
+
"typesPublisherContentHash": "26b4ba7138cfa4abb2872e80ecf184025a7d5ab2e298b60997513adef0343f27",
|
98
98
|
"typeScriptVersion": "5.1"
|
99
99
|
}
|