@vertigis/viewer-spec
Version:
VertiGIS Viewer Specification
157 lines (156 loc) • 3.92 kB
TypeScript
/// <reference types="dotnet-bcl" />
import type PortalItem from "@arcgis/core/portal/PortalItem.js";
import type Exception from "dotnet-bcl/System/Exception";
import type { Command } from "../Command.js";
import { CommandRegistry } from "../CommandRegistry.js";
import type { Event } from "../Event.js";
import { EventRegistry } from "../EventRegistry.js";
import type { Operation } from "../Operation.js";
import { OperationRegistry } from "../OperationRegistry.js";
/**
* A type of attachment.
*/
export type AttachmentType = "File" | "Media";
/**
* The binary contents of the attachment.
*/
export interface EnhancedFileData {
}
/**
* Arguments to pick a file.
*/
export interface PickFileArgs {
/**
* Type of the attachment used to pick a file. Mobile only.
*
* @mobileOnly
*/
attachmentType: AttachmentType;
/**
* Allowed types of file used to pick a file. Mobile only.
*
* @mobileOnly
*/
allowedFileTypes: string[];
}
/**
* Arguments to open a file.
*/
export interface OpenFileArgs {
/**
* Name of the file to open. Mobile only.
*
* @mobileOnly
*/
fileName: string;
}
/**
* Information about a file download.
*/
export interface FileDownloadInfo {
/**
* The portal item from which this file is being downloaded.
*/
portalItem: PortalItem;
/**
* The full path of the file being downloaded.
*/
filePath: string;
/**
* A value indicating whether this download is updating a file. If true, it
* means that the file already existed on disk and a new version is being
* downloaded.
*/
isUpdating: boolean;
}
/**
* Arguments for the 'file.download-started' event.
*/
export interface FileDownloadStartedEventArgs {
/**
* The collection of FileDownloadInfos describing the file downloads that
* have started.
*/
fileDownloadInfos: FileDownloadInfo[];
}
/**
* The status of a portal item download job.
*/
export type PortalItemDownloadJobStatus =
/**
* Job is not started; either newly created or previously cancelled.
*/
"NotStarted"
/**
* Download is in progress.
*/
| "InProgress"
/**
* Download has been interrupted.
*/
| "Interrupted"
/**
* Download has completed successfully.
*/
| "Completed"
/**
* The job has failed.
*/
| "Failed";
/**
* Arguments for the "file.download-ended" event.
*/
export interface FileDownloadEndedEventArgs extends FileDownloadInfo {
/**
* The status of the file download.
*/
status: PortalItemDownloadJobStatus;
/**
* The exception that occurred during the file download.
*/
exception?: Exception;
/**
* The duration of the download, in milliseconds.
*/
downloadDuration: number;
}
export declare class FileOperations extends OperationRegistry {
protected readonly _prefix = "file";
/**
* Prompt the user to select a file from the file system, and return the
* resulting data. Mobile only.
*
* @mobileOnly
*/
get pickFile(): Operation<PickFileArgs, EnhancedFileData>;
}
export declare class FileCommands extends CommandRegistry {
protected readonly _prefix = "file";
/**
* Opens a file in an app assigned to the file type. Mobile only.
*
* @mobileOnly
*/
get openFile(): Command<OpenFileArgs | string>;
}
export declare class FileEvents extends EventRegistry {
protected readonly _prefix = "file";
/**
* Raised when a file is opened. Mobile only.
*
* @mobileOnly
*/
get opened(): Event<OpenFileArgs>;
/**
* Raised when a file download starts or resumes. Mobile only.
*
* @mobileOnly
*/
get downloadStarted(): Event<FileDownloadStartedEventArgs>;
/**
* Raised when a file download ends. Mobile only.
*
* @mobileOnly
*/
get downloadEnded(): Event<FileDownloadEndedEventArgs>;
}