Skip to content
Français

defineDecision

import { defineDecision } from "@elie-laloum/outpost";

Validate, snapshot and freeze named choice, score and noul questions. No provider request occurs; literal keys and choices determine the inferred answer types.

Complete example and detailed rules.

  • optionsRequired
    DecisionOptions<Q>
    Questions to validate, snapshot and freeze without executing a request.
  • options.questionsRequired
    Q
    Nonempty named questions whose keys and choice literals determine the answer types.

Decision<Q>

export declare function defineDecision<const Q extends DecisionQuestions>(
  options: DecisionOptions<Q>,
): Decision<Q>;