IFClite TypeScript API
    Preparing search index...

    Interface IfcSourceBytes

    interface IfcSourceBytes {
        byteLength: number;
        contentKey: string | null;
        isResident: boolean;
        length: number;
        decodeUtf8(start: number, end: number): string;
        materialize(): Uint8Array;
        slice(start: number, end: number): Uint8Array;
        toTransferable(): IfcSourceTransfer;
        withMaterialized<T>(fn: (bytes: Uint8Array) => T): T;
        withMaterializedAsync<T>(fn: (bytes: Uint8Array) => Promise<T>): Promise<T>;
    }
    Index
    byteLength: number

    Logical (uncompressed) length. 0 means "this model has no source".

    contentKey: string | null

    Stable identity of the CONTENT. null when there is no source.

    isResident: boolean

    True when the bytes are contiguous and resident: slice is a view and materialize is free.

    length: number

    Alias of byteLength, kept so existing ?.length guards compile and behave identically. Prefer byteLength in new code.

    • UTF-8 decode of [start, end), without allocating an intermediate view when the implementation can avoid it. This is the hot path.

      Parameters

      • start: number
      • end: number

      Returns string

    • The whole source as one contiguous view. May allocate byteLength bytes, so callers must drop the result promptly. Prefer withMaterialized, which makes that structural.

      Returns Uint8Array

    • Bytes in [start, end). Clamped to the source and never throws, so a caller reading a stale byte range gets an empty or short view rather than an exception. Returns a view when resident.

      Parameters

      • start: number
      • end: number

      Returns Uint8Array

    • Scoped materialize: the buffer cannot outlive the callback.

      Type Parameters

      • T

      Parameters

      • fn: (bytes: Uint8Array) => T

      Returns T

    • Async form of withMaterialized.

      Type Parameters

      • T

      Parameters

      • fn: (bytes: Uint8Array) => Promise<T>

      Returns Promise<T>