Options
All
  • Public
  • Public/Protected
  • All
Menu

Import system makes support for files which are dragged onto board, imporded or pasted It auto-installs / uninstalls file support modules.

collboard-system

Hierarchy

  • AbstractSystem
    • ImportSystem

Index

Constructors

  • new ImportSystem(systems: ISystemsExtended, proxyUrl: URL): ImportSystem
  • Parameters

    • systems: ISystemsExtended
    • proxyUrl: URL

    Returns ImportSystem

Properties

fileSupporters: any
proxyUrl: any
ready: Promise<void>

Promise which is resolved when the system is initialized and ready to use.

systems: ISystemsExtended

Accessors

  • get isDestroyed(): boolean
  • Is this object destroyed?

    Returns boolean

  • get isReady(): boolean
  • Checks if the system is initialized and ready to use.

    Returns boolean

Methods

  • addSubdestroyable(...subdestroyable: ITeardownLogic[]): ImportSystem
  • Binds new registration with itself. This registration/destroyable will be destroyed with this.

    Parameters

    • Rest ...subdestroyable: ITeardownLogic[]

    Returns ImportSystem

  • checkIsReady(): void
  • Checks if the system is initialized and ready to use. If not, throws an error. If it is, do nothing.

    Returns void

  • checkWhetherNotDestroyed(errorMessage?: string, runBeforeError?: () => void): void
  • Checks, whether the object is not destroyed

    Parameters

    • Optional errorMessage: string

      Message that will replace default one before error

    • Optional runBeforeError: () => void

      Callback runed before error is thrown; typically this can be some logging

        • (): void
        • Returns void

    Returns void

  • destroy(): Promise<void>
  • Returns Promise<void>

  • importFile(options: IImportOptions & { file: File | Blob }): Promise<null | IDestroyable | IOngoingMaterialOperation>
  • Imports one file into the board.

    Parameters

    • options: IImportOptions & { file: File | Blob }

    Returns Promise<null | IDestroyable | IOngoingMaterialOperation>

    objects which can be used to undo the importment (typically ongoing operation) OR null if import fails

  • importOneOfFiles(__namedParameters: IImportOptions & { files: (File | Blob)[] }): Promise<null | IDestroyable | IOngoingMaterialOperation>
  • Imports ONE of given files into the board. It will be picked according to priority of file support modules.

    1. At first it will pick file supporter module with highest priority and gives it all provided files.
    2. At second (if the first module refuse to import all of them (by calling next)) it will pick next module 3) And so on. Typically this is usefull when you have the same content in multiple formats like pasting from the clipboard.

    Parameters

    • __namedParameters: IImportOptions & { files: (File | Blob)[] }

    Returns Promise<null | IDestroyable | IOngoingMaterialOperation>

    objects which can be used to undo the importment (typically ongoing operation) OR null if import fails

  • importUrl(options: IImportOptions & { src: string | URL }): Promise<null | IDestroyable | IOngoingMaterialOperation>
  • Imports content from URL

    Parameters

    • options: IImportOptions & { src: string | URL }

    Returns Promise<null | IDestroyable | IOngoingMaterialOperation>

    objects which can be used to undo the importment (typically ongoing operation) OR null if import fails

    Note: If you want to fetch and import content of URL and materialize it, use the importFile with the util fetchAsFile

  • init(): Promise<void>
  • Returns Promise<void>

  • registerFileSupport(fileSupporter: IFileImportSupporter): Registration
  • Parameters

    • fileSupporter: IFileImportSupporter

    Returns Registration

  • isDestroyable(obj: any): obj is IDestroyable
  • Chcek whether the given object is destroyable

    Parameters

    • obj: any

    Returns obj is IDestroyable