Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Printing

Any object is "printable" if it implements the IPrintable interface.

To do this it, it must have a method called Printing.symbol which returns either a function to print the object or null if it cannot be printed.

One way of printing is to use the printWidget function, which creates a hidden iframe and copies the DOM nodes from your widget to that iframe and printing just that iframe.

Another way to print is to use the printURL function, which takes a URL and prints that page.

Index

Type aliases

OptionalAsyncThunk

OptionalAsyncThunk: (() => Promise<void>) | null

Function that takes no arguments and when invoked prints out some object or null if printing is not defined.

Variables

Const symbol

symbol: unique symbol

Symbol to use for a method that returns a function to print an object.

Functions

getPrintFunction

  • Returns the print function for an object, or null if it does not provide a handler.

    Parameters

    • val: unknown

    Returns OptionalAsyncThunk

isPrintable

  • Returns whether an object implements a print method.

    Parameters

    • a: unknown

    Returns a is IPrintable

printURL

  • printURL(url: string): Promise<void>
  • Prints a URL by loading it into an iframe.

    Parameters

    • url: string

      URL to load into an iframe.

    Returns Promise<void>

printWidget

  • printWidget(widget: Widget): Promise<void>
  • Prints a widget by copying it's DOM node to a hidden iframe and printing that iframe.

    Parameters

    • widget: Widget

    Returns Promise<void>

Generated using TypeDoc