npm.io
1.0.4 • Published 2 years ago

@types/ipp-printer

Licence
MIT
Version
1.0.4
Deps
1
Size
6 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/ipp-printer

Summary

This package contains type definitions for ipp-printer (https://github.com/watson/ipp-printer).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ipp-printer.

index.d.ts

/// <reference types="node" />

import * as http from "http";
import { Readable } from "node:stream";

declare class Printer {
    constructor(opts?: Printer.Options | string);
    fallback: boolean;
    jobs: Printer.Job[];
    name: string;
    port: number;
    server: http.Server;
    started: Date;
    state: number;
    uri: string;

    on(event: "job", handler: (job: Printer.Job) => void): Printer;
    on(event: "operation", handler: (operation: Printer.Operation) => void): Printer;
}

declare namespace Printer {
    interface Attribute {
        name: string;
        tag: number;
        value: string | number | Date;
    }

    interface AttributeGroup {
        attributes: Attribute[];
        tag: number;
    }

    class Job extends Readable {
        compression: string;
        createdAt: Date;
        id: number;
        name: string;
        state: number;
        uri: string;
        userName: string;

        attributes(filter?: readonly string[]): Attribute[];
        pause(): this;
        resume(): this;
        setEncoding(encoding: BufferEncoding): this;
        unpipe(destination?: NodeJS.WritableStream): this;
        wrap(oldStream: NodeJS.ReadableStream): this;
    }

    interface Operation {
        version: { major: number; minor: number };
        operationId: number;
        requestId: number;
        groups: AttributeGroup[];
    }

    interface Options {
        fallback?: boolean;
        name?: string;
        port?: number;
        server?: http.Server;
        uri?: string;
        zeroconf?: boolean;
    }
}

export = Printer;

Additional Details

  • Last updated: Mon, 20 Nov 2023 2324 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Matt Smith.