Options
All
  • Public
  • Public/Protected
  • All
Menu

APIs for resolving SVG icons and data URIs for different File Types

Hierarchy

  • Files

Index

Methods

  • canPreview(path: string): boolean
  • Return whether path is a URI to a previewable image

    Parameters

    • path: string

    Returns boolean

  • encodeSvg(s: string): string
  • Encode SVG for embedding in Data URI

    Parameters

    • s: string

    Returns string

  • extSrc(ext: string): string
  • Get Icon src for .ext

    Parameters

    • ext: string

    Returns string

  • extSvg(ext: string): string
  • Get Icon SVG for .ext

    Parameters

    • ext: string

    Returns string

  • fileImageUri(file: File | MediaSource): string
  • Return Image URI of INPUT file attachments

    Parameters

    • file: File | MediaSource

    Returns string

  • filePathUri(path: string): string
  • Get the Icon src for a file path or URI, previewable resources will return self, otherwise returns SVG URI of .ext

    Parameters

    • path: string

    Returns string

  • flush(): void
  • Clear all remaining Image URIs of INPUT file attachments

    Returns void

  • formatBytes(bytes: number, d?: number): string
  • Format bytes into human-readable file size

    Parameters

    • bytes: number
    • Optional d: number

    Returns string

  • getExt(path: string): string
  • Return file extension (without '.; prefix) of path or URI

    Parameters

    • path: string

    Returns string

  • getFileName(path: string): string
  • Return file name part of URI or file path

    Parameters

    • path: string

    Returns string

  • svgToDataUri(svg: string): string
  • Convert SVG to Data URI

    Parameters

    • svg: string

    Returns string

Generated using TypeDoc