/** * DO NOT MODIFY THESE FILES! * * These files were copied from the **types** package. To update this file, make changes to those * files instead and then run the following command from the monorepo root folder: * * deno task codegen:types */ /** * Generated from typescript@5.8.3 * To regenerate, run the following command from the package root: * deno task extract-dom-types */ /** * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse) */ export interface AuthenticatorAssertionResponse extends AuthenticatorResponse { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/authenticatorData) */ readonly authenticatorData: ArrayBuffer; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/signature) */ readonly signature: ArrayBuffer; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAssertionResponse/userHandle) */ readonly userHandle: ArrayBuffer | null; } /** * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse) */ export interface AuthenticatorAttestationResponse extends AuthenticatorResponse { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/attestationObject) */ readonly attestationObject: ArrayBuffer; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getAuthenticatorData) */ getAuthenticatorData(): ArrayBuffer; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKey) */ getPublicKey(): ArrayBuffer | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getPublicKeyAlgorithm) */ getPublicKeyAlgorithm(): COSEAlgorithmIdentifier; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorAttestationResponse/getTransports) */ getTransports(): string[]; } export interface AuthenticationExtensionsClientInputs { appid?: string; credProps?: boolean; hmacCreateSecret?: boolean; minPinLength?: boolean; prf?: AuthenticationExtensionsPRFInputs; } export interface AuthenticationExtensionsClientOutputs { appid?: boolean; credProps?: CredentialPropertiesOutput; hmacCreateSecret?: boolean; prf?: AuthenticationExtensionsPRFOutputs; } export interface AuthenticatorSelectionCriteria { authenticatorAttachment?: AuthenticatorAttachment; requireResidentKey?: boolean; residentKey?: ResidentKeyRequirement; userVerification?: UserVerificationRequirement; } export interface CredentialCreationOptions { publicKey?: PublicKeyCredentialCreationOptions; signal?: AbortSignal; } export interface CredentialRequestOptions { mediation?: CredentialMediationRequirement; publicKey?: PublicKeyCredentialRequestOptions; signal?: AbortSignal; } /** * Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto) */ export interface Crypto { /** * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/subtle) */ readonly subtle: SubtleCrypto; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */ getRandomValues(array: T): T; /** * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID) */ randomUUID(): `${string}-${string}-${string}-${string}-${string}`; } /** * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential) */ export interface PublicKeyCredential extends Credential { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/authenticatorAttachment) */ readonly authenticatorAttachment: string | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/rawId) */ readonly rawId: ArrayBuffer; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/response) */ readonly response: AuthenticatorResponse; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/getClientExtensionResults) */ getClientExtensionResults(): AuthenticationExtensionsClientOutputs; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/PublicKeyCredential/toJSON) */ toJSON(): PublicKeyCredentialJSON; } export interface PublicKeyCredentialCreationOptions { attestation?: AttestationConveyancePreference; authenticatorSelection?: AuthenticatorSelectionCriteria; challenge: BufferSource; excludeCredentials?: PublicKeyCredentialDescriptor[]; extensions?: AuthenticationExtensionsClientInputs; pubKeyCredParams: PublicKeyCredentialParameters[]; rp: PublicKeyCredentialRpEntity; timeout?: number; user: PublicKeyCredentialUserEntity; } export interface PublicKeyCredentialDescriptor { id: BufferSource; transports?: AuthenticatorTransport[]; type: PublicKeyCredentialType; } export interface PublicKeyCredentialDescriptorJSON { id: Base64URLString; transports?: string[]; type: string; } export interface PublicKeyCredentialParameters { alg: COSEAlgorithmIdentifier; type: PublicKeyCredentialType; } export interface PublicKeyCredentialRequestOptions { allowCredentials?: PublicKeyCredentialDescriptor[]; challenge: BufferSource; extensions?: AuthenticationExtensionsClientInputs; rpId?: string; timeout?: number; userVerification?: UserVerificationRequirement; } export interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity { displayName: string; id: BufferSource; } /** * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse) */ export interface AuthenticatorResponse { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AuthenticatorResponse/clientDataJSON) */ readonly clientDataJSON: ArrayBuffer; } export interface AuthenticationExtensionsPRFInputs { eval?: AuthenticationExtensionsPRFValues; evalByCredential?: Record; } export interface CredentialPropertiesOutput { rk?: boolean; } export interface AuthenticationExtensionsPRFOutputs { enabled?: boolean; results?: AuthenticationExtensionsPRFValues; } /** * A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal) */ export interface AbortSignal extends EventTarget { /** * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted) */ readonly aborted: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */ onabort: ((this: AbortSignal, ev: Event) => any) | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */ readonly reason: any; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */ throwIfAborted(): void; addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } /** * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto) */ export interface SubtleCrypto { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/decrypt) */ decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveBits) */ deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length?: number | null): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */ deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/digest) */ digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/encrypt) */ encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */ exportKey(format: "jwk", key: CryptoKey): Promise; exportKey(format: Exclude, key: CryptoKey): Promise; exportKey(format: KeyFormat, key: CryptoKey): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */ generateKey(algorithm: "Ed25519" | { name: "Ed25519"; }, extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray): Promise; generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray): Promise; generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/importKey) */ importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray): Promise; importKey(format: Exclude, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/sign) */ sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, data: BufferSource): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/unwrapKey) */ unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/verify) */ verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/wrapKey) */ wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise; } /** * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential) */ export interface Credential { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/id) */ readonly id: string; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Credential/type) */ readonly type: string; } export interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity { id?: string; } export interface PublicKeyCredentialEntity { name: string; } export interface AuthenticationExtensionsPRFValues { first: BufferSource; second?: BufferSource; } /** * EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget) */ export interface EventTarget { /** * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. * * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture. * * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. * * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in ยง 2.8 Observing event listeners. * * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. * * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. * * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) */ addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void; /** * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) */ dispatchEvent(event: Event): boolean; /** * Removes the event listener in target's event listener list with the same type, callback, and options. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) */ removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; } /** * An event which takes place in the DOM. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event) */ export interface Event { /** * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/bubbles) */ readonly bubbles: boolean; /** * @deprecated * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelBubble) */ cancelBubble: boolean; /** * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/cancelable) */ readonly cancelable: boolean; /** * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composed) */ readonly composed: boolean; /** * Returns the object whose event listener's callback is currently being invoked. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/currentTarget) */ readonly currentTarget: EventTarget | null; /** * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented) */ readonly defaultPrevented: boolean; /** * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/eventPhase) */ readonly eventPhase: number; /** * Returns true if event was dispatched by the user agent, and false otherwise. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/isTrusted) */ readonly isTrusted: boolean; /** * @deprecated * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/returnValue) */ returnValue: boolean; /** * @deprecated * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/srcElement) */ readonly srcElement: EventTarget | null; /** * Returns the object to which event is dispatched (its target). * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/target) */ readonly target: EventTarget | null; /** * Returns the event's timestamp as the number of milliseconds measured relative to the time origin. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/timeStamp) */ readonly timeStamp: DOMHighResTimeStamp; /** * Returns the type of event, e.g. "click", "hashchange", or "submit". * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/type) */ readonly type: string; readonly NONE: 0; readonly CAPTURING_PHASE: 1; readonly AT_TARGET: 2; readonly BUBBLING_PHASE: 3; /** * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/composedPath) */ composedPath(): EventTarget[]; /** * @deprecated * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/initEvent) */ initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; /** * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/preventDefault) */ preventDefault(): void; /** * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation) */ stopImmediatePropagation(): void; /** * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation) */ stopPropagation(): void; } export interface AbortSignalEventMap { "abort": Event; } export interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; passive?: boolean; signal?: AbortSignal; } export interface EventListenerOptions { capture?: boolean; } export interface RsaOaepParams extends Algorithm { label?: BufferSource; } export interface AesCtrParams extends Algorithm { counter: BufferSource; length: number; } export interface AesCbcParams extends Algorithm { iv: BufferSource; } export interface AesGcmParams extends Algorithm { additionalData?: BufferSource; iv: BufferSource; tagLength?: number; } /** * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey) */ export interface CryptoKey { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) */ readonly algorithm: KeyAlgorithm; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/extractable) */ readonly extractable: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/type) */ readonly type: KeyType; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CryptoKey/usages) */ readonly usages: KeyUsage[]; } export interface EcdhKeyDeriveParams extends Algorithm { public: CryptoKey; } export interface HkdfParams extends Algorithm { hash: HashAlgorithmIdentifier; info: BufferSource; salt: BufferSource; } export interface Pbkdf2Params extends Algorithm { hash: HashAlgorithmIdentifier; iterations: number; salt: BufferSource; } export interface AesDerivedKeyParams extends Algorithm { length: number; } export interface HmacImportParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; } export interface JsonWebKey { alg?: string; crv?: string; d?: string; dp?: string; dq?: string; e?: string; ext?: boolean; k?: string; key_ops?: string[]; kty?: string; n?: string; oth?: RsaOtherPrimesInfo[]; p?: string; q?: string; qi?: string; use?: string; x?: string; y?: string; } export interface CryptoKeyPair { privateKey: CryptoKey; publicKey: CryptoKey; } export interface RsaHashedKeyGenParams extends RsaKeyGenParams { hash: HashAlgorithmIdentifier; } export interface EcKeyGenParams extends Algorithm { namedCurve: NamedCurve; } export interface AesKeyGenParams extends Algorithm { length: number; } export interface HmacKeyGenParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; } export interface RsaHashedImportParams extends Algorithm { hash: HashAlgorithmIdentifier; } export interface EcKeyImportParams extends Algorithm { namedCurve: NamedCurve; } export interface AesKeyAlgorithm extends KeyAlgorithm { length: number; } export interface RsaPssParams extends Algorithm { saltLength: number; } export interface EcdsaParams extends Algorithm { hash: HashAlgorithmIdentifier; } export interface EventListener { (evt: Event): void; } export interface EventListenerObject { handleEvent(object: Event): void; } export interface Algorithm { name: string; } export interface KeyAlgorithm { name: string; } export interface RsaOtherPrimesInfo { d?: string; r?: string; t?: string; } export interface RsaKeyGenParams extends Algorithm { modulusLength: number; publicExponent: BigInteger; } export type AttestationConveyancePreference = "direct" | "enterprise" | "indirect" | "none"; export type AuthenticatorTransport = "ble" | "hybrid" | "internal" | "nfc" | "usb"; export type Base64URLString = string; export type COSEAlgorithmIdentifier = number; export type ResidentKeyRequirement = "discouraged" | "preferred" | "required"; export type UserVerificationRequirement = "discouraged" | "preferred" | "required"; export type AuthenticatorAttachment = "cross-platform" | "platform"; export type CredentialMediationRequirement = "conditional" | "optional" | "required" | "silent"; export type PublicKeyCredentialJSON = any; export type BufferSource = ArrayBufferView | ArrayBuffer; export type PublicKeyCredentialType = "public-key"; export type EventListenerOrEventListenerObject = EventListener | EventListenerObject; export type AlgorithmIdentifier = Algorithm | string; export type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey"; export type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; export type DOMHighResTimeStamp = number; export type KeyType = "private" | "public" | "secret"; export type HashAlgorithmIdentifier = AlgorithmIdentifier; export type NamedCurve = string; export type BigInteger = Uint8Array; //# sourceMappingURL=dom.d.ts.map