@graphty/graphty-element / session / CostGateDecision
Type Alias: CostGateDecision ​
CostGateDecision = {
estimate:CostEstimate;kind:"exact"; } | {estimate:CostEstimate;exactEstimate:CostEstimate;kind:"approximate";method:string;notes: readonlystring[];plainName:string;sampleSize:number;seeded:boolean; } | {error:GraphtyError;kind:"refused"; }
Defined in: graphty-element/src/session/cost/estimate.ts:1034
What the gate decided, as three cases a caller switches on.
Union Members ​
Type Literal ​
{ estimate: CostEstimate; kind: "exact"; }
estimate ​
readonlyestimate:CostEstimate
What it is expected to cost.
kind ​
readonlykind:"exact"
Run it exactly.
Type Literal ​
{ estimate: CostEstimate; exactEstimate: CostEstimate; kind: "approximate"; method: string; notes: readonly string[]; plainName: string; sampleSize: number; seeded: boolean; }
estimate ​
readonlyestimate:CostEstimate
What the approximate method is expected to cost.
exactEstimate ​
readonlyexactEstimate:CostEstimate
What the exact method would have cost, which is why the switch happened.
kind ​
readonlykind:"approximate"
Run the approximate method instead, and say so in the caveats.
method ​
readonlymethod:string
The method name, for caveats.method.
notes ​
readonlynotes: readonlystring[]
Sentences for caveats.notes, stating plainly what the numbers are.
plainName ​
readonlyplainName:string
What the method is called in words.
sampleSize ​
readonlysampleSize:number
The sample size, for caveats.sampleSize.
seeded ​
readonlyseeded:boolean
Whether the method takes a seed, so caveats.seed can be filled or left null.
Type Literal ​
{ error: GraphtyError; kind: "refused"; }
error ​
readonlyerror:GraphtyError
The error to reject the run with, carrying the facts a consumer switches on.
kind ​
readonlykind:"refused"
Refuse it.