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

    Interface DocumentInputContext

    interface DocumentInputContext {
        customState: GroupedMap;
        documentHeader: DocumentHeader;
        getFile(pFilename: string, pBinary: false): Promise<string>;
        getFile(pFilename: string, pBinary: true): Promise<ArrayBuffer>;
        getFile(pFilename: string, pBinary: boolean): Promise<string | ArrayBuffer>;
        getGeometry2dIdByIndex(pIndex: number): string | null;
        getGeometryIdByIndex(pIndex: number): string | null;
        getLayerNameByIndex(pIndex: number): string | null;
        getMaterialIdByIndex(pIndex: number): string | null;
        getResource(pFilename: string, pBinary: false): Promise<string>;
        getResource(pFilename: string, pBinary: true): Promise<ArrayBuffer>;
        getResource(
            pFilename: string,
            pBinary: boolean,
        ): Promise<string | ArrayBuffer>;
        getTextureIdByIndex(pIndex: number): string | null;
        listFiles(pFolderPath?: string): Promise<string[]>;
        registerPendingTask(pTask: () => Promise<void>): void;
    }

    Hierarchy (View Summary)

    Index
    customState: GroupedMap
    documentHeader: DocumentHeader
    • Retrieves a binary or text file from the container. If the file doesn't exist the promise will be rejected with an FileNotFoundError.

      Parameters

      • pFilename: string

        Name of the file. May include a path. e.g. "textures/123.jpg".

      • pBinary: false

        If true the file containes binary data and is returned as ArrayBuffer otherwise as string.

      Returns Promise<string>

    • Parameters

      • pFilename: string
      • pBinary: true

      Returns Promise<ArrayBuffer>

    • Parameters

      • pFilename: string
      • pBinary: boolean

      Returns Promise<string | ArrayBuffer>

    • Parameters

      • pIndex: number

      Returns string | null

    • Parameters

      • pIndex: number

      Returns string | null

    • Parameters

      • pIndex: number

      Returns string | null

    • Parameters

      • pIndex: number

      Returns string | null

    • Retrieves an embedded binary or text resource from the document container. If the file doesn't exist the promise will be rejected with an FileNotFoundError.

      Parameters

      • pFilename: string

        Name of the file. May include a path. e.g. "textures/123.jpg".

      • pBinary: false

        If true the file containes binary data and is returned as ArrayBuffer otherwise as string.

      Returns Promise<string>

    • Parameters

      • pFilename: string
      • pBinary: true

      Returns Promise<ArrayBuffer>

    • Parameters

      • pFilename: string
      • pBinary: boolean

      Returns Promise<string | ArrayBuffer>

    • Parameters

      • pIndex: number

      Returns string | null

    • Returns a list of files which are part of the given folder and its sub folders. The files are returned as a relative path including the file name. If the folder doesn't exist the promise will be rejected with an FileNotFoundError.

      Parameters

      • OptionalpFolderPath: string

        Path of the folder.

      Returns Promise<string[]>

    • 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