@bitbybit-dev/core
Version: 
Bit By Bit Developers Core CAD API to Program Geometry
71 lines (70 loc) • 2.34 kB
TypeScript
import * as Inputs from "../inputs/inputs";
import { AssetManager } from "../../asset-manager";
export declare class Asset {
    assetManager: AssetManager;
    constructor();
    /**
     * Gets the asset file
     * @param inputs file name to get from project assets
     * @returns Blob of asset
     * @group get
     * @shortname cloud file
     */
    getFile(inputs: Inputs.Asset.GetAssetDto): Promise<File>;
    /**
     * Gets the local asset file stored in your browser.
     * @param inputs asset name to get from local assets
     * @returns Blob of asset
     * @group get
     * @shortname local file
     */
    getLocalFile(inputs: Inputs.Asset.GetAssetDto): Promise<File | File[]>;
    /**
     * Fetches the blob from the given url, must be CORS enabled accessible endpoint
     * @param inputs url of the asset
     * @returns Blob
     * @group fetch
     * @shortname fetch blob
     */
    fetchBlob(inputs: Inputs.Asset.FetchDto): Promise<Blob>;
    /**
     * Fetches the file from the given url, must be CORS enabled accessible endpoint
     * @param inputs url of the asset
     * @returns File
     * @group fetch
     * @shortname fetch file
     */
    fetchFile(inputs: Inputs.Asset.FetchDto): Promise<File>;
    /**
     * Fetches the json from the given url, must be CORS enabled accessible endpoint
     * @param inputs url of the asset
     * @returns JSON
     * @group fetch
     * @shortname fetch json
     */
    fetchJSON(inputs: Inputs.Asset.FetchDto): Promise<any>;
    /**
     * Fetches the json from the given url, must be CORS enabled accessible endpoint
     * @param inputs url of the asset
     * @returns Text
     * @group fetch
     * @shortname fetch text
     */
    fetchText(inputs: Inputs.Asset.FetchDto): Promise<string>;
    /**
     * Gets and creates the url string path to your file stored in your memory.
     * @param File or a blob
     * @returns URL string of a file
     * @group create
     * @shortname object url
     */
    createObjectURL(inputs: Inputs.Asset.FileDto): string;
    /**
     * Gets and creates the url string paths to your files stored in your memory.
     * @param Files or a blobs
     * @returns URL strings for given files
     * @group create
     * @shortname object urls
     */
    createObjectURLs(inputs: Inputs.Asset.FilesDto): string[];
}