sane-wasm - v0.6.1
    Preparing search index...

    Interface LibSANE

    The core SANE Emscripten module.

    interface LibSANE {
        sane_cancel: () => Promise<{ status: SANEStatus }>;
        sane_close: () => Promise<{ status: SANEStatus }>;
        SANE_CONSTRAINT: SANEEnum<typeof SANEConstraintType, SANEConstraintType>;
        sane_control_option_get_value: (
            option: number,
        ) => Promise<
            | { status: GOOD; value: any }
            | {
                status:
                    | UNSUPPORTED
                    | CANCELLED
                    | DEVICE_BUSY
                    | INVAL
                    | EOF
                    | JAMMED
                    | NO_DOCS
                    | COVER_OPEN
                    | IO_ERROR
                    | NO_MEM
                    | ACCESS_DENIED;
                value: null;
            },
        >;
        sane_control_option_set_auto: (
            option: number,
        ) => Promise<
            | { info: SANEInfo; status: GOOD }
            | {
                info: null;
                status:
                    | UNSUPPORTED
                    | CANCELLED
                    | DEVICE_BUSY
                    | INVAL
                    | EOF
                    | JAMMED
                    | NO_DOCS
                    | COVER_OPEN
                    | IO_ERROR
                    | NO_MEM
                    | ACCESS_DENIED;
            },
        >;
        sane_control_option_set_value: (
            option: number,
            value: any,
        ) => Promise<
            | { info: SANEInfo; status: GOOD }
            | {
                info: null;
                status:
                    | UNSUPPORTED
                    | CANCELLED
                    | DEVICE_BUSY
                    | INVAL
                    | EOF
                    | JAMMED
                    | NO_DOCS
                    | COVER_OPEN
                    | IO_ERROR
                    | NO_MEM
                    | ACCESS_DENIED;
            },
        >;
        SANE_CURRENT_MAJOR: number;
        SANE_CURRENT_MINOR: number;
        sane_exit: () => Promise<{ status: SANEStatus }>;
        SANE_FRAME: SANEEnum<typeof SANEFrame, SANEFrame>;
        sane_get_devices: () => Promise<
            | { devices: SANEDevice[]; status: GOOD }
            | {
                devices: null;
                status:
                    | UNSUPPORTED
                    | CANCELLED
                    | DEVICE_BUSY
                    | INVAL
                    | EOF
                    | JAMMED
                    | NO_DOCS
                    | COVER_OPEN
                    | IO_ERROR
                    | NO_MEM
                    | ACCESS_DENIED;
            },
        >;
        sane_get_option_descriptor: (
            option: number,
        ) => { option_descriptor: SANEOptionDescriptor | null; status: SANEStatus };
        sane_get_parameters: () => Promise<
            | { parameters: SANEParameters; status: GOOD }
            | {
                parameters: null;
                status:
                    | UNSUPPORTED
                    | CANCELLED
                    | DEVICE_BUSY
                    | INVAL
                    | EOF
                    | JAMMED
                    | NO_DOCS
                    | COVER_OPEN
                    | IO_ERROR
                    | NO_MEM
                    | ACCESS_DENIED;
            },
        >;
        sane_get_state: () => SANEState;
        sane_init: () => | { status: GOOD; version_code: number }
        | {
            status:
                | UNSUPPORTED
                | CANCELLED
                | DEVICE_BUSY
                | INVAL
                | EOF
                | JAMMED
                | NO_DOCS
                | COVER_OPEN
                | IO_ERROR
                | NO_MEM
                | ACCESS_DENIED;
            version_code: null;
        };
        sane_open: (devicename: string) => Promise<{ status: SANEStatus }>;
        sane_read: () => Promise<
            | { data: Uint8Array; status: GOOD }
            | {
                data: null;
                status:
                    | UNSUPPORTED
                    | CANCELLED
                    | DEVICE_BUSY
                    | INVAL
                    | EOF
                    | JAMMED
                    | NO_DOCS
                    | COVER_OPEN
                    | IO_ERROR
                    | NO_MEM
                    | ACCESS_DENIED;
            },
        >;
        sane_start: () => Promise<{ status: SANEStatus }>;
        SANE_STATUS: SANEEnum<typeof SANEStatus, SANEStatus>;
        sane_strstatus: (status: SANEStatus) => string;
        SANE_TYPE: SANEEnum<typeof SANEValueType, SANEValueType>;
        SANE_UNIT: SANEEnum<typeof SANEUnit, SANEUnit>;
        SANE_WASM_BACKENDS: string;
        SANE_WASM_COMMIT: string;
        SANE_WASM_VERSION: string;
    }
    Index
    sane_cancel: () => Promise<{ status: SANEStatus }>

    Equivalent to the SANE API C function sane_cancel.

    sane_close: () => Promise<{ status: SANEStatus }>

    Equivalent to the SANE API C function sane_close.

    SANE_CONSTRAINT: SANEEnum<typeof SANEConstraintType, SANEConstraintType>

    Consider using the SANEConstraintType enum directly.

    This object is not going away anytime soon (or ever probably).

    But you should consider using the equivalent enum because it doesn't require having a reference to the library module. All enums are exported with the package.

    sane_control_option_get_value: (
        option: number,
    ) => Promise<
        | { status: GOOD; value: any }
        | {
            status:
                | UNSUPPORTED
                | CANCELLED
                | DEVICE_BUSY
                | INVAL
                | EOF
                | JAMMED
                | NO_DOCS
                | COVER_OPEN
                | IO_ERROR
                | NO_MEM
                | ACCESS_DENIED;
            value: null;
        },
    >

    Equivalent to the SANE API C function sane_control_option.

    With a = SANE_ACTION_GET_VALUE (get option value).

    sane_control_option_set_auto: (
        option: number,
    ) => Promise<
        | { info: SANEInfo; status: GOOD }
        | {
            info: null;
            status:
                | UNSUPPORTED
                | CANCELLED
                | DEVICE_BUSY
                | INVAL
                | EOF
                | JAMMED
                | NO_DOCS
                | COVER_OPEN
                | IO_ERROR
                | NO_MEM
                | ACCESS_DENIED;
        },
    >

    Equivalent to the SANE API C function sane_control_option.

    With a = SANE_ACTION_SET_AUTO (set option automatic).

    sane_control_option_set_value: (
        option: number,
        value: any,
    ) => Promise<
        | { info: SANEInfo; status: GOOD }
        | {
            info: null;
            status:
                | UNSUPPORTED
                | CANCELLED
                | DEVICE_BUSY
                | INVAL
                | EOF
                | JAMMED
                | NO_DOCS
                | COVER_OPEN
                | IO_ERROR
                | NO_MEM
                | ACCESS_DENIED;
        },
    >

    Equivalent to the SANE API C function sane_control_option.

    With a = SANE_ACTION_SET_VALUE (set option value).

    SANE_CURRENT_MAJOR: number

    SANE API version code (major).

    SANE_CURRENT_MINOR: number

    SANE API version code (minor).

    sane_exit: () => Promise<{ status: SANEStatus }>

    Equivalent to the SANE API C function sane_exit.

    SANE_FRAME: SANEEnum<typeof SANEFrame, SANEFrame>

    Consider using the SANEFrame enum directly.

    This object is not going away anytime soon (or ever probably).

    But you should consider using the equivalent enum because it doesn't require having a reference to the library module. All enums are exported with the package.

    sane_get_devices: () => Promise<
        | { devices: SANEDevice[]; status: GOOD }
        | {
            devices: null;
            status:
                | UNSUPPORTED
                | CANCELLED
                | DEVICE_BUSY
                | INVAL
                | EOF
                | JAMMED
                | NO_DOCS
                | COVER_OPEN
                | IO_ERROR
                | NO_MEM
                | ACCESS_DENIED;
        },
    >

    Equivalent to the SANE API C function sane_get_devices.

    sane_get_option_descriptor: (
        option: number,
    ) => { option_descriptor: SANEOptionDescriptor | null; status: SANEStatus }

    Equivalent to the SANE API C function sane_get_option_descriptor.

    The result option_descriptor can be null even with status = SANEStatus.GOOD, it signals invalid option index.

    sane_get_parameters: () => Promise<
        | { parameters: SANEParameters; status: GOOD }
        | {
            parameters: null;
            status:
                | UNSUPPORTED
                | CANCELLED
                | DEVICE_BUSY
                | INVAL
                | EOF
                | JAMMED
                | NO_DOCS
                | COVER_OPEN
                | IO_ERROR
                | NO_MEM
                | ACCESS_DENIED;
        },
    >

    Equivalent to the SANE API C function sane_get_parameters.

    sane_get_state: () => SANEState

    Get the current state of the library.

    This is provided by sane-wasm, it's not part of SANE API.

    sane_init: () => | { status: GOOD; version_code: number }
    | {
        status:
            | UNSUPPORTED
            | CANCELLED
            | DEVICE_BUSY
            | INVAL
            | EOF
            | JAMMED
            | NO_DOCS
            | COVER_OPEN
            | IO_ERROR
            | NO_MEM
            | ACCESS_DENIED;
        version_code: null;
    }

    Equivalent to the SANE API C function sane_init.

    sane_open: (devicename: string) => Promise<{ status: SANEStatus }>

    Equivalent to the SANE API C function sane_open.

    sane_read: () => Promise<
        | { data: Uint8Array; status: GOOD }
        | {
            data: null;
            status:
                | UNSUPPORTED
                | CANCELLED
                | DEVICE_BUSY
                | INVAL
                | EOF
                | JAMMED
                | NO_DOCS
                | COVER_OPEN
                | IO_ERROR
                | NO_MEM
                | ACCESS_DENIED;
        },
    >

    Equivalent to the SANE API C function sane_read.

    sane_start: () => Promise<{ status: SANEStatus }>

    Equivalent to the SANE API C function sane_start.

    SANE_STATUS: SANEEnum<typeof SANEStatus, SANEStatus>

    Consider using the SANEStatus enum directly.

    This object is not going away anytime soon (or ever probably).

    But you should consider using the equivalent enum because it doesn't require having a reference to the library module. All enums are exported with the package.

    sane_strstatus: (status: SANEStatus) => string

    Equivalent to the SANE API C function sane_strstatus.

    SANE_TYPE: SANEEnum<typeof SANEValueType, SANEValueType>

    Consider using the SANEValueType enum directly.

    This object is not going away anytime soon (or ever probably).

    But you should consider using the equivalent enum because it doesn't require having a reference to the library module. All enums are exported with the package.

    SANE_UNIT: SANEEnum<typeof SANEUnit, SANEUnit>

    Consider using the SANEUnit enum directly.

    This object is not going away anytime soon (or ever probably).

    But you should consider using the equivalent enum because it doesn't require having a reference to the library module. All enums are exported with the package.

    SANE_WASM_BACKENDS: string

    List of SANE API backends built into sane-wasm.

    SANE_WASM_COMMIT: string

    Commit hash of sane-wasm.

    SANE_WASM_VERSION: string

    Version code of sane-wasm.