UNPKG

simc-ast-builder

Version:

Parser and AST generator for SimulationCraft files

55 lines 1.99 kB
/** * Factory for creating Field instances * Provides helper methods for creating fields with appropriate defaults */ import { FieldDefinition } from "../parser/visitors/ast/utils/fieldMaps"; import { ExpressionType, Field, FieldOptions } from "./Field"; /** * Factory for creating Field instances */ export declare class FieldFactory { /** * Create a boolean field * @param name Name of the field * @param options Additional options for the field * @returns A new boolean Field */ static boolean(name: string, options?: Omit<FieldOptions, "type">): Field; /** * Create a field from an existing field definition * @param def Existing field definition * @returns A new Field based on the definition */ static fromDefinition(def: FieldDefinition): Field; /** * Create a field from a partial field definition * @param partialDef Partial field definition * @returns A new Field based on the partial definition */ static fromPartial(partialDef: { name: string; } & Partial<FieldDefinition>): Field; /** * Create a neutral field * @param name Name of the field * @param options Additional options for the field * @returns A new neutral Field */ static neutral(name: string, options?: Omit<FieldOptions, "type">): Field; /** * Create a numeric field * @param name Name of the field * @param options Additional options for the field * @returns A new numeric Field */ static numeric(name: string, options?: Omit<FieldOptions, "type">): Field; /** * Create a field with a specific type * @param name Name of the field * @param type Type of the field * @param options Additional options for the field * @returns A new Field with the specified type */ static withType(name: string, type: ExpressionType, options?: Omit<FieldOptions, "type">): Field; } //# sourceMappingURL=FieldFactory.d.ts.map