import { LibSANE, SANEOptionDescriptor, SANEStatus } from "."; export interface ScanOption { index: number; descriptor: SANEOptionDescriptor; value: T; } export interface IScanOptions extends Iterable { /** * List of all SANE options. */ readonly options: ReadonlyArray; /** * Well-known SANE option index zero (total number of options). * * @see {@link https://sane-project.gitlab.io/standard/1.06/api.html#well-known-options} */ readonly zero: ScanOption; /** * Well-known SANE option `resolution`. * * @see {@link https://sane-project.gitlab.io/standard/1.06/api.html#well-known-options} */ readonly resolution: ScanOption | null; /** * Well-known SANE option `preview`. * * @see {@link https://sane-project.gitlab.io/standard/1.06/api.html#well-known-options} */ readonly preview: ScanOption | null; /** * Well-known SANE option `tl-x`. * * @see {@link https://sane-project.gitlab.io/standard/1.06/api.html#well-known-options} */ readonly tlX: ScanOption | null; /** * Well-known SANE option `tl-y`. * * @see {@link https://sane-project.gitlab.io/standard/1.06/api.html#well-known-options} */ readonly tlY: ScanOption | null; /** * Well-known SANE option `br-x`. * * @see {@link https://sane-project.gitlab.io/standard/1.06/api.html#well-known-options} */ readonly brX: ScanOption | null; /** * Well-known SANE option `br-y`. * * @see {@link https://sane-project.gitlab.io/standard/1.06/api.html#well-known-options} */ readonly brY: ScanOption | null; } /** * @private */ export declare abstract class ScanOptionsBase implements IScanOptions { protected _lib: LibSANE; readonly options: ReadonlyArray; readonly zero: ScanOption; readonly resolution: ScanOption | null; readonly preview: ScanOption | null; readonly tlX: ScanOption | null; readonly tlY: ScanOption | null; readonly brX: ScanOption | null; readonly brY: ScanOption | null; [Symbol.iterator](): IterableIterator; protected static _getOpts(lib: LibSANE): Promise[]>; protected constructor(lib: LibSANE, opts: Array); protected _setOpts(this: { -readonly [K in keyof ScanOptionsBase]: ScanOptionsBase[K]; }, opts: Array): void; protected _setValue(index: number, value: any): Promise<{ status: SANEStatus.UNSUPPORTED | SANEStatus.CANCELLED | SANEStatus.DEVICE_BUSY | SANEStatus.INVAL | SANEStatus.EOF | SANEStatus.JAMMED | SANEStatus.NO_DOCS | SANEStatus.COVER_OPEN | SANEStatus.IO_ERROR | SANEStatus.NO_MEM | SANEStatus.ACCESS_DENIED; info: null; opts: null; } | { status: SANEStatus.GOOD; info: import(".").SANEInfo; opts: ScanOption[]; }>; /** * Get class instance (with all scanning options). */ static get: (lib: LibSANE) => Promise; /** * Set option value. Use `null` as `value` for automatic. * * @see {@link https://sane-project.gitlab.io/standard/1.06/api.html#sane-control-option} */ abstract setValue(index: number, value: any): any; } /** * Helper class for getting/setting scan options. * * Any changes (i.e. calls to {@link ScanOptionsMutable.setValue}) affect the * internal state. */ export declare class ScanOptionsMutable extends ScanOptionsBase { static get(lib: LibSANE): Promise; setValue(index: number, value: any): Promise<{ status: SANEStatus.GOOD; info: import(".").SANEInfo; } | { status: SANEStatus.UNSUPPORTED | SANEStatus.CANCELLED | SANEStatus.DEVICE_BUSY | SANEStatus.INVAL | SANEStatus.EOF | SANEStatus.JAMMED | SANEStatus.NO_DOCS | SANEStatus.COVER_OPEN | SANEStatus.IO_ERROR | SANEStatus.NO_MEM | SANEStatus.ACCESS_DENIED; info: null; }>; } /** * Helper class for getting/setting scan options. * * Any changes (i.e. calls to {@link ScanOptions.setValue}) return a * new class instance. */ export declare class ScanOptions extends ScanOptionsBase { static get(lib: LibSANE): Promise; setValue(index: number, value: any): Promise<{ status: SANEStatus.GOOD; info: import(".").SANEInfo; updated: ScanOptions; } | { status: SANEStatus.UNSUPPORTED | SANEStatus.CANCELLED | SANEStatus.DEVICE_BUSY | SANEStatus.INVAL | SANEStatus.EOF | SANEStatus.JAMMED | SANEStatus.NO_DOCS | SANEStatus.COVER_OPEN | SANEStatus.IO_ERROR | SANEStatus.NO_MEM | SANEStatus.ACCESS_DENIED; info: null; updated: null; }>; }