Options
All
  • Public
  • Public/Protected
  • All
Menu

Converts Blob, File or MediaSource to url using URL.createObjectURL

collboard-modules-sdk

Hierarchy

  • Registration
    • ObjectUrl

Implements

  • IDestroyable

Index

Constructors

  • Returns ObjectUrl

Properties

src: string

Accessors

  • get href(): string
  • Gets object url as string

    alias

    src

    Returns string

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

    Returns boolean

  • get url(): URL
  • Gets object url as URL object

    Returns URL

Methods

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

    Parameters

    • Rest ...subdestroyable: ITeardownLogic[]

    Returns ObjectUrl

  • 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>

  • create(creator: (utils: { isDestroyed: any }) => Promisable<void | ITeardownLogic>): Registration
  • TODO: Use in all places where manually setting up pair things

    Parameters

    • creator: (utils: { isDestroyed: any }) => Promisable<void | ITeardownLogic>
        • (utils: { isDestroyed: any }): Promisable<void | ITeardownLogic>
        • Parameters

          • utils: { isDestroyed: any }
            • isDestroyed:function
              • isDestroyed(): boolean
              • Returns boolean

          Returns Promisable<void | ITeardownLogic>

    Returns Registration

  • createEventListener<TEvent>(__namedParameters: { element: HTMLElement | Document; options?: boolean | AddEventListenerOptions; type: string; listener: any }): Registration
  • TODO: Use in all places where manually setting up the listeners

    Type parameters

    • TEvent: Event

    Parameters

    • __namedParameters: { element: HTMLElement | Document; options?: boolean | AddEventListenerOptions; type: string; listener: any }
      • element: HTMLElement | Document
      • Optional options?: boolean | AddEventListenerOptions
      • type: string
      • listener:function
        • listener(event: TEvent): any
        • Parameters

          • event: TEvent

          Returns any

    Returns Registration

  • fromBlob(source: File | Blob | MediaSource): ObjectUrl
  • Creates ObjectUrl DO NOT forget to call destroy() when you are done with it

    Parameters

    • source: File | Blob | MediaSource

    Returns ObjectUrl

  • fromBlobOrUrl(source: string | URL | File | Blob | MediaSource): ObjectUrl
  • Creates ObjectUrl:

    1. With functionality for Blobs, Files or MediaSources
    2. Just a wrapper for string urls

    DO NOT forget to call destroy() when you are done with it

    Parameters

    • source: string | URL | File | Blob | MediaSource

    Returns ObjectUrl

  • fromSubscription(subscriptionFactory: (registerAdditionalSubscription: (additionalSubscription: Promisable<ISubscription>) => void) => Promisable<ISubscription>): Registration
  • Create registration from a subscription

    Parameters

    • subscriptionFactory: (registerAdditionalSubscription: (additionalSubscription: Promisable<ISubscription>) => void) => Promisable<ISubscription>

      function that will create subscription

        • (registerAdditionalSubscription: (additionalSubscription: Promisable<ISubscription>) => void): Promisable<ISubscription>
        • Parameters

          • registerAdditionalSubscription: (additionalSubscription: Promisable<ISubscription>) => void
              • (additionalSubscription: Promisable<ISubscription>): void
              • Parameters

                • additionalSubscription: Promisable<ISubscription>

                Returns void

          Returns Promisable<ISubscription>

    Returns Registration

    registration that when destroyed will unsubscribe from the subscription

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

    Parameters

    • obj: any

    Returns obj is IDestroyable

  • join(...registrations: Promisable<IDestroyable>[]): Registration
  • Join multiple registrations into one

    Parameters

    • Rest ...registrations: Promisable<IDestroyable>[]

    Returns Registration

    one registration that will be destroyed when this one is destroyed

  • loop(optionsOrTick: IWork | { tick: IWork; waiter: IWork }): Registration
  • Parameters

    • optionsOrTick: IWork | { tick: IWork; waiter: IWork }

    Returns Registration

  • void(): Registration
  • Creates a registration that is empty and has nothing to destroy Note: This is useful for implementing null object pattern

    Returns Registration