data-cap
    Preparing search index...

    Interface EvidenceProjection<T>

    The function defineEvidenceProjection() returns. Callable directly for the common case (projection(evidence) -> T); .project() returns the same value alongside automatic, per-field provenance.

    interface EvidenceProjection<T extends Record<string, unknown>> {
        project: (evidence: EvidenceModel) => EvidenceProjectionResult<T>;
        (evidence: EvidenceModel): T;
    }

    Type Parameters

    • T extends Record<string, unknown>
    Index
    project: (evidence: EvidenceModel) => EvidenceProjectionResult<T>

    Declared as a property holding a function, not as a method: what's actually attached is a closure (Object.assign(invoke, {project})) that never reads this, so a consumer is free to destructure or pass it around. A method signature would claim otherwise and make every such use look like an unbound-method bug.