SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface IResource

    A resource is an item referenced elsewhere with the application. This will track when a resource is no longer being used and can be removed.

    interface IResource {
        isIResource: true;
        addReference(ref: any): void;
        addUnloadListener(listener: IUnloadListener): void;
        deleteReference(ref: any): void;
        getExternalURI(): Promise<string | null>;
        getName(): string | null;
        getType(): Promise<IResource.Type>;
        isClosed(): boolean;
        toBuffer(): Promise<ArrayBuffer>;
        toJSONAsync(): Promise<IResource.JSON>;
    }

    Hierarchy

    Implemented by

    Index
    isIResource: true

    For runtime type checking.

    • Add a reference to the resource.

      Parameters

      • ref: any

        The object to strongly hold the resource.

      Returns void

      References are now strongly held by the resource collection.

    • This does not follow the standard listener pattern and is only called once.

      Parameters

      • listener: IUnloadListener

        The listener to call when the resource is unloaded.

      Returns void

    • Delete a reference to the resource.

      Parameters

      • ref: any

        The object that held the resource.

      Returns void

      References are now strongly held by the resource collection.

    • Returns the resource as a uri if this is external.

      Returns Promise<string | null>

    • An optional name for the resource.

      Returns string | null

    • true if the resource if all references have been deleted.

      Returns boolean

    • Returns the resource as a Promise to array buffer.

      Returns Promise<ArrayBuffer>

    • For saving to json resources.

      Returns Promise<IResource.JSON>