/* * Copyright 2023 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the Licrrense for the specific language * governing permissions and limitations under the License. * */ // Type definitions for Unified Extensibility Platform (UXP) 7.3 // Project: https://adobe.io/photoshop/uxp/2022/uxp-api/ // Definitions by: Adobe UXP // Apoorva Sharma // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'uxp' { namespace storage { /** * Common locations that we can use when displaying a file picker. */ namespace domains { /** * The user's desktop folder */ var userDesktop: symbol; /** * The user's documents folder */ var userDocuments: symbol; /** * The user's pictures folder or library */ var userPictures: symbol; /** * The user's videos / movies folder or library */ var userVideos: symbol; /** * The user's music folder or library */ var userMusic: symbol; /** * Local application data */ var appLocalData: symbol; /** * Local application library */ var appLocalLibrary: symbol; /** * Local application cache directory (persistence not guaranteed) */ var appLocalCache: symbol; /** * Local application shared data folder */ var appLocalShared: symbol; /** * Local temporary directory */ var appLocalTemporary: symbol; /** * Roaming application data */ var appRoamingData: symbol; /** * Roaming application library data */ var appRoamingLibrary: symbol; } /** * This namespace describes the various file type extensions that can used be used in some FS file open methods. */ namespace fileTypes { /** * Text file extensions */ var text: string[]; /** * Image file extensions */ var images: string[]; /** * All file types */ var all: string[]; } /** * This namespace describes the file content formats supported in FS methods like read and write. */ namespace formats { /** * UTF8 File encoding */ var utf8: symbol; /** * Binary file encoding */ var binary: symbol; } /** * This namespace describes the file open modes. for eg: open file in read-only or both read-write */ namespace modes { /** * The file is read-only; attempts to write will fail. */ var readOnly: symbol; /** * The file is read-write. */ var readWrite: symbol; } /** * This namespace describes the type of the entry. Whether file or folder etc. */ namespace types { /** * A file; used when creating an entity */ var file: symbol; /** * A folder; used when creating an entity */ var folder: symbol; } /** * An `Entry` is the base class for `File` and `Folder`. * You can get an instance of Entry via the `localFileSystem` by fetching an instance of a File or Folder * * Example * ```js * // Since Entry cannot be called directly we can use a File or Folder object to invoke Entry as shown below * const fs = require('uxp').storage.localFileSystem; * const folder = await fs.getPluginFolder(); // returns a Folder instance * const folderEntry = await folder.getEntry("entryName.txt"); * * // Now we can use folderEntry to invoke the APIs provided by Entry * console.log(folderEntry.isEntry); // isEntry is an API of Entry, in this example it will return true * ``` */ class Entry { /** * Indicates that this instance is an `Entry`. Useful for type-checking. * @example * if (something.isEntry) { * return something.getMetadata(); * } */ isEntry: boolean; /** * Indicates that this instance is **not** a `File`. Useful for type- * checking. * @example * if (!anEntry.isFile) { * return "This entry is not a file."; * } */ readonly isFile: boolean; /** * Indicates that this instance is **not** a folder. Useful for type- * checking. * @example * if (!anEntry.isFolder) { * return "This entry is not a folder."; * } */ readonly isFolder: boolean; /** * The name of this entry. Read-only. * @example * console.log(anEntry.name); */ readonly name: string; /** * The associated provider that services this entry. Read-only. * @example * if (entryOne.provider !== entryTwo.provider) { * throw new Error("Providers are not the same"); * } */ readonly provider: FileSystemProvider; /** * The url of this entry. You can use this url as input to other entities of the extension system like for eg: set as src attribute of a Image widget in UI. Read-only. * @example * console.log(anEntry.url); */ readonly url: string; /** * Returns the details of the given entry like name, type and native path in a readable string format. */ toString(): string; /** * The platform native file-system path of this entry. Read-only * @example * console.log(anEntry.nativePath); */ readonly nativePath: string; /** * Copies this entry to the specified `folder`. * @example * await someFile.copyTo(someFolder); * @example * await someFile.copyTo(someFolder, {overwrite: true}); * @example * await someFolder.copyTo(anotherFolder, {overwrite: true, allowFolderCopy: true}); * @param folder - the folder to which to copy this entry * @param [options.overwrite = false] - if `true`, allows overwriting existing entries * @param [options.allowFolderCopy = false] - if `true`, allows copying the folder * @returns `Promise` */ copyTo(folder: Folder, options: { overwrite?: boolean; allowFolderCopy?: boolean; }): any; /** * Moves this entry to the target folder, optionally specifying a new name. * @example * await someFile.moveTo(someFolder); * @example * await someFile.moveTo(someFolder, {overwrite: true}); * @example * await someFolder.moveTo(anotherFolder, {overwrite: true}); * @example * await someFile.moveTo(someFolder, {newName: 'masterpiece.txt'}) * @example * await someFile.moveTo(someFolder, {newName: 'novel.txt', {overwrite: true}) * @param folder - the folder to which to move this entry * @param [options.overwrite = false] - If `true` allows the move to overwrite existing files * @param [options.newName] - If specified, the entry is renamed to this name * @returns `Promise` */ moveTo(folder: Folder, options: { overwrite?: boolean; newName?: string; }): any; /** * Removes this entry from the file system. If the entry is a folder, it must be empty before deletion. * Note: Currently when using this method, a permission denied error will occur if attempting to delete * a folder that was selected from a storage picker or added via drag-and-drop. * @example * await aFile.delete(); * @returns `Promise` - the number is 0 if succeeded, otherwise throws an Error */ delete(): any; /** * Returns this entry's metadata. * @example * const metadata = aFile.getMetadata(); * @returns `Promise` */ getMetadata(): any; } /** * Metadata for an `Entry`. It includes useful information such as: * * * size of the file (if a file) * * date created * * date modified * * name * * Instantiate `EntryMetadata` by using {@link Entry.md#getmetadata|Entry's - getMetadata()}. * In order to instantiate `Entry`, you will need to first invoke the `localFileSystem` and then fetch an instance of a File or Folder. * * Example * ```js * const fs = require('uxp').storage.localFileSystem; * const folder = await fs.getPluginFolder(); // Gets an instance of Folder (or Entry) * const entryMetaData = await folder.getMetadata(); * console.log(entryMetaData.name); * ``` */ class EntryMetadata { /** * The name of the entry. */ name: string; /** * The size of the entry, if a file. Zero if a folder. */ size: number; /** * The date this entry was created. */ dateCreated: Date; /** * The date this entry was modified. */ dateModified: Date; /** * Indicates if the entry is a file */ isFile: boolean; /** * Indicates if the entry is a folder */ isFolder: boolean; } /** * Represents a file on a file system. Provides methods for reading from and * writing to the file. You'll never instantiate a `File` directly; instead * you'll get access via a [storage.FileSystemProvider]{@link ./FileSystemProvider}. * Keep in mind that `File` as such doesn't need a `require()` statement, however a `localFileSystem` will need it. * * Example * ```js * // Get the object of a File instance * const fs = require('uxp').storage.localFileSystem; * const file = await fs.createEntryWithUrl("file:/Users/user/Documents/tmp"); // Gets a File instance * console.log(file.isFile); // returns true * ``` */ class File { /** * Indicates that this instance is a file. * @example * if (anEntry.isFile) { * await anEntry.read(); * } */ isFile: any; /** * Indicates whether this file is read-only or read-write. See [readOnly]{@link ./modes#readonly--symbol} and [readWrite]{@link ./modes#readwrite--symbol}. * @example * if (aFile.mode === modes.readOnly) { * throw new Error("Can't write to a file opened as read-only."); * } */ mode: symbol; /** * Reads data from the file and returns it. The file format can be specified * with the `format` option. If a format is not supplied, the file is assumed * to be a text file using UTF8 encoding. * @example * const text = await myNovel.read(); * @example * const data = await myNovel.read({format: formats.binary}); * @param [options.format = formats.utf8] - The format of the file; see [utf8]{@link ./formats#utf8--symbol} and [binary]{@link ./formats#binary--symbol}. * @returns `Promise` the contents of the file */ read(options: { format?: symbol; }): any; /** * Writes data to a file, appending if desired. The format of the file * is controlled via the `format` option, and defaults to UTF8. * @example * await myNovel.write("It was a dark and stormy night.\n"); * await myNovel.write("Cliches and tropes aside, it really was.", {append: true}); * @example * const data = new ArrayBuffer(); * await aDataFile.write(data, {format: formats.binary}); * @param data - the data to write to the file * @param [options.format = formats.utf8] - the format of the file; see [utf8]{@link ./formats#utf8--symbol} and [binary]{@link ./formats#binary--symbol}. * @param [options.append = false] - if `true`, the data is written to the end of the file * @returns `Promise` - the length of the contents written to the file */ write(data: string | ArrayBuffer, options: { format?: symbol; append?: boolean; }): any; /** * Determines if the entry is a file or not. This is safe to use even if the * entry is `null` or `undefined`. * @param entry - the entry to check * @returns if `true`, the entry is a file. */ static isFile(entry: any): boolean; } /** * Provides access to files and folders on a file system. You'll typically not * instantiate this directly; instead you'll use an instance of one that has * already been created for you by UXP. * @example * const fs = uxp.fs.localFileSystem; */ class FileSystemProvider { /** * Indicates that this is a `FileSystemProvider`. Useful for type-checking. */ isFileSystemProvider: boolean; /** * An array of the domains this file system supports. If the file system can * open a file picker to the user's `documents` folder, for example, then [userDocuments]{@link ./domains#module-storage-domains-userdocuments} will be in this list. * @example * if (fs.supportedDomains.contains(domains.userDocuments)) { * console.log("We can open a picker to the user's documents.") * } */ supportedDomains: symbol[]; /** * Gets a file (or files) from the file system provider for the purpose of * opening them. Files are read-only. * * Multiple files can be returned if the `allowMultiple` option` is `true`. * @example * const folder = await fs.getFolder({initialDomain: domains.userDocuments}); * const file = await fs.getFileForOpening({initialLocation: folder}); * if (!file) { * // no file selected * return; * } * const text = await file.read(); * @example * const files = await fs.getFileForOpening({allowMultiple: true, types: fileTypes.images}); * if (files.length === 0) { * // no files selected * } * @param [options.initialDomain] - the preferred initial location of the file picker. If not defined, the most recently used domain from a file picker is used instead. * @param [options.types = [".*"]] - array of file types that the file open picker displays. * @param [options.initialLocation] - the initial location of the file picker. * You can pass an existing file or folder entry to suggest the picker to start at this location. * If this is a file entry then the method will pick its parent folder as initial location. This will override initialDomain option. * @param [options.allowMultiple = false] - if true, multiple files can be selected * @returns `Promise>` based on `allowMultiple`. Return empty if no file was selected. */ getFileForOpening(options: { initialDomain?: symbol; types?: string[]; initialLocation?: File | Folder; allowMultiple?: boolean; }): any; /** * Gets a file reference suitable for read-write. Displays a file picker to select a location to "Save" the file. * * If the act of writing to the file would overwrite it, the file picker * will prompt the user to confirm before returning a result to you. * @example * const file = await fs.getFileForSaving("output.txt", { types: [ "txt" ]}); * if (!file) { * // file picker was cancelled * return; * } * await file.write("It was a dark and stormy night"); * @param suggestedName - Required when `options.types` is not defined. * @param [options.initialDomain] - The preferred initial location of the file picker. If not defined, the most recently used domain from a file picker is used instead. * @param [options.types] - Allowed file extensions, with no "." prefix. * @returns `Promise` - returns the selected file, or `null` if no file were selected. */ getFileForSaving(suggestedName: string, options: { initialDomain?: symbol; types?: string[]; }): any; /** * Gets a folder from the file system via a folder picker dialog. The files * and folders within can be accessed via [Folder#getEntries]{@link ./Folder#getentries}. Any * files within are read-write. * * If the user dismisses the picker, `null` is returned instead. * @example * const folder = await fs.getFolder(); * const myNovel = (await fs.getEntries()).filter(entry => entry.name.indexOf('novel') > 0); * const text = await myNovel.read(); * @param [options.initialDomain] - the preferred initial location of the file picker. If not defined, the most recently used domain from a file picker is used instead. * @returns `Promise` - the selected folder or `null` if no folder is selected. */ getFolder(options: { initialDomain?: symbol; }): any; /** * Returns a temporary folder. The contents of the folder will be removed when * the extension is disposed. * @example * const temp = await fs.getTemporaryFolder(); * @returns `Promise` */ getTemporaryFolder(): any; /** * Returns a folder that can be used for extension's data storage without user interaction. * It is persistent across host-app version upgrades. * @returns `Promise` */ getDataFolder(): any; /** * Returns an plugin's folder – this folder and everything within it are read only. * This contains all the Plugin related packaged assets. * @returns `Promise` */ getPluginFolder(): any; /** * Creates an entry for the given url and returns the appropriate instance. * @example * const newImgFolder = await fs.createEntryWithUrl("plugin-temp:/img", { type: types.folder }); * const newTmpFolder = await fs.createEntryWithUrl("file:/Users/user/Documents/tmp", { type: types.folder }); * @example * const newDatFile = await fs.createEntryWithUrl("plugin-temp:/tmp/test.dat", { overwrite: true }); * const newTxtFile = await fs.createEntryWithUrl("file:/Users/user/Documents/test.txt", { overwrite: true }); * @param url - the url to create an Entry object. * Note that file: scheme has limited support in UWP due to the strict [File access permissions]{@link https://learn.microsoft.com/en-us/windows/uwp/files/file-access-permissions} * @param [options.type = types.file] - indicates which kind of entry to create. Pass types.folder to create a new folder. * Note that if the type is file then this method just create"s" a file entry object and not the actual file on the disk. * File on the storage is created when data is written into the file. eg: call write method on the file entry object. * @param [options.overwrite = false] - if true, the create attempt can overwrite an existing file * @returns `Promise` the File or Folder object which is created for the given url */ public createEntryWithUrl(url: string, options: { type?: symbol; overwrite?: boolean; }): any; /** * Gets an entry of the given url and returns the appropriate instance. * @example * const tmpFolder = await fs.getEntryWithUrl("plugin-temp:/tmp"); * const docFolder = await fs.getEntryWithUrl("file:/Users/user/Documents"); * @example * const tmpFile = await fs.getEntryWithUrl("plugin-temp:/tmp/test.dat"); * const docFile = await fs.getEntryWithUrl("file:/Users/user/Documents/test.txt"); * @param url - the url to get an Entry object * Note that file: scheme has limited support in UWP due to the strict [File access permissions]{@link https://learn.microsoft.com/en-us/windows/uwp/files/file-access-permissions} * @returns `Promise` the File or Folder object for the given url */ public getEntryWithUrl(url: string): any; /** * Returns the fs url of given entry. * @returns `string` */ public getFsUrl(entry: Entry): any; /** * Returns the platform native file system path of given entry. * @returns `string` */ public getNativePath(entry: Entry): any; /** * Returns a token suitable for use with certain host-specific APIs (such as Photoshop). This token is valid only for the current plugin session. As such, it is of no use if you serialize the token to persistent storage, as the token will be invalid in the future. * * Note: When using the Photoshop DOM API, pass the instance of the file instead of a session token -- Photoshop will convert the entry into a session token automatically on your behalf. * @example * const fs = require('uxp').storage.localFileSystem; * let entry = await fs.getFileForOpening(); * let token = fs.createSessionToken(entry); * let result = await require('photoshop').action.batchPlay([{ * _obj: "open", * "target": { * _path: token, // Rather than a system path, this expects a session token * _kind: "local", * } * }], {}); * @returns the session token for the given entry */ createSessionToken(entry: Entry): string; /** * Returns the file system Entry that corresponds to the session token obtained from `createSessionToken`. If an entry cannot be found that matches the token, then a `Reference Error: token is not defined` error is thrown. * @returns the corresponding entry for the session token */ getEntryForSessionToken(token: string): Entry; /** * Returns a token suitable for use with host-specific APIs (such as Photoshop), or for storing a persistent reference to an entry (useful if you want to only ask for permission to access a file or folder once). A persistent token is not guaranteed to last forever -- certain scenarios can cause the token to longer work (including moving files, changing permissions, or OS-specific limitations). If a persistent token cannot be reused, you'll get an error at the time of use. * @example * const fs = require('uxp').storage.localFileSystem; * let entry = await fs.getFileForOpening(); * let token = await fs.createPersistentToken(entry); * localStorage.setItem("persistent-file", token); * @returns `Promise` - the persistent token for the given entry */ createPersistentToken(entry: Entry): any; /** * Returns the file system Entry that corresponds to the persistent token obtained from `createPersistentToken`. If an entry cannot be found that matches the token, then a `Reference Error: token is not defined` error is thrown. * * Note: retrieving an entry for a persistent token does _not_ guarantee that the entry is valid for use. You'll need to properly handle the case where the entry no longer exists on the disk, or the permissions have changed by catching the appropriate errors. If that occurs, the suggested practice is to prompt the user for the entry again and store the new token. * @example * const fs = require('uxp').storage.localFileSystem; * let entry, contents, tries = 3, success = false; * while (tries > 0) { * try { * entry = await fs.getEntryForPersistentToken(localStorage.getItem("persistent-file")); * contents = await entry.read(); * tries = 0; * success = true; * } catch (err) { * entry = await fs.getFileForOpening(); * localStorage.setItem("persistent-token", await fs.createPersistentToken(entry)); * tries--; * } * } * if (!success) { * // fail gracefully somehow * } * @returns `Promise` - the corresponding entry for the persistent token */ getEntryForPersistentToken(token: string): any; /** * Checks if the supplied object is a `FileSystemProvider`. It's safe to use even * if the object is `null` or `undefined`. Useful for type checking. * @param fs - the object to check * @returns If `true`, the object is a file system provider */ static isFileSystemProvider(fs: any): boolean; } /** * Represents a folder on a file system. You'll never instantiate this directly, * but will get it by calling [FileSystemProvider.getTemporaryFolder]{@link ./storage#gettemporaryfolder}, * [FileSystemProvider.getFolder]{@link ./storage#getfolderoptions}, or via [Folder.getEntries]{@link ./Folder#getentries}. * * Example * ```js * // Get the Folder instance via localFileSystem * const fs = require('uxp').storage.localFileSystem; * const folder = await fs.getTemporaryFolder(); // Gets the Folder instance * console.log(folder.isFolder); // returns true * ``` */ class Folder extends Entry { /** * Indicates that this instance is a folder. Useful for type checking. */ isFolder: any; /** * Returns an array of entries contained within this folder. * @example * const entries = await aFolder.getEntries(); * const allFiles = entries.filter(entry => entry.isFile); * @returns `Promise>` - The entries within the folder. */ getEntries(): any; /** * Creates an entry within this folder and returns the appropriate instance. * @example * const myNovel = await aFolder.createEntry("mynovel.txt"); * @example * const catImageCollection = await aFolder.createEntry("cats", {type: types.folder}); * @param name - the name of the entry to create * @param [options.type = types.file] - Indicates which kind of entry to create. Pass `Folder` to create a new folder. * Note that if the type is file then this method just create a file entry object and not the actual file on the disk. * The file actually gets created when you call for eg: write method on the file entry object. * @param [options.overwrite = false] - If `true`, the create attempt can overwrite an existing file * @returns `Promise` the created entry */ createEntry(name: string, options: { type?: symbol; overwrite?: boolean; }): any; /** * Creates a File Entry object within this folder and returns the appropriate instance. * Note that this method just create a file entry object and not the actual file on the disk. * The file actually gets created when you call for eg: write method on the file entry object. * @example * const myNovelTxtFile = await aFolder.createFile("mynovel.txt"); * @param name - the name of the file to create. * @param [options.overwrite = false] - If `true`, the create attempt can overwrite an existing file * @returns `Promise` - the created file entry */ createFile(name: string, options: { overwrite?: boolean; }): any; /** * Creates a Folder within this folder and returns the appropriate instance. * @example * const myCollectionsFolder = await aFolder.createFolder("collections"); * @param name - the name of the folder to create. * @returns `Promise` - the created folder entry object */ createFolder(name: string): any; /** * Gets an entry from within this folder and returns the appropriate instance. * @example * const myNovel = await aFolder.getEntry("mynovel.txt"); * @param filePath - the name/path of the entry to fetch * @returns `Promise` the fetched entry. */ getEntry(filePath: string): any; /** * Renames an entry to a new name. * @example * await myNovels.rename(myNovel, "myFantasticNovel.txt"); * @param entry - the entry to rename * @param newName - the new name to assign * @param [options.overwrite = false] - if `true`, renaming can overwrite an existing entry * @returns `Promise` */ renameEntry(entry: Entry, newName: string, options: { overwrite?: boolean; }): any; /** * Checks if an entry is a folder. Safe to use if entry might be `null` or * `undefined`. Useful for type checking. */ static isFolder: boolean; } } } /** * Provides a local key-value store useful for setting preferences and other kinds of data. * This data is technically persistent, but can be cleared in a variety of ways, * so you should not store data using localStorage that you cannot otherwise reconstruct. * * * Do not store passwords or other secure forms of data using `localStorage`. Instead, use [storage.secureStorage]{@link /uxp-api/reference-js/Modules/uxp/Key-Value%20Storage/SecureStorage/} */ declare class LocalStorage { /** * Number of items stored in the local storage. */ readonly length: number; /** * Returns the name of the nth key in the local storage. * @param index - Integer representing the number of the key * @returns Name of the key. If the index does not exist, null is returned. */ key(index: number): string; /** * Gets the value for the key from the local storage. * Returns null if the key does not exist. * @param key - Key to retrieve the value of. * @returns Value corresponding to the key as string. If the key does not exist, null is returned. */ getItem(key: string): string; /** * Adds key and value to the local storage. * Updates the value if the given key already exists. * @param key - Key to set value * @param value - Value for the key */ setItem(key: string, value: string): void; /** * Removes a key/value pair from the local storage if it exists. * Nothing happens if there's no item associated with the given key. * @param key - Key to remove */ removeItem(key: string): void; /** * Remove all key/value pairs from the local storage. */ clear(): void; } declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; /** * SessionStorage is available as `window.sessionStorage` * Provides a local key/value store useful for storing data that persists only for the plugin's current session. * For more information about the API itself, see the [localStorage]{@link ./LocalStorage} API */ declare class SessionStorage { } /** * Creates a new CountQueuingStrategy object with the provided high water mark. * @param init - Object with high water mark property. * @param init.highWaterMark - The total number of chunks that can be contained in the internal queue before backpressure is applied. */ declare class CountQueuingStrategy { constructor(init: { highWaterMark: number; }); /** * The high water mark. */ highWaterMark: number; /** * The size of chunk, always 1. */ size(): void; } declare class ReadableStreamDefaultController { /** * Returns the desired size to fill the controlled stream’s internal queue. * It can be negative, if the queue is over-full. */ desiredSize: number; /** * Closes the controlled readable stream. * Consumers will still be able to read any previously-enqueued chunks from the stream, * but once those are read, the stream will become closed. */ close(): void; /** * Enqueues the given chunk in the controlled readable stream. */ enqueue(chunk: any): void; /** * Errors the controlled readable stream, making all future interactions with it fail with the given error. */ error(error: any): void; } /** * Create a new ReadableStreamDefaultReader object and locks the stream to the new reader. */ declare class ReadableStreamDefaultReader { constructor(stream: ReadableStream); /** * Returns a promise that will be fulfilled when the stream becomes closed, * or rejected if the stream ever errors or the reader’s lock is released before the stream finishes closing. */ closed: any; /** * Cancels the stream, signaling a loss of interest in the stream by a consumer. * The supplied reason argument will be given to the underlying source’s cancel() method. * The returned promise will fulfill if the stream shuts down successfully, * or reject if the underlying source signaled that there was an error doing so. * It will reject with a TypeError (without attempting to cancel the stream) if the stream is currently locked. * @returns `Promise` */ cancel(reason: string): any; /** * Returns a promise that allows access to the next chunk from the stream’s internal queue, if available. * @returns

 If a chunk is available, the promise will be fulfilled with an object of the form * { value: theChunk, done: false }. *

 If the stream becomes closed, the promise will be fulfilled with an object of the form * { value: undefined, done: true }. *

 If the stream becomes errored, the promise will be rejected with the relevant error. */ read(): Promise; /** * Releases the reader’s lock on the corresponding stream. * After the lock is released, the reader is no longer active. * If the associated stream is errored when the lock is released, * the reader will appear errored in the same way from now on; otherwise, the reader will appear closed. * If the reader’s lock is released while it still has pending read requests, * then the promises returned by the reader’s read() method are immediately rejected with a TypeError. * Any unread chunks remain in the stream’s internal queue and can be read later by acquiring a new reader. */ releaseLock(): void; } /** * Creates a ReadableStream object from the given handlers. *

Note that `underlyingSource.type` and `underlyingSource.autoAllocateChunkSize` are not supported. * @param underlyingSource - Define how the constructed stream instance will behave. * @param underlyingSource.start(controller) - Called immediately when the object is constructed. * This method needs to do anything else required to set up the stream functionality. * If this process is to be done asynchronously, it can return a promise to signal success or failure. * The controller parameter passed to this method is a ReadableStreamDefaultController. * @param underlyingSource.pull(controller) - Called repeatedly when the stream's internal queue of chunks is not full, * up until it reaches its high water mark. * If pull() returns a promise, then it won't be called again until that promise fulfills. * If the promise rejects, the stream will become errored. * The controller parameter passed to this method is a ReadableStreamDefaultController. * @param underlyingSource.cancel(reason) - Called if the app signals that the stream is to be cancelled. * The contents should do whatever is necessary to release access to the stream source. * If this process is asynchronous, it can return a promise to signal success or failure. * The reason parameter contains a string describing why the stream was cancelled. * @param strategy - Defines a queuing strategy for the stream. * @param strategy.highWaterMark - Defines the total number of chunks that can be contained in the internal queue * before backpressure is applied. * @param strategy.size(chunk) - Indicates the size to use for each chunk, in bytes. */ declare class ReadableStream { constructor(underlyingSource: { start(controller: ReadableStreamDefaultController): (...params: any[]) => any; pull(controller: ReadableStreamDefaultController): (...params: any[]) => any; cancel(reason: string): (...params: any[]) => any; }, strategy: { highWaterMark: number; size(chunk: number): (...params: any[]) => any; }); /** * Indicate whether the readable stream is locked. */ readonly locked: boolean; /** * Cancel the readable stream. * @param reason - reason for the cancellation. * @returns `Promise` */ cancel(reason: string): any; /** * Create a reader and lock the stream to it. *

Note that currently ReadableStreamDefaultReader object is returned as options.mode "byob" is not supported. * @param options - Object with mode property. * @param options.mode - ReadableStreamDefaultReader being created, defaults to `undefined` and `byob` is not yet supported. */ getReader(options: { mode: any; }): ReadableStreamDefaultReader; /** * Provides a chainable way of piping the current stream through a transform stream. * @param transform - TransformStream or an object with the structure {writable, readable} * @param options.preventClose - If true, the source ReadableStream closing will no loger cause the destination WritableStream * to be closed. * @param options.preventAbort - If true, errors in the source ReadableStream will no longer abort the destination WritableStream. * @param options.preventCancel - If true, errors in the destination WritableStream will no longer cancel the source ReadableStream. * @param options.signal - If aborted, ongoing pipe operations can be aborted. * @returns ReadableStream of the input transform stream. */ pipeThrough(transform: TransformStream | WritableAndReadable, options: { preventClose: boolean; preventAbort: boolean; preventCancel: boolean; signal: AbortSignal; }): ReadableStream; /** * Pipes this readable stream to a given writable stream destination. * @param destination - Final destination for the ReadableStream. * @param options - (Optional) Used when piping to the writable stream. * @param options.preventClose - If true, the source ReadableStream closing will no loger cause the destination WritableStream to be closed. * @param options.preventAbort - If true, errors in the source ReadableStream will no longer abort the destination WritableStream. * @param options.preventCancel - If true, errors in the destination WritableStream will no longer cancel the source ReadableStream. * @param options.signal - If aborted, ongoing pipe operations can be aborted. * @returns `Promise` resolves when the piping process has completed. */ pipeTo(destination: WritableStream, options: { preventClose: boolean; preventAbort: boolean; preventCancel: boolean; signal: AbortSignal; }): any; /** * Tees the current ReadableStream, returning a two-element array * containing the two resulting branches as new ReadableStream instances. * @returns an array containing two ReadableStream instances. */ tee(): any[]; } /** * Object with the structure {writable, readable} */ declare type WritableAndReadable = any; declare class TransformStreamDefaultController { /** * Returns the desired size to fill the readable side’s internal queue. * It can be negative, if the queue is over-full. */ desiredSize: number; /** * Enqueues the given chunk chunk in the readable side of the controlled transform stream. * @param chunk - The chunk being queued. A chunk is a single piece of data. */ enqueue(chunk: any): void; /** * Errors both the readable side and the writable side of the controlled transform stream, * making all future interactions with it fail with the given error. * Any chunks queued for transformation will be discarded. */ error(reason: string): void; /** * Closes the readable side and errors the writable side of the controlled transform stream. * This is useful when the transformer only needs to consume a portion of the chunks written to the writable side. */ terminate(): void; } /** * Cretes a new TransformStream object wrapping the provided transformer. * If no transformer argument is supplied, then the result will be an identity transform stream. * @param transformer - Defines algorithms for the specific transformation to be performed. * @param transformer.start - Called when the TransfromStream is constructed. * @param transformer.transform - Called when a chunk written to the writable is ready to be transformed. * If no transform method is supplied, the identity transform is used. * @param transformer.flush - Called after all chunks written to the writable have been successfully transformed, * and the writable is about to be closed. * @param writableStrategy - Queuing strategy for the stream. * @param writableStrategy.highWaterMark - A non-negative number. * The total number of chunks that can be contained in the internal queue before backpressure is applied * @param writableStrategy.size - The size to use for each chunk, in bytes. * @param readableStrategy - Queuing strategy for the stream. * @param readableStrategy.highWaterMark - A non-negative number. * The total number of chunks that can be contained in the internal queue before backpressure is applied * @param readableStrategy.size - The size to use for each chunk, in bytes. */ declare class TransformStream { constructor(transformer: { start: (...params: any[]) => any; transform: (...params: any[]) => any; flush: (...params: any[]) => any; }, writableStrategy: { highWaterMark: number; size: (...params: any[]) => any; }, readableStrategy: { highWaterMark: number; size: (...params: any[]) => any; }); /** * ReadableStream representing the readable of this TransformStream. */ readable: ReadableStream; /** * WritableStream representing the writable of this TransformStream. */ writable: WritableStream; } declare class WritableStreamDefaultController { /** * Returns AbortSignal that can be used to abort the pending write or close operation when the stream is aborted. */ signal: AbortSignal; /** * Closes the controlled writable stream, making all future interactions with it fails with the given error. */ error(message: string): void; } /** * Creates a new WritableStreamDefaultWriter object. */ declare class WritableStreamDefaultWriter { constructor(stream: WritableStream); /** * Returns a Promise that fullfils if the stream becomes closed, * or rejects if the stream errors or the writer's lock is released. */ closed: Promise; /** * The desired size required to fill the stream's internal queue. * It will return null if the stream cannot be successfully written to. * It will return zero if the stream is closed. */ desiredSize: number; /** * Returns a Promise that resolves when the desired size of the stream's internal queue transitions * from non-positive to positive, signaling that it is no longer applying backpressure. * Once the desired size dips back to zero or below, the getter will return a new promise that stays pending until the next transition. * If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become rejected. */ ready: Promise; /** * Aborts the stream, signaling that the producer can no longer successfully write to the stream * and it is to be immediately moved to an errored state, with any queued-up writes discarded. * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled that there was an error doing so. * It will reject with a TypeError if the stream is curretly locked. * @returns `Promise` */ abort(reason: string): any; /** * Closes the stream and returns a Promise that will fulfill if all remaining chunks are successfully written * and the stream successfully closes, or rejects if an error is encountered during this process. * It will reject with a TypeError (without attempting to cancel the stream) if the stream is currently locked. * @returns `Promise` */ close(): any; /** * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active. * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; * otherwise, the writer will appear closed. */ releaseLock(): void; /** * Writes the given chunk to the writable stream and its underlying sink, * then returns a Promise that resolves to indicate the success or failure of the write operation. * @returns `Promise` */ write(chunk: any): any; } /** * Creates a new WritableStream object wrapping the provided underlying sink. * @param underlyingSink - Defines how the constructred stream object will behave. * @param underlyingSink.start(contorller) - Called immediately when the object is constructed. * If this process is to be done asynchronously, it can return a promise to signal success or failure. * The controller parameter passed to this method is a WritableStreamDefaultController. * This can be used by the developer to control the stream during set up. * @param underlyingSink.write(chunk,controller) - Called when a new chunk of data is ready to be written to the underlying sink. * It can return a promise to signal success or failure of the write operation. * The controller parameter passed to this method is a WritableStreamDefaultController. * This method will be called only after previous writes have succeeded, * and never after the stream is closed or aborted. * @param underlyingSink.close(controller) - Called if the app signals that it has finished writing chunks to the stream. * If this process is asynchronous, it can return a promise to signal success or failure. * This method will be called only after all queued-up writes have succeeded. * The controller parameter passed to this method is a WritableStreamDefaultController. * @param strategy - Defines a queuing strategy for the stream. * @param strategy.highWaterMark - The total number of chunks that can be contained * in the internal queue before backpressure is applied. * @param strategy.size(chunk) - Indicates the size to use for each chunk, in bytes. */ declare class WritableStream { constructor(underlyingSink: { start(controller: WritableStreamDefaultController): (...params: any[]) => any; write(chunk: number, controller: WritableStreamDefaultController): (...params: any[]) => any; close(controller: WritableStreamDefaultController): (...params: any[]) => any; }, strategy: { highWaterMark: number; size(chunk: number): (...params: any[]) => any; }); /** * Indicate whether the WritableStream is locked. */ locked: boolean; /** * Aborts the stream, signalling that the producer can no longer successfully write to the stream and * it's to be immediately moved to an error state, with any queued writes discarded. * @returns `Promise` */ abort(reason: any): any; /** * Closes the stream. * @returns `Promise` */ close(): any; /** * Returns a new WritableStreamDefaultWriter object and locks the stream to that object. * While the stream is locked, no other writer can be acquired until this one is released. */ getWriter(): WritableStreamDefaultWriter; } declare class Crypto { /** * Generates cryptographically strong random values * @param array - An integer-based TypedArray, that is one of Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, BigUint64Array but not Float32Array nor Float64Array * @returns The same array passed as 'array' but with its contents replaced with the newly generated random numbers */ getRandomValues(array: IntegerArray): any; /** * Generates a new version 4 UUID * @returns String containing a randomly generated, 36 character long v4 UUID */ randomUUID(): string; } /** * Integer-based TypedArray, that is one of Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, BigUint64Array * but not Float32Array nor Float64Array */ declare type IntegerArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | BigInt64Array | BigUint64Array; /** * The Blob object represents a blob, which is a file-like object of immutable, raw data; * they can be read as text or binary data, or converted into a [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) * so its methods can be used for processing the data. * @param array - Iterable object such as an Array, having ArrayBuffers, TypedArrays, DataViews, Blobs, strings, or a mix of any of such elements, * that will be put inside the Blob. Note that strings here are encoded as UTF-8, unlike the usual JavaScript UTF-16 strings. * @param [options] - `(optional)` Object which may specify any of the following properties: * @param [options.type] - `(optional)` MIME type of the data that will be stored into the blob. The default value is the empty string, (""). * @param [options.endings] - `(optional)` How to interpret newline characters (\n) within the contents, if the data is text. The default value, transparent, * copies newline characters into the blob without changing them. To convert newlines to the host system's native convention, specify the value native. */ declare class Blob { constructor(array: any[], options?: { type?: string; endings?: string; }); /** * Size of the Blob in bytes. */ readonly size: number; /** * MIME type of the Blob. */ readonly type: string; /** * Get the contents of the Blob in the form of an ArrayBuffer. * @returns `Promise` Promise that resolves with an ArrayBuffer that contains the blob's data in binary form. */ arrayBuffer(): any; /** * Get a portion of the Blob's data selected from start to end (end not included). * @param [start = 0] - `(Optional)` Index into the Blob indicating the first byte to include in the new Blob * @param [end = size] - `(Optional)` Index into the Blob indicating the first byte that will NOT be included in the new Blob * @param [contentType = ""] - `(Optional)` String containing the file's {@link https://developer.mozilla.org/en-US/docs/Glossary/MIME_type | MIME type}, * or empty string if the type could not be determined. Refer {@link https://developer.mozilla.org/en-US/docs/Web/API/Blob/type#value | Blob.type} * @returns New Blob object containing the specified subset of the data contained with the blob on which this method was called. * The original blob is not altered. */ slice(start?: number, end?: number, contentType?: string): Blob; /** * Get the data contained within the Blob as a ReadableStream. * @returns Content of the Blob. */ stream(): ReadableStream; /** * Get contents of the Blob as a string. * @returns `Promise` Promise that resolves with a string which contains the blob's data as a text string. * The data is always presumed to be in UTF-8 format. */ text(): any; } /** * Blobs are used to create URLs, which can be used as `src` in `HTMLImageElement`. It can be created using image data in the standard compression formats such as PNG, JPG, JPEG ,etc. * ImageBlob is a custom type that extends the support to use uncompressed image data.

* e.g. ImageBlob can be created by passing arrayBuffer containing the RGB values for each pixel and options containing metadata to interpret the data in arraybuffer. * * ImageBlob can be created in the following ways * - standard image compression formats: pass ArrayBuffer of the `standard compression formats` and mimeType of the compression in the options.type. * - uncompressed image: pass ArrayBuffer of the uncompressed image data i.e. raw data of each pixel and options to interpret the data, option.type should be passed as "image/uncompressed".

* * [PhotoshopImageData](/ps_reference/media/imaging/#photoshopimagedata-1) is compatible with ImageBlob, * `PhotoshopImageData` object can be directly passed in for options. * * Note: `ImageBlob support is subject to enablement by HostApp. Currently supported by Photoshop.` * @example * // Updating HTML with ImageBlob * * * * * * * * * *
* Paint image * *
* * * * * //Creating ImageBlob by creating the options Object seperatly and then pass the Object as argument * function getPixel() { * const imageMetaData = { * width : 8, * height : 8, * colorSpace : "RGB", * colorProfile : "", * pixelFormat : "RGB", * components : 3, * componentSize : 8, * hasAlpha : false, // Alpha is set to false * type : "image/uncompressed", * } * * let buffer = new ArrayBuffer(imageMetaData.width * imageMetaData.height * 3); * let colorArrayView = new Uint8Array(buffer); * for(let i = 0; i < colorArrayView.length / 4; i++) { * // here we are creating a red image, update values to see the variations * colorArrayView[i * 3] = 255; // Red Component * colorArrayView[i * 3 + 1] = 0; // Green Component * colorArrayView[i * 3 + 2] = 0; // Blue Component * } * let imageBlob = new ImageBlob(colorArrayView, imageMetaData); * // Generate url which can be used as src on HTMLImageElement * const url = URL.createObjectURL(imageBlob); * // ensure that there is a HTMLImageElement in the Document with id `image`. * const imageElement = document.getElementById("image"); * imageElement.src = url; * * // revoke(destroy image from the memory) when url is no more required. * URL.revokeObjectURL(url); * } * document.addEventListener("DOMContentLoaded", () => { * document.getElementById("pixel-btn").addEventListener("click", getPixel); * }); * @example * // Creating ImageBlob using PhotoshopImageData object(more details about PhotoshopImageData in description). * const photoshopImageObject; // get image object using Photoshp's imaging apis. * let colorArrayView = await photoshopImageObject.getData(); * * let imageBlob = new ImageBlob(colorArrayView, photoshopImageObject); * // Generate url which can be used as src on HTMLImageElement * const url = URL.createObjectURL(imageBlob); * // ensure that there is a HTMLImageElement in the Document with id `image`. * const imageElement = document.getElementById("image"); * imageElement.src = url; * * // revoke(destroy image from the memory) when url is no more required. * URL.revokeObjectURL(url); * @param arrayBuffer - ArrayBuffer containing the image data * @param options - Meta data to interpret ArrayBuffer passed. For standard compression options.type is mandatory, for uncompressed image data all the values are mandatory unless mentioned optional * @param options.type - mimeType of the imageData passed. Could be standard formats "image/png", "image/jpg" and for uncompressed data "image/uncompressed" * @param options.width - The width in pixels of the image data * @param options.height - The height in pixels of the image data * @param options.colorSpace - The color space (or mode) for the image data. This can be "RGB" or "Grayscale" * @param options.hasAlpha - True if the image includes an alpha channel * @param options.components - Number of components per pixel. This is 3 for RGB, 4 for RGBA and so forth * @param options.componentSize - Number of bits per component. This can be 8 or 16 * @param options.pixelFormat - Memory layout (order) of components in a pixel. Could be "RGB", "RGBA", or "Gray" * @param options.colorProfile - `[Optional]` - The color profile (or mode) for the image data. This could be be "Adobe RGB (1998)" */ declare class ImageBlob extends Blob { constructor(arrayBuffer: ArrayBuffer, options: { type: string; width: number; height: number; colorSpace: string; hasAlpha: boolean; components: number; componentSize: number; pixelFormat: string; colorProfile: string; }); /** * Size of the Blob in bytes. */ readonly size: number; /** * MIME type of the Blob. */ readonly type: string; /** * Get the contents of the Blob in the form of an ArrayBuffer. * @returns `Promise` Promise that resolves with an ArrayBuffer that contains the blob's data in binary form. */ arrayBuffer(): any; /** * Get a portion of the Blob's data selected from start to end (end not included). * @param [start = 0] - `(Optional)` Index into the Blob indicating the first byte to include in the new Blob * @param [end = size] - `(Optional)` Index into the Blob indicating the first byte that will NOT be included in the new Blob * @param [contentType = ""] - `(Optional)` String containing the file's {@link https://developer.mozilla.org/en-US/docs/Glossary/MIME_type | MIME type}, * or empty string if the type could not be determined. Refer {@link https://developer.mozilla.org/en-US/docs/Web/API/Blob/type#value | Blob.type} * @returns New Blob object containing the specified subset of the data contained with the blob on which this method was called. * The original blob is not altered. */ slice(start?: number, end?: number, contentType?: string): Blob; /** * Get the data contained within the Blob as a ReadableStream. * @returns Content of the Blob. */ stream(): ReadableStream; /** * Get contents of the Blob as a string. * @returns `Promise` Promise that resolves with a string which contains the blob's data as a text string. * The data is always presumed to be in UTF-8 format. */ text(): any; } /** * The `path` module provides utilities for working with file and directory paths. * This module accepts string and Entry object as path parameters. * However, local file schemes, such as `plugin-data:` or `plugin-temp:`, will not be resolved to a native path in string paths. * The `path` module is registered in the global scope and can be used without declaration. */ declare class Path { /** * Normalize a string path, reducing '..' and '.' parts. * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. * @param path - path to normalize * @returns normalized string path */ normalize(path: string | Entry): string; /** * Join all arguments together and normalize the resulting path. * @param paths - paths to join * @returns joined string path */ join(paths: (string | Entry)[]): string; /** * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. * * Starting from leftmost {from} parameter, resolves {to} to an absolute path. * * If {to} isn't already absolute, {from} arguments are prepended in right to left order, * until an absolute path is found. If after using all {from} paths still no absolute path is found, * the current working directory is used as well. The resulting path is normalized, * and trailing slashes are removed unless the path gets resolved to the root directory. * @param paths - a sequence of paths or path segments * @returns resolved string path */ resolve(paths: (string | Entry)[]): string; /** * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. * * If the given {path} is a zero-length string, `false` will be returned. * @param path - path to test * @returns if the path is an absolute path or not */ isAbsolute(path: string | Entry): boolean; /** * Solve the relative path from {from} to {to} based on the current working directory. * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. * @param from - base path to find from * @param to - relative path to find to * @returns relative string path */ relative(from: string, to: string): string; /** * Return the directory name of a path. Similar to the Unix dirname command. * @param path - the path to evaluate * @returns the directory name of a path */ dirname(path: string | Entry): string; /** * Return the last portion of a path. Similar to the Unix basename command. * Often used to extract the file name from a fully qualified path. * @param path - the path to evaluate * @param [ext] - an extension to remove from the result * @returns the last portion of a path */ basename(path: string | Entry, ext?: string): string; /** * Return the extension of the path, from the last '.' to end of string in the last portion of the path. * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. * @param path - the path to evaluate * @returns the extension of the path */ extname(path: string | Entry): string; /** * The platform-specific file separator. '\\' or '/'. */ sep: string; /** * The platform-specific file delimiter. ';' or ':'. */ delimiter: string; /** * Returns an object from a path string - the opposite of format(). * @param path - path to evaluate * @returns { dir: `string`, root: `string`, base: `string`, name: `string`, ext: `string` } */ parse(path: string | Entry): any; /** * Returns a path string from an object - the opposite of parse(). * @param pathObject - { dir: `string`, root: `string`, base: `string`, name: `string`, ext: `string` } path to evaluate * @returns a path string from an object */ format(pathObject: any): string; /** * It provides access to POSIX specific implementations of the path methods. * Same as parent object on posix. */ posix: any; /** * It provides access to Windows-specific implementations of the path methods. * Same as parent object on Windows */ win32: any; } declare type Entry = any; declare type Request = any; declare type iterator = any; /** * Fetches a resource from the network. * @param input - Either the URL string to connect with or a Request object having the URL and the init option. * @param [init] - Custom settings for a HTTP request. * @param [init.method] - HTTP request method. The default value is "GET". * @param [init.headers] - HTTP request headers to add. * @param [init.body] - Body to add to HTTP request. * @param [init.credentials] - Indicates whether to send cookies. The default value is "include". * Possible values and functions are as follows: *
    *
  • "omit" : cookies are NOT sent. *
  • "include" : cookies are sent. *
* @returns `Promise` Promise that resolves to a Response object. */ declare function fetch(input: string | Request, init?: { method?: string; headers?: Headers; body?: string | ArrayBuffer | TypedArray | Blob | FormData | ReadableStream | URLSearchParams; credentials?: string; }): any; declare module "global" { /** * FormData provides a way to construct a set of key/value pairs, which can be used in fetch(), XMLHttpRequest. */ class FormData { /** * Appends a key value pair into FormData. * If the value is either ArrayBuffer and TypedArray, its buffer as well as the object are copied. * However, if the value is a File object value, the File object is cloned but its content is not cloned. * Consequently, the File object and the cloned one refer to the same content. * @param name - Key string for the pair * @param value - Value for the pair * @param fileName - 'Optional' file name to use for a File or a Blob object value. * The default filename is "blob" for Blob object and the file name would be taken from the name property for File object. */ append(name: string, value: string | ArrayBuffer | TypedArray | File | Blob, fileName: string): void; /** * Removes all entries from FormData whose name is same with the input name. * @param name - Name of the key to delete */ delete(name: string): void; /** * Returns an iterator which iterates through all key/value pairs contained in the FormData. * The key of each pair is a string object and the value is either a string or a Blob object. * @returns Iterator for all key-value pairs in FormData. */ entries(): iterator; /** * Returns the first value associated with a given key from within a FormData object. * Use getAll() if you expect multiple values and want all of them. * @param name - Name of the key to retrieve * @returns Value whose key matches the specified name. Otherwise, null. */ get(name: string): string | Blob; /** * Returns all the values associated with a given key from within a FormData object. * @param name - Name of the key to retrieve * @returns Array of values whose key matches the specified name. Otherwise, an empty list. */ getAll(name: string): any[]; /** * Test if a FormData object contains a certain key. * @param name - Name of the key to test * @returns True if a key of FormData matches the specified name. Otherwise, false. */ has(name: string): boolean; /** * Returns an iterator which iterates through all keys in FormData. * The keys are strings. * @returns Iterator of FormData's keys. */ keys(): iterator; /** * If there are entries whose name is same with the input name, * replaces the first existing entry with new entry and removes the others. * If not, appends a new entry with name/value. * @param name - Name of the field * @param value - Field's value. The value is converted to a string if the value is neither string nor Blob. * @param filename - Filename reported to the server when a Blob object or a File object is passed as a value. * The default filename is "blob" for Blob object and the file name would be taken from the name property for File object. */ set(name: string, value: string | Blob, filename: string): void; /** * Returns an iterator which iterates through all values in the FormData. * The values are strings or Blob objects. * @returns Iterator of FormData's values. */ values(): iterator; } } /** * Headers class represents HTTP request and response headers. * @param init - Object containing any HTTP headers you want to pre-populate your Headers with. */ declare class Headers { constructor(init: string | Headers); /** * Appends a new value onto an existing header inside a Header object, or add the header if it does not exist. * @param name - Name of the HTTP header * @param value - Value of the HTTP header */ append(name: string, value: string): void; /** * Deletes a header from the current Header object. * @param name - Name of the HTTP header */ delete(name: string): void; /** * Returns a byte string of all the values of a header within the Headers object with given name. * If the requested header does not exist in the Headers object, it returns null. * @param name - Name of the HTTP header. * @returns Value of the retrieved header. */ get(name: string): string; /** * Indicates whether the Headers object contains a certain header. * @param name - Name of the HTTP header. * @returns Indicates whether the Headers object contains the input name. */ has(name: string): boolean; /** * Sets a new value for the existing header inside the Headers object, or add the header if it does not exist. * @param name - Name of the HTTP header. * @param value - Value of the HTTP header. */ set(name: string, value: string): void; /** * Executes a callback function once per each key/value pair in the Headers object. * @param callbackFn - Function to execute for each entry in the map. It takes the following arguments. * @param thisArg - Value to use as this when executing callback. */ forEach(callbackFn: (...params: any[]) => any, thisArg: any): void; /** * Returns an iterator object allowing to go through all keys contained in the Headers object. * @returns Iterator. */ keys(): iterator; /** * Returns an iterator object allowing to go through all values contained in the Headers object. * @returns Iterator. */ values(): iterator; /** * Returns an iterator object allowing to go through all key/value pairs contained in the Headers object. * @returns Iterator. */ entries(): iterator; } /** * Response class represents a resource request. * @param [body = null] - Body of the response. * @param [options = {}] - Custom settings that you want to apply to the response. * @param [options.status = 200] - Status code of the response. * @param [options.statusText] - Status message associated with the status code. The default value is "". * @param [options.headers = {}] - Any headers that you want to add to the response. */ declare class Response { constructor(body?: string | Blob | ArrayBuffer | TypedArray | FormData | ReadableStream | URLSearchParams, options?: { status?: number; statusText?: string; headers?: Headers | string; }); /** * ReadableStream object with the body contents or null if response's body is empty. */ readonly body: ReadableStream; /** * Indicates whether the response body has been read yet. */ readonly bodyUsed: boolean; /** * Headers object associated with the response. */ readonly headers: Headers; /** * Indicates whether the response was successful (if status is in range 200-299) or not. */ readonly ok: boolean; /** * HTTP status codes of the response. */ readonly status: number; /** * Status message corresponding to the HTTP status code. Default is "". */ readonly statusText: string; /** * URL of the response. */ readonly url: string; /** * Reads the response stream to completion and returns it as a Promise that resolves with an ArrayBuffer. * @returns `Promise` Promise that resolves with an ArrayBuffer. */ arrayBuffer(): any; /** * Reads the response stream to completion and returns it as a Promise that resolves with a Blob. * @returns `Promise` Promise that resolves with a Blob. */ blob(): any; /** * Creates a copy of the current response object. * @returns Copy of the response. */ clone(): Response; /** * Reads the response stream to completion and returns it as a Promise that resolves with a FormData. * @returns `Promise` Promise that resolves with a FormData. */ formData(): any; /** * Reads the response stream to completion and * returns it as a Promise that resolves with the result of parsing the body text as JSON. * @returns `Promise` Promise that resolves to JSON object. */ json(): any; /** * Reads the response stream to completion and returns it as a Promise that resolves with a String decoded using UTF-8. * @returns `Promise` Promise that resolves with a String. */ text(): any; /** * @returns Response object */ static error(): Response; /** * @param url - URL that the new response is to originate from. * @param [status = 302] - Status code for the response. Possible values are 301, 302, 303, 307 and 308. * @returns Response object */ static redirect(url: string, status?: number): Response; } /** * WebSocket provides the API for creating and managing a WebSocket connection to a server, * as well as for sending and receiving data on the connection. * @example * var ws = new WebSocket("wss://demos.kaazing.com/echo","wss"); * @param url - URL to which to connect; this should be the URL to which the WebSocket server will respond. * @param protocols - Either a single protocol string or an array of protocol strings. */ declare class WebSocket { constructor(url: string, protocols: string | string[]); /** * Current state of the WebSocket connection. * One of the following values: * * CONNECTING(0) : Socket has been created. The connection is not yet open. * OPEN(1) : Connection is open and ready to communicate. * CLOSING(2) : Connection is in the process of closing. * CLOSED(3) : Connection is closed or couldn't be opened. */ readonly readyState: number; /** * URL of the WebSocket as resolved by the constructor. */ readonly url: string; /** * Name of the sub-protocol the server selected. * This will be one of the strings specified in the protocols parameter when creating the WebSocket object. * It returns an empty string if no connection is established. */ protocol: string; /** * Number of bytes of data that have been queued using calls to send() but not yet transmitted to the network. * This value resets to zero once all queued data has been sent. * This value does not reset to zero when the connection is closed; * If you keep calling send(), this will continue to climb. */ readonly bufferedAmount: number; /** * Enqueues the specified data to be transmitted to the other end over the WebSocket connection, * increasing the value of bufferedAmount by the number of bytes needed to contain the data. * If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. * @example * ws.send(new Float32Array([ 5, 2, 1, 3, 6, -1 ])) * @example * ws.send(new Int32Array([5,-1]).buffer) * @param data - Data to send to the server. */ send(data: string | ArrayBuffer | ArrayBufferView): void; /** * Closes the websocket connection. * @param [code = 1000] - Integer value as per https://developer.mozilla.org/en-US/docs/Web/API/WebSocket#close(). * @param [reason = ""] - Human-readable string explaining why the connection is closing. The default value is "". */ close(code?: number, reason?: string): void; /** * Type of the binary data being received over WebSocket connection. * Available binary types: "blob", "arraybuffer". */ binaryType: string; static CONNECTING: any; static OPEN: any; static CLOSING: any; static CLOSED: any; } declare type XMLHttpRequestEventUpload = any; /** * XMLHttpRequest objects are used to interact with servers. * You can retrieve data from a URL without having to do a full page refresh. * This enables a Web page to update just part of a page without disrupting what the user is doing. */ declare class XMLHttpRequest { /** * URL of the response or the empty string if the URL is null. * Any URL fragment present in the URL will be stripped away and will be the final URL obtained after any redirects. * @example * const xhr = new XMLHttpRequest(); * xhr.onload = () => { * console.log(xhr.responseURL); * }; * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); */ readonly responseURL: string; /** * State of the XMLHttpRequest object. Available states are as follows. * * UNSENT(0): Object has been constructed. * OPENED(1): open() method has been successfully invoked. * HEADERS_RECEIVED(2): All headers of a response have been received. * LOADING(3): Response body is being received. * DONE(4): Data transfer has been completed or something went wrong during the transfer. * @example * const xhr = new XMLHttpRequest(); * xhr.onreadystatechange = () => { * console.log(xhr.readyState); * }; * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); */ readonly readyState: number; /** * Text receive from a server following a request being sent. * If readyState is not either LOADING or DONE, it returns the empty string. * @example * const xhr = new XMLHttpRequest(); * xhr.addEventListener("load", () => { * if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { * console.log(xhr.responseText); * } * }); * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); */ readonly responseText: string; /** * Document containing the XML or HTML received by the request or * null if the request was unsuccessful, has not yet been sent, or * if the data cannot be parsed as XML or HTML. * @example * const xhr = new XMLHttpRequest(); * xhr.onload = () => { * if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { * console.log(xhr.responseXML); * } * }; * xhr.open("GET", "https://www.mydocumentserver.com"); * xhr.responseType = "document"; * xhr.send(); */ readonly responseXML: Document; /** * Response's body content. * The value is null if the request is not yet complete or was unsuccessful. * @example * const xhr = new XMLHttpRequest(); * xhr.onload = () => { * if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { * console.log(xhr.response); * } * }; * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); */ readonly response: string | ArrayBuffer | Blob | Document | any; /** * HTTP status code of the response. * @example * const xhr = new XMLHttpRequest(); * xhr.onload = () => { * console.log(xhr.status); * }; * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); */ readonly status: number; /** * String containing the response's status message. * It will be an empty string if the request's readyState is UNSENT or OPENED. * @example * const xhr = new XMLHttpRequest(); * xhr.onload = () => { * console.log(xhr.statusText); * }; * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); */ readonly statusText: string; /** * Number of milliseconds a request can take before automatically being terminated. * Default value is 0, which means there is no timeout. */ timeout: number; /** * Type of data contained in the response. * Available types are as follows. * * "" (Empty string): Default type. Same as "text". * "text" : Text in s string. * "arrayBuffer" : ArrayBuffer containing binary data. * "blob" : Blob object containing binary data. * "document" : HTML Document or XML Document based on MIME type of the received data. * "json" : Object created by parsing the contents of the received data as JSON. */ responseType: string; /** * Gets the value of the withCredentials. It indicates whether to send cookies on a HTTP request. * When the value is set to true, XMLHttpRequest sends cookies. Otherwise, cookies are not sent. * Note that unlike the specification, the default is true. */ withCredentials: boolean; /** * XMLHttpRequestEventUpload object that can be used to monitor an upload's progress. * The following events can be triggered on an upload object and used to monitor the upload. * * 'loadstart' : Upload has begun. * 'progress' : Periodically delivered to indicate the amount of progress made so far. * 'abort' : Upload operation was aborted. * 'error' : Upload failed due to an error. * 'load' : Upload completed successfully. * 'timeout' : Upload timed out because a reply did not arrive within the time interval specified by the timeout. * 'loadend' : Upload finished. * @example * const xhr = new XMLHttpRequest(); * xhr.open("POST", "https://www.myserver.com"); * xhr.upload.onprogress = (e) => { * console.log(`Uploading ${(e.loaded / e.total) * 100}%`); * }; * const arraybuffer = new ArrayBuffer(1024 * 1024); * // fill the arraybuffer with contents. * xhr.send(arraybuffer); */ readonly upload: XMLHttpRequestEventUpload; /** * Aborts the request if it has already been sent. * When a request is aborted, its readyState is changed to UNSENT(0) and the request's status code is set to 0. * @example * const xhr = new XMLHttpRequest(); * xhr.onabort = () => { * console.log("aborted"); * }; * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); * abortButton.addEventListener("click", () => { * xhr.abort(); * }); */ abort(): void; /** * Returns sorted and combined response’s header list. * Each header field is defined by a group of [lower cased name]": "[value]"\r\n". Combined value is separated by ", ". * @example * const xhr = new XMLHttpRequest(); * xhr.onreadystatechange = () => { * if (xhr.readyState === XMLHttpRequest.HEADERS_RECEIVED) { * console.log(xhr.getAllResponseHeaders()); * } * }; * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); * @returns All the response headers. */ getAllResponseHeaders(): string; /** * Returns the matching value of the given field name in response's header. * The search key value is case-insensitive. * @example * const xhr = new XMLHttpRequest(); * xhr.onreadystatechange = () => { * if (xhr.readyState === XMLHttpRequest.HEADERS_RECEIVED) { * console.log(xhr.getResponseHeader("Content-Type")); * } * }; * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); * @param name - Name to search in response's header list. * @returns Value of the given name in response's header list. */ getResponseHeader(name: string): string; /** * Initializes a request or re-initializes an existing one. * Self-signed certificates are not currently supported for HTTPS connections. * Note that UXP does not support synchronous request, which means 'async' is false. * @param method - HTTP request method to use, such as "GET", "POST", "PUT", "DELETE", etc. Ignored for non-HTTP(S) URLs. * @param url - String representing the URL to send the request to. * @param [async = true] - Optional Boolean parameter, defaulting to true, indicating whether or not to perform the operation asynchronously. * If this value is false, the send() method does not return until the response is received. * If true, notification of a completed transaction is provided using event listeners. * This must be true if the multipart attribute is true, or an exception will be thrown. * @param [user = null] - Optional user name to use for authentication purposes; by default, this is the null value. * @param [password = null] - Optional password to use for authentication purposes; by default, this is the null value. */ open(method: string, url: string, async?: boolean, user?: string, password?: string): void; /** * Specifies a MIME type other than the one specified in the response to be used * when interpreting the data being transferred in a request. * If it fails to parse the MIME type, "application/octet-stream" will be used to interpret the data. * @example * const xhr = new XMLHttpRequest(); * xhr.onload = () => { * console.log(xhr.response); * console.log(xhr.responseText); * }; * xhr.open("GET", "https://www.myxmlserver.com"); * xhr.overrideMimeType("text/plain"); * xhr.send(); * @param mimetype - MIME type to use instead of the one specified in the response. * Since Only UTF-8 is supported for charset of text encoding, MIME type’s parameters "charset" with other values than 'UTF-8' is not valid. */ overrideMimeType(mimetype: string): void; /** * Adds a new request header or appends a value to an existing request header. * If a header is forbidden request header, it does nothing and just returns. * The following are forbidden request headers. * * `Accept-Charset` * `Accept-Encoding` * `Access-Control-Request-Headers` * `Access-Control-Request-Method` * `Connection` * `Content-Length` * `Cookie` * `Cookie2` * `Date` * `DNT` * `Expect` * `Host` * `Keep-Alive` * `Origin` * `Referer` * `Set-Cookie` * `TE` * `Trailer` * `Transfer-Encoding` * `Upgrade` * `Via` * If header starts with `proxy-` or `sec-`. * @example * const xhr = new XMLHttpRequest(); * xhr.open("GET", "https://www.mywebserver.com"); * xhr.setRequestHeader("Accept", "text/xml"); * xhr.send(); * @param header - Name of the header whose value is to be set. * @param data - Value to set as the body of the header. */ setRequestHeader(header: string, data: string): void; /** * Sends the request to the server. * Body can be a Blob, an ArrayBuffer, a TypedArray, a DataView, a FormData or a string. * If no value is specified for the body, a default value of null is used. * * There is a caveat for sending a FormData object. The files in the FormData object are being read after calling this method. * To ensure uploading files as-is, the file contents or files shouldn't be changed until uploading files to the server is done. see [XMLHttpRequest.upload]{@link #module:global.xmlhttprequest.upload}. * If there is a problem during reading files, the XMLHttpRequest transaction initiated by this method can be aborted with an error event fired. * @example * Getting the resource as text * const xhr = new XMLHttpRequest(); * xhr.addEventListener("load", () => { * console.log(xhr.responseText); * }); * xhr.open("GET", "https://www.adobe.com"); * xhr.send(); * @example * Post request * const xhr = new XMLHttpRequest(); * xhr.onreadystatechange = () => { * if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { * console.log(xhr.responseText); * } * }; * xhr.open("POST", "https://www.myserver.com"); * xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); * xhr.send("foo=bar&lorem=ipsum"); * @param [body = \null] - Body of data to be sent in the request. */ send(body?: any): void; static UNSENT: any; static OPENED: any; static HEADERS_RECEIVED: any; static LOADING: any; static DONE: any; } declare class AbortController { /** * AbortSignal object, which can be used to abort a request */ signal: AbortSignal; /** * Aborts a request before it has completed. * If the reason is not specified, the reason is set to "AbortError" DomException * @param reason - the reason why the operation was aborted */ abort(reason: any): void; } declare class AbortSignal { /** * Creates an AbortSignal object that is already set as aborted. * @returns AbortSignal object with the AbortSignal.aborted property is set to true * and AbortSignal.reason set to the specified or default reason */ static abort(reason: any): AbortSignal; /** * Whether the request that the signal is communicating with is aborted or not */ aborted: boolean; /** * The abort reason, once the signal has aborted. * `Undefined` when the signal has not been aborted. */ reason: any; /** * Throws the signal's abort reason if the signal has been aborted. * Otherwise, it does nothing. */ throwIfAborted(): void; } /** * Creates an instance of ClassList. */ declare class ClassList extends DOMTokenList { constructor(node: any); value: string; /** * Returns the number of tokens in the list */ readonly length: any; /** * Adds the specified tokens to the token list. If the token is already present, no error is thrown. */ add(...tokens: string[]): void; /** * Removes the specified items from the token list. If the token is not present, no error is thrown. */ remove(...tokens: string[]): void; /** * Replaces an old token with a new token. If the old token doesn't exist, * no action occurs, and `false` is returned. */ replace(oldToken: any, newToken: any): void; /** * Toggles a token within the list. If `force` is not present, then the following * rules are applied: * * * if the token is present, it is removed, and `false` is returned * * if the token isn't present, it is added, and `true` is returned * * If `force` is supplied, then: * * * if `true`, the token is added * * if `false`, the token is removed * @returns if the token exists in the last after the operation */ toggle(token: string, force: boolean): boolean; /** * Return the item at the specified index, or `null` if the index is out-of-range * @returns the item at the index, or null if index is out of range */ item(index: number): string; /** * Returns whether the token is in the list or not. * @returns if `true`, the token is in the list, otherwise it isn't */ contains(token: any): boolean; /** * Returns `true` if the token is acceptable to the list; otherwise returns `false`. * If `false` is returned, passing the token would throw an error when calling * any other method. * @returns if `true`, the token is acceptable when calling other methods */ supports(token: string): boolean; } declare class CanvasGradient { /** * Adds a new color stop, defined by an `offset` and a `color value`, to a given canvas gradient. * @param offset - A number between 0 and 1, inclusive, representing the position * of the color stop. 0 represents the start of the gradient and 1 represents the end. * @param colorValue - A CSS `` value representing the color of the stop. */ addColorStop(offset: number, colorValue: string): void; } /** * Creates an instance of CanvasRenderingContext2D. */ declare class CanvasRenderingContext2D { /** * Get the thickness of lines. */ lineWidth: number; /** * Get the shape used to join two line segments where they meet. */ lineJoin: string; /** * Get the shape used to draw the end points of lines. */ lineCap: string; /** * Creates a gradient along the line connecting two given coordinates. * @param x0 - The x-axis coordinate of the start point. * @param y0 - The y-axis coordinate of the start point. * @param x1 - The x-axis coordinate of the end point. * @param y1 - The y-axis coordinate of the end point. * @returns A linear CanvasGradient object initialized with the specified line. */ createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; /** * Creates a radial gradient using the size and coordinates of two circles. * @param x0 - The x-axis coordinate of the start circle. * @param y0 - The y-axis coordinate of the start circle. * @param r0 - The radius of the start circle. Must be non-negative and finite. * @param x1 - The x-axis coordinate of the end circle. * @param y1 - The y-axis coordinate of the end circle. * @param r1 - The radius of the end circle. Must be non-negative and finite. * @returns A radial CanvasGradient object initialized with the two specified circles. */ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; /** * Get the global alpha(transparency) value. */ globalAlpha: number; /** * Get the fill style used inside shapes. */ fillStyle: string | CanvasGradient; /** * Get the color to use for the strokes (outlines) around shapes. */ strokeStyle: string; /** * Creates a new path. */ beginPath(): void; /** * Add a straight line from the current point to the start of the current sub-path. */ closePath(): void; /** * Begins a new sub-path at the point specified by the given (x, y) coordinates. * @param x - The x-axis (horizontal) coordinate of the point. * @param y - The y-axis (vertical) coordinate of the point. */ moveTo(x: number, y: number): void; /** * Adds a straight line to the current sub-path by connecting the sub-path's * last point to the specified (x, y) coordinates. * @param x - The x-axis coordinate of the line's end point. * @param y - The y-axis coordinate of the line's end point. */ lineTo(x: number, y: number): void; /** * Adds a circular arc to the current sub-path. * @param x - The horizontal coordinate of the arc's center. * @param y - The vertical coordinate of the arc's center. * @param radius - The arc's radius. Must be positive. * @param startAngle - The angle at which the arc starts in radians, * measured from the positive x-axis. * @param endAngle - The angle at which the arc ends in radians, * measured from the positive x-axis. * @param counterclockwise - An optional boolean value. If true, * draws the arc counter-clockwise between the start and end angles. * The default is false (clockwise). */ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise: boolean): void; /** * Adds a circular arc to the current sub-path, using the given control points and radius. * @param x1 - The x-axis coordinate of the first control point. * @param y1 - The y-axis coordinate of the first control point. * @param x2 - The x-axis coordinate of the second control point. * @param y2 - The y-axis coordinate of the second control point. * @param radius - The arc's radius. Must be non-negative. */ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; /** * Adds a cubic Bézier curve to the current sub-path. * @param cp1x - The x-axis coordinate of the first control point. * @param cp1y - The y-axis coordinate of the first control point. * @param cp2x - The x-axis coordinate of the second control point. * @param cp2y - The y-axis coordinate of the second control point. * @param x - The x-axis coordinate of the end point. * @param y - The y-axis coordinate of the end point. */ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; /** * Adds a quadratic Bézier curve to the current sub-path. * @param cpx - The x-axis coordinate of the control point. * @param cpy - The y-axis coordinate of the control point. * @param x - The x-axis coordinate of the end point. * @param y - The y-axis coordinate of the end point. */ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; /** * Adds a rectangle to the current path. * @param x - The x-axis coordinate of the rectangle's starting point. * @param y - The y-axis coordinate of the rectangle's starting point. * @param width - The rectangle's width. * @param height - The rectangle's height. */ rect(x: number, y: number, width: number, height: number): void; /** * Strokes (outlines) the current or given path with the current stroke style. * @param path - An optional Path2D object to stroke. */ stroke(path: Path2D): void; /** * Fills the current or given path with the current fillStyle.

* @param pathOrFillRule - An optional Path2D object to fill or * String which defines an algorithm to determine if a point is inside or * outside the filling region. */ fill(pathOrFillRule: Path2D | string): void; /** * Draws a rectangle that is filled according to the current fillStyle. * @param x - The x-axis coordinate of the rectangle's starting point. * @param y - The y-axis coordinate of the rectangle's starting point. * @param width - The rectangle's width. * @param height - The rectangle's height. */ fillRect(x: number, y: number, width: number, height: number): void; /** * Draws a rectangle that is stroked (outlined) according to the current strokeStyle * @param x - The x-axis coordinate of the rectangle's starting point. * @param y - The y-axis coordinate of the rectangle's starting point. * @param width - The rectangle's width. * @param height - The rectangle's height. */ strokeRect(x: number, y: number, width: number, height: number): void; /** * Erases the pixels in a rectangular area by setting them to transparent black. * @param x - The x-axis coordinate of the rectangle's starting point. * @param y - The y-axis coordinate of the rectangle's starting point. * @param width - The rectangle's width. * @param height - The rectangle's height. */ clearRect(x: number, y: number, width: number, height: number): void; } /** * Creates an instance of Path2D. * @param path - `Optional` Path2D Object from another Path2D Instance */ declare class Path2D { constructor(path: Path2D); /** * Adds one Path2D object to another Path2D object.

* @param path - A Path2D object to add. */ addPath(path: Path2D): void; /** * Add a straight line from the current point to the start of the current sub-path. */ closePath(): void; /** * Begins a new sub-path at the point specified by the given (x, y) coordinates. * @param x - The x-axis (horizontal) coordinate of the point. * @param y - The y-axis (vertical) coordinate of the point. */ moveTo(x: number, y: number): void; /** * Adds a straight line to the current sub-path by connecting the sub-path's * last point to the specified (x, y) coordinates. * @param x - The x-axis coordinate of the line's end point. * @param y - The y-axis coordinate of the line's end point. */ lineTo(x: number, y: number): void; /** * Adds a cubic Bézier curve to the current sub-path. * @param cp1x - The x-axis coordinate of the first control point. * @param cp1y - The y-axis coordinate of the first control point. * @param cp2x - The x-axis coordinate of the second control point. * @param cp2y - The y-axis coordinate of the second control point. * @param x - The x-axis coordinate of the end point. * @param y - The y-axis coordinate of the end point. */ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; /** * Adds a quadratic Bézier curve to the current sub-path. * @param cpx - The x-axis coordinate of the control point. * @param cpy - The y-axis coordinate of the control point. * @param x - The x-axis coordinate of the end point. * @param y - The y-axis coordinate of the end point. */ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; /** * Adds a circular arc to the current sub-path. * @param x - The horizontal coordinate of the arc's center. * @param y - The vertical coordinate of the arc's center. * @param radius - The arc's radius. Must be positive. * @param startAngle - The angle at which the arc starts in radians, * measured from the positive x-axis. * @param endAngle - The angle at which the arc ends in radians, * measured from the positive x-axis. * @param counterclockwise - An optional boolean value. If true, * draws the arc counter-clockwise between the start and end angles. * The default is false (clockwise). */ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise: boolean): void; /** * Adds a circular arc to the current sub-path, using the given control points and radius. * @param x1 - The x-axis coordinate of the first control point. * @param y1 - The y-axis coordinate of the first control point. * @param x2 - The x-axis coordinate of the second control point. * @param y2 - The y-axis coordinate of the second control point. * @param radius - The arc's radius. Must be non-negative. */ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; /** * Adds a rectangle to the current path. * @param x - The x-axis coordinate of the rectangle's starting point. * @param y - The y-axis coordinate of the rectangle's starting point. * @param width - The rectangle's width. * @param height - The rectangle's height. */ rect(x: number, y: number, width: number, height: number): void; } /** * @example * alert("This is alert message"); * @param message - A message you want to display in the alert dialog

*/ declare function alert(message: string): void; /** * @example * confirm("This is confirmation message"); * @param message - A string you want to display in the confirmation dialog. * @returns true If OK button is pressed and false when Cancel button is pressed. * * The following are additional simple alerts supported by UXP * 1. {@link ./alert.md|alert()} * 2. {@link ./prompt.md|prompt()} */ declare function confirm(message: string): boolean; /** * @example * // Below prompt function has 2 params * // "Enter your name: " - Message to display * // "Adobe" - Default value that will be present in the Prompt pop-up at launch * prompt("Enter your name: ","Adobe"); * @param message - A string of text to display to the user. * @param prompt - Default value for the field. * @returns message entered by the user in the prompt field or default value if nothing entered. * * The following are additional simple alerts supported by UXP * 1. {@link ./confirm.md|confirm()} * 2. {@link ./alert.md|alert()} */ declare function prompt(message: string, prompt: string): string; declare class CustomElementRegistry { /** * Defines a new custom element. * @param name - Name for the new custom element * @param constructor - Constructor for the new custom element * @param options - Object that controls how the element is defined * @param options.extends - The name of a built-in element to extend */ define(name: string, constructor: CustomElement, options: { extends: string; }): void; /** * Returns the constructor for the named custom element * @param name - The name of the custom element */ get(name: string): void; /** * Upgrade all potential custom elements under tree rooted at 'root'. * * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * @param root - Node instance with shadow-containing descendant elements to upgrade */ upgrade(root: any): void; /** * Returns a Promise that resolves when the named custom-element is defined. * * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * @param name - The name of the custom element */ whenDefined(name: string): void; } declare type CustomElement = any; declare class HTMLAnchorElement extends HTMLElement { /** * The `href` value for the anchor */ href: string; /** * The path portion of the anchor's `href` */ readonly pathname: string; /** * The protocol portion of the anchor's `href`. */ readonly protocol: string; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLBodyElement extends HTMLElement { /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLButtonElement extends HTMLElement { /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLCanvasElement { /** * Creates a 2D drawing context on the canvas. *

Note: Only '2d' context is supported. * @example * // 1. Provide the canvas tag in your HTML document. * * * *
* * Canvas Height * Canvas Width * Get Context *
* // 2. You can now get the width, height and context using JavaScript under * @param contextType - A string containing the context identifier defining the drawing context associated to the canvas. Supports only '2d'. * @returns A 2D rendering context (CanvasRenderingContext2D) object. */ getContext(contextType: string): CanvasRenderingContext2D; /** * Get the height of the canvas element. */ height: number; /** * Get the width of the canvas element. */ width: number; } declare class HTMLDialogElement extends HTMLElement { /** * Show the non modal dialog. * @param [options = {}] - Options for the show. * @param [options.anchorOffset] - Offset from the anchor for the initial positioning of the dialog. * @param [options.anchorOffset.top] - Top offset from the anchor for the initial positioning of the dialog. * @param [options.anchorOffset.left] - Left offset from the anchor for the initial positioning of the dialog. */ show(options?: { anchorOffset?: { top?: number; left?: number; }; }): void; readonly open: boolean; readonly isMinimized: boolean; returnValue: any; /** * Show the modal dialog. * @returns A promise that resolves when the dialog is closed (**NSC**) * after calling the close() method or clicking the "submit" button. * The promise will be resolved with returnValue as a parameter. * The promise can be rejected if the dialog was closed for other reasons * e.g. the user hit escape or closed the window, or if the application * does not allow showing the dialog. The error parameter will give more details. * error.code will be one of the values from HTMLDialogElement.rejectionReasons. */ showModal(): Promise; /** * Closes the dialog; setting the return value (optional) */ close(returnValue?: any): void; /** * When the promise returned from openDialog() is rejected, error.code can be equal to this value, * which means that the application does not allow showing dialogs (e.g. only one dialog is allowed). */ REJECTION_REASON_NOT_ALLOWED: any; /** * When the promise returned from openDialog() is rejected, error.code can be equal to this value, * which means that the node has been detached from DOM tree. */ REJECTION_REASON_DETACHED: any; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLElement extends Element { /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLHeadElement extends HTMLElement { /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLHtmlElement extends HTMLElement { /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLImageElement extends HTMLElement { /** * The source of the image */ src: string | File; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare type File = any; declare class HTMLInputElement extends HTMLElement { /** * Returns the value of the input element. */ value: any; /** * The defaultValue for the input element (if applicable to the input element's type) */ defaultValue: string; /** * Indicates if the checkbox is checked. */ checked: boolean; /** * Indicates if the element is indeterminate */ indeterminate: boolean; /** * Specifies the name of this input element. */ name: string; /** * Specifies the type of input control */ type: string; /** * The placeholder for the input element (if applicable to the input element's type) */ placeholder: string; /** * Determines if the element's content is read only. */ readOnly: boolean; /** * Minimum value allowed (used for `input type="range"`) */ min: string; /** * Maximum value allowed (used for `input type="range"`) */ max: string; /** * the size of each movement of the slder control (used for `input type="range"`) */ step: string; /** * Controls the type of native widget. */ uxpVariant: string; /** * Determines if a control is rendered in "quiet" mode */ uxpQuiet: string; /** * Returns/Sets the beginning index of the selected text. When nothing is selected, * this returns the position of the text input cursor (caret) inside of the `` element. * Apply only to elements with type text/password/search/tel/url/week/month */ selectionStart: number; /** * Returns/Sets the end index of the selected text. When there's no selection, * this returns the offset of the character immediately following the current text input cursor position. * Apply only to elements with type text/password/search/tel/url/week/month */ selectionEnd: number; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLLabelElement extends HTMLElement { readonly control: HTMLElement; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLLinkElement extends HTMLElement { /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLMenuElement extends HTMLElement { /** * Render the menu at the `x`,`y` coordinates */ popupAt(x: number, y: number): void; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLMenuItemElement extends HTMLElement { /** * Indicates if the menu item is checked. */ checked: boolean; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLOptionElement extends HTMLElement { value: string; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLProgressElement extends HTMLElement { /** * Maximum value for the progress bar */ max: number; /** * Value of the progress bar */ value: number; /** * Completion value of the progress bar */ readonly position: number; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLScriptElement extends HTMLElement { type: string; src: string; charset: string; text: string; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLSelectElement extends HTMLElement { value: string; selectedIndex: number; selectedOptions: Node[]; /** * Variant */ uxpVariant: string; /** * Determines if control renders quietly */ uxpQuiet: string; readonly options: NodeList; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLSlotElement { /** * A string used to get and set slot's name. */ name: string; /** * returns a sequence of the nodes assigned to this slot. If options object is used with flatten: "true", * If slottables is the empty list, then append each slottable child of slot, in tree order, to slottables.

* Refer [find-flattened-slotables](https://dom.spec.whatwg.org/#find-flattened-slotables) * @property options.flatten - A boolean value indicating whether to return the assigned nodes of any available child `slot` elements (true) or not (false). Defaults to false. * @param options - An object that sets options for the nodes to be returned * @returns An array of nodes */ assignedNodes(options: any): any[]; /** * returns a sequence of the elements assigned to this slot. If options object is used with flatten: "true", * If slottables is the empty list, then append each slottable child of slot, in tree order, to slottables.

* Refer [find-flattened-slotables](https://dom.spec.whatwg.org/#find-flattened-slotables) * @property options.flatten - A boolean value indicating whether to return the assigned elements of any available child `` elements (true) or not (false). Defaults to false * @param options - An object that sets options for the elements to be returned * @returns An array of elements */ assignedElements(options: any): any[]; } declare class HTMLStyleElement extends HTMLElement { /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ declare class HTMLTemplateElement extends HTMLElement { /** * Returns a template element's template content. return type is DocumentFragment object. */ readonly content: DocumentFragment; /** * Access to all the custom data attributes (data-*) set. */ dataset: any; innerText: string; /** * Base language of an element's attribute values and text content. */ lang: string; /** * The text writing directionality of the content of the current element limited to only known values. */ dir: string; /** * Indicates the browser should not render the contents of the element. Note: "until-found" is not supported. */ hidden: boolean | string; readonly nodeName: string; /** * A string representing the local part of the qualified name of the element */ readonly localName: string; /** * A string indicating the element's tag name */ readonly tagName: string; readonly nodeType: number; /** * Returns the namespace URI of the element, or null if the element is not in a namespace. */ readonly namespaceURI: string; /** * Returns the property of the `Element` interface represents the element's identifier, reflecting the id global attribute. */ id: string; tabIndex: number; className: string; readonly attributes: NamedNodeMap; readonly style: Style; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly clientHeight: number; readonly offsetParent: Element; readonly offsetLeft: number; readonly offsetTop: number; readonly offsetWidth: number; readonly offsetHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; /** * Indicates if the element will focus automatically when it is loaded */ autofocus: boolean; readonly uxpContainer: number; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Returns the open shadow root that is hosted by the element, or null if no open shadow root is present. */ readonly shadowRoot: ShadowRoot; /** * Scrolls the element to the new x and y positions. If options object is used with behavior: "smooth" then the element is smoothly scrolled. * @param xOrOptions - either the new scrollLeft position or an options object. * @param y - the optional new scrollTop position. */ scrollTo(xOrOptions: any, y: any): void; scrollIntoView(alignToTop: boolean): void; scrollIntoViewIfNeeded(): void; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] * * Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. * @param init - An object which contains the fields : mode(open/closed) , delegatesFocus ,slotAssignment */ attachShadow(init: any): ShadowRoot; focus(): void; blur(): void; disabled: boolean; /** * @param name - Name of the attribute whose value you want to get. */ getAttribute(name: string): string; /** * @param name - Name of the attribute whose value is to be set * @param value - Value to assign to the attribute */ setAttribute(name: string, value: string): void; removeAttribute(name: string): void; hasAttribute(name: string): boolean; /** * Returns a boolean value indicating whether the current element has any attributes or not. */ hasAttributes(): boolean; /** * Returns the attribute names of the element as an Array of strings */ getAttributeNames(): any[]; getAttributeNode(name: string): any; setAttributeNode(newAttr: any): void; removeAttributeNode(oldAttr: any): void; click(): void; getElementsByClassName(name: string): NodeList; getElementsByTagName(name: string): NodeList; querySelector(selector: string): Element; querySelectorAll(selector: string): NodeList; /** * Sets pointer capture for the element. This implementation does not dispatch the `gotpointercapture` event on the element. * @example * // HTML * *
SLIDE ME
* * // JS * function beginSliding(e) { * slider.setPointerCapture(e.pointerId); * slider.addEventListener("pointermove", slide); * } * * function stopSliding(e) { * slider.releasePointerCapture(e.pointerId); * slider.removeEventListener("pointermove", slide); * } * * function slide(e) { * slider.style.left = e.clientX; * } * * const slider = document.getElementById("slider"); * * slider.addEventListener("pointerdown", beginSliding); * slider.addEventListener("pointerup", stopSliding); * @param pointerId - The unique identifier of the pointer to be captured. */ setPointerCapture(pointerId: number): void; /** * Releases pointer capture for the element. This implementation does not dispatch the `lostpointercapture` event on the element. * @param pointerId - The unique identifier of the pointer to be released. */ releasePointerCapture(pointerId: number): void; /** * Checks if the element has pointer capture for the specified pointer. * @param pointerId - The unique identifier of the pointer to check. * @returns True if the element has pointer capture for the specified pointer, false otherwise. */ hasPointerCapture(pointerId: number): boolean; getBoundingClientRect(): any; closest(selectorString: string): Element; matches(selectorString: string): boolean; innerHTML: any; outerHTML: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ slot: string; /** * [ This feature is behind a feature flag. You must turn on `enableSWCSupport` in the featureFlags section of plugin manifest to use the same ] */ readonly assignedSlot: HTMLSlotElement; insertAdjacentHTML(position: any, value: string): void; insertAdjacentElement(position: any, node: any): Node; insertAdjacentText(position: any, text: any): void; readonly contentEditable: any; readonly isConnected: boolean; readonly parentNode: Node; readonly parentElement: Element; readonly firstChild: Node; readonly lastChild: Node; readonly previousSibling: Node; readonly nextSibling: Node; readonly firstElementChild: Node; readonly lastElementChild: Node; readonly previousElementSibling: Node; readonly nextElementSibling: Node; textContent: string; hasChildNodes(): boolean; readonly childNodes: NodeList; readonly children: HTMLCollection; readonly ownerDocument: any; cloneNode(deep: boolean): Node; appendChild(child: Node): Node; insertBefore(child: Node, before: Node): Node; replaceChild(newChild: Node, oldChild: Node): Node; removeChild(child: Node): Node; remove(): void; before(...nodes: Node[][]): void; after(...nodes: Node[][]): void; replaceWith(...nodes: Node[][]): void; contains(node: Node): void; /** * @returns root node */ getRootNode(options: any): Node; addEventListener(eventName: any, callback: any, capture?: boolean): void; removeEventListener(eventName: any, callback: any, capture?: boolean): void; dispatchEvent(event: any): void; } declare class HTMLTextAreaElement extends HTMLElement { value: string; /** * Override implementation in base class Element */ innerHTML: string; /** * The defaultValue for the textarea element */ defaultValue: string; placeholder: string; readOnly: boolean; /** * Returns/Sets the beginning index of the selected text. When nothing is selected, * this returns the position of the text input cursor (caret) inside of the `