mirror of
https://github.com/docmost/docmost.git
synced 2026-07-20 23:52:47 +10:00
feat(base-formula): add type checker
This commit is contained in:
@@ -1,2 +1,14 @@
|
||||
// Minimal stub: FormulaFn type will be expanded in Task 10.
|
||||
export type FormulaFn = unknown;
|
||||
// packages/base-formula/src/functions/registry.ts
|
||||
import type { FormulaResultType, Value, EvalContext } from "../types";
|
||||
|
||||
export type FormulaFn = {
|
||||
name: string;
|
||||
arity: { min: number; max: number | null };
|
||||
paramTypes: FormulaResultType[] | "any" | "variadic-any";
|
||||
returnType: FormulaResultType | ((argTypes: FormulaResultType[]) => FormulaResultType);
|
||||
eval: (args: Value[], ctx: EvalContext) => Value;
|
||||
doc: string;
|
||||
category: "logic" | "math" | "string" | "date" | "coercion";
|
||||
};
|
||||
|
||||
export const registry: Map<string, FormulaFn> = new Map();
|
||||
|
||||
Reference in New Issue
Block a user