IFClite TypeScript API
    Preparing search index...

    Class CsvConnector

    CSV Data Connector

    Index
    • Auto-detect column mappings based on column names

      Parameters

      • headers: string[]

      Returns PropertyMapping[]

    • Generate mutations from matched data.

      warnings, when passed, collects one message per skipped cell — one that is not exactly a value of its column's type (see parseValue), such as 12,5 in a Real column or ja in a Boolean one. Optional and additive: existing callers that only want the mutation list are unaffected.

      On a throw, the writes already applied stay in the view but cannot be returned; import() / importAsync() report them in stats.mutations (#5958).

      Parameters

      Returns Mutation[]

    • Import CSV data and apply to entities

      Computed name on purpose: Vite 8's dev-time import-analysis rewrites a literal import( method head as a dynamic import (injecting __vite__injectQuery into the parameter list), which breaks the whole viewer dev server with a SyntaxError. The computed form is the same public method, invisible to that rewrite.

      Parameters

      Returns ImportStats

    • Async batched import that yields to the main thread between batches. Provides live progress updates via onProgress callback.

      Parameters

      • content: string
      • mapping: DataMapping
      • onProgress: (progress: ImportProgress) => void
      • Optionaloptions: CsvParseOptions & {
            batchSize?: number;
            onApplied?: (mutations: readonly Mutation[]) => void;
        }
        • OptionalbatchSize?: number
        • OptionalonApplied?: (mutations: readonly Mutation[]) => void

          Called after each apply batch with the mutations it wrote, including the part of a batch that landed before a throw. Lets a host record undo history as the import goes, so an edit made while it yields stays in commit order with it (#5958).

      Returns Promise<ImportStats>

    • Match CSV rows to IFC entities.

      Builds the strategy's index once (see csv-match.ts) and reuses it across every row — the fix for #5167 task 3.1's O(rows × entities) linear scan.

      Parameters

      Returns MatchResult[]