Options
All
  • Public
  • Public/Protected
  • All
Menu

Package dom

@typed/dom

@typed/dom is a small packages which makes it easy to avoid the usage of DOM globals and provides basic DOM functionality, using basicHTML, to Node environments.

basicHTML is a peer dependency only required for node support.

Index

Type aliases

CreateServerDomEnvOptions

CreateServerDomEnvOptions: { customElements?: CustomElementRegistry; innerHeight?: undefined | number; innerWidth?: undefined | number; localStorage?: Map<string, string>; mediaType?: undefined | string; serverUrl?: undefined | string; sessionStorage?: Map<string, string>; setGlobals?: undefined | false | true; window?: any }

Type declaration

  • Optional customElements?: CustomElementRegistry
  • Optional innerHeight?: undefined | number
  • Optional innerWidth?: undefined | number
  • Optional localStorage?: Map<string, string>
  • Optional mediaType?: undefined | string
  • Optional serverUrl?: undefined | string
  • Optional sessionStorage?: Map<string, string>
  • Optional setGlobals?: undefined | false | true
  • Optional window?: any

INodeFilter

INodeFilter: NodeFilter

Functions

addEventListener

  • addEventListener<A, B>(eventType: A, node: B, listener: (event: WindowEventHandlersEventMap[A] & { currentTarget: B }) => void, options?: AddEventListenerOptions): Disposable
  • addEventListener<A, B>(eventType: A, node: B, listener: (event: SVGElementEventMap[A] & { currentTarget: B }) => void, options?: AddEventListenerOptions): Disposable
  • addEventListener<A, B>(eventType: A, node: B, listener: (event: HTMLElementEventMap[A] & { currentTarget: B }) => void, options?: AddEventListenerOptions): Disposable
  • addEventListener<A, B>(eventType: A, node: B, listener: (event: ElementEventMap[A] & { currentTarget: B }) => void, options?: AddEventListenerOptions): Disposable
  • addEventListener<A>(eventType: string, node: A, listener: (event: Event & { currentTarget: A }) => void, options?: AddEventListenerOptions): Disposable
  • Type parameters

    • A: keyof WindowEventHandlersEventMap

    • B: Window

    Parameters

    • eventType: A
    • node: B
    • listener: (event: WindowEventHandlersEventMap[A] & { currentTarget: B }) => void
        • (event: WindowEventHandlersEventMap[A] & { currentTarget: B }): void
        • Parameters

          • event: WindowEventHandlersEventMap[A] & { currentTarget: B }

          Returns void

    • Optional options: AddEventListenerOptions

    Returns Disposable

  • Type parameters

    • A: keyof SVGElementEventMap

    • B: SVGElement

    Parameters

    • eventType: A
    • node: B
    • listener: (event: SVGElementEventMap[A] & { currentTarget: B }) => void
        • (event: SVGElementEventMap[A] & { currentTarget: B }): void
        • Parameters

          • event: SVGElementEventMap[A] & { currentTarget: B }

          Returns void

    • Optional options: AddEventListenerOptions

    Returns Disposable

  • Type parameters

    • A: keyof HTMLElementEventMap

    • B: HTMLElement

    Parameters

    • eventType: A
    • node: B
    • listener: (event: HTMLElementEventMap[A] & { currentTarget: B }) => void
        • (event: HTMLElementEventMap[A] & { currentTarget: B }): void
        • Parameters

          • event: HTMLElementEventMap[A] & { currentTarget: B }

          Returns void

    • Optional options: AddEventListenerOptions

    Returns Disposable

  • Type parameters

    • A: keyof ElementEventMap

    • B: Element

    Parameters

    • eventType: A
    • node: B
    • listener: (event: ElementEventMap[A] & { currentTarget: B }) => void
        • (event: ElementEventMap[A] & { currentTarget: B }): void
        • Parameters

          • event: ElementEventMap[A] & { currentTarget: B }

          Returns void

    • Optional options: AddEventListenerOptions

    Returns Disposable

  • Type parameters

    • A: EventTarget

    Parameters

    • eventType: string
    • node: A
    • listener: (event: Event & { currentTarget: A }) => void
        • (event: Event & { currentTarget: A }): void
        • Parameters

          • event: Event & { currentTarget: A }

          Returns void

    • Optional options: AddEventListenerOptions

    Returns Disposable

Const checkCanUseCustomElements

  • checkCanUseCustomElements(): boolean

Const checkCanUseDocument

  • checkCanUseDocument(): boolean

Const checkCanUseHistory

  • checkCanUseHistory(): boolean

Const checkCanUseLocalStorage

  • checkCanUseLocalStorage(): boolean

Const checkCanUseLocation

  • checkCanUseLocation(): boolean

Const checkCanUseMatchMedia

  • checkCanUseMatchMedia(): boolean

Const checkCanUseNavigator

  • checkCanUseNavigator(): boolean

Const checkCanUseNotification

  • checkCanUseNotification(): boolean

Const checkCanUseServiceWorker

  • checkCanUseServiceWorker(): boolean

Const checkCanUseSessionStorage

  • checkCanUseSessionStorage(): boolean

Const checkCanUseWindow

  • checkCanUseWindow(): boolean

Const checkCanUseXhr

  • checkCanUseXhr(): boolean

createDomEnv

  • createDomEnv<A>(): DomEnv<A>

createMatchMedia

  • createMatchMedia(window: Window, mediaType?: string): (Anonymous function)

createServerDomEnv

querySelector

  • querySelector<A, B>(cssSelector: string, node: A): Maybe<B>

querySelectorAll

  • querySelectorAll<A, B>(cssSelector: string, node: A): keyof B[]

Generated using TypeDoc