UNPKG

self-assert

Version:

A small TypeScript library for designing models with built-in validity.

24 lines 1.25 kB
import { Assertion, LabelId } from "../rule"; import { FieldDraftAssistant } from "./FieldDraftAssistant"; import { SectionDraftAssistant } from "./SectionDraftAssistant"; import type { ModelFromContainer } from "../types"; /** * Provides an assistant for the completion of an integer field, * represented by a string. * * @category Draft assistants */ export declare class IntegerDraftAssistant<ContainerModel = any> extends SectionDraftAssistant<number, ContainerModel, [ string ]> { static readonly defaultAssertionDescription = "Invalid integer"; static for<ContainerModel>(assertionId: LabelId, modelFromContainer: ModelFromContainer<number, ContainerModel>): IntegerDraftAssistant<ContainerModel>; static forTopLevel(assertionId: LabelId): IntegerDraftAssistant<unknown>; static createInteger(assertionId: LabelId, numberAsString: string): number; static createNumberAssistant(): FieldDraftAssistant<number, string>; static createAssertionFor(assertionId: LabelId, numberAsString: string): Assertion<void>; innerAssistant(): import("./DraftAssistant").DraftAssistant<string, number>; setInnerModel(newModel: string): void; getInnerModel(): string; } //# sourceMappingURL=IntegerDraftAssistant.d.ts.map