W-CF Documentation - v11.0.0
    Preparing search index...

    Interface DocumentOutputContext

    interface DocumentOutputContext {
        customState: GroupedMap;
        geometry2dIds: readonly string[];
        geometryIds: readonly string[];
        layerNames: readonly string[];
        materialIds: readonly string[];
        textureIds: readonly string[];
        addGeometry(pGeomId: string): number;
        addGeometry2d(pGeomId: string): number;
        addLayer(pName: string): number;
        addMaterial(pMatId: string): number;
        addResource(
            pData: string | ArrayBuffer | Blob,
            pFilename: string,
            pCompress?: boolean,
        ): Promise<void>;
        addResourceFromCache(
            pFilename: string,
            pCompress?: boolean,
        ): Promise<boolean>;
        addResourceFromUrl(
            pUrl: string,
            pFilename: string,
            pBinary: boolean,
            pCompress?: boolean,
        ): Promise<void>;
        addTexture(pTexId: string): number;
        registerPendingTask(pTask: () => Promise<void>): void;
    }

    Hierarchy (View Summary)

    Index
    customState: GroupedMap
    geometry2dIds: readonly string[]
    geometryIds: readonly string[]
    layerNames: readonly string[]
    materialIds: readonly string[]
    textureIds: readonly string[]
    • Parameters

      • pGeomId: string

      Returns number

    • Parameters

      • pGeomId: string

      Returns number

    • Parameters

      • pName: string

      Returns number

    • Parameters

      • pMatId: string

      Returns number

    • Adds a binary or text resource which will be embedded in the document container.

      Parameters

      • pData: string | ArrayBuffer | Blob

        The data of the file.

      • pFilename: string

        Name of the file to add. May include a path. e.g. "textures/123.jpg". Has to be lowercase.

      • OptionalpCompress: boolean

        If true the file should be compressed (if supported by the implementation) otherwise the file should not be compressed. (Default: true)

      Returns Promise<void>

    • Adds an already cached resource to the container. True should be returned if the file was added, otherwise false (e.g. if the file was not found inside the cache).

      Parameters

      • pFilename: string

        Name of the file to add. May include a path. e.g. "textures/123.jpg". Has to be lowercase.

      • OptionalpCompress: boolean

        If true the file should be compressed (if supported by the implementation) otherwise the file should not be compressed. (Default: true)

      Returns Promise<boolean>

    • Adds a binary or text resource which will be embedded in the document container using an url.

      Parameters

      • pUrl: string

        The file url.

      • pFilename: string

        Name of the file to add. May include a path. e.g. "textures/123.jpg". Has to be lowercase.

      • pBinary: boolean

        If true the file containes binary data.

      • OptionalpCompress: boolean

        If true the file should be compressed (if supported by the implementation) otherwise the file should not be compressed. (Default: true)

      Returns Promise<void>

    • Parameters

      • pTexId: string

      Returns number

    • Can be used to register a task which needs to be finished before the the whole load/save process is finished. Tasks will be processed sequentially.

      Parameters

      • pTask: () => Promise<void>

      Returns void