sequential-workflow-editor-model
Version:
This package contains the model for [Sequential Workflow Editor](https://github.com/nocode-js/sequential-workflow-editor).
632 lines (585 loc) • 32.7 kB
TypeScript
import * as sequential_workflow_model from 'sequential-workflow-model';
import { Properties, Step, Definition, DefinitionWalker, PropertyValue, Sequence, ComponentType, BranchedStep, Branches, SequentialStep } from 'sequential-workflow-model';
interface VariableDefinitions {
variables: VariableDefinition[];
}
interface VariableDefinition {
name: string;
type: ValueType;
}
type NullableVariableDefinition = VariableDefinition | null;
interface Variable {
name: string;
}
type NullableVariable = Variable | null;
interface AnyVariable {
name: string;
type: ValueType;
}
type NullableAnyVariable = AnyVariable | null;
interface AnyVariables {
variables: AnyVariable[];
}
declare enum WellKnownValueType {
string = "string",
number = "number",
boolean = "boolean"
}
type ValueType = WellKnownValueType | string;
interface Dynamic<TValue> {
modelId: ValueModelId;
value: TValue;
}
type ValueModelId = string;
interface StringDictionary {
items: StringDictionaryItem[];
}
interface StringDictionaryItem {
key: string;
value: string;
}
declare class Path {
readonly parts: string[];
static create(path: string[] | string): Path;
static root(): Path;
private constructor();
read<TValue = unknown>(object: object): TValue;
write<TValue = unknown>(object: object, value: TValue): void;
equals(other: Path | string): boolean;
add(part: string): Path;
last(): string;
startsWith(other: Path | string): boolean;
toString(): string;
}
declare class PropertyContext<TProperties extends Properties = Properties> {
readonly object: object;
private readonly propertyModel;
private readonly definitionModel;
static create<TProps extends Properties = Properties>(object: object, propertyModel: PropertyModel, definitionModel: DefinitionModel): PropertyContext<TProps>;
private constructor();
/**
* @returns the type of the step, or `null` if the object is root.
*/
readonly tryGetStepType: () => string | null;
/**
* Get the value of a property by name.
* @param name The name of the property.
* @returns The value of the property.
*/
readonly getPropertyValue: <Key extends keyof TProperties>(name: Key) => TProperties[Key];
/**
* @returns The supported value types for variables.
*/
readonly getValueTypes: () => ValueType[];
/**
* Format a property value using a formatter function.
* @param name The name of the property.
* @param formatter The formatter function.
* @param undefinedValue The value to return if the property value is `null` or `undefined`.
*/
readonly formatPropertyValue: <Key extends keyof TProperties>(name: Key, formatter: (value: NonNullable<TProperties[Key]>) => string, undefinedValue?: string) => string;
}
declare class DefaultValueContext<TProperties extends Properties = Properties> {
private readonly activator;
readonly propertyContext: PropertyContext<TProperties>;
static create<TProps extends Properties = Properties>(activator: ModelActivator, propertyContext: PropertyContext<TProps>): DefaultValueContext<TProps>;
private constructor();
readonly getPropertyValue: <Key extends keyof TProperties>(name: Key) => TProperties[Key];
readonly formatPropertyValue: <Key extends keyof TProperties>(name: Key, formatter: (value: NonNullable<TProperties[Key]>) => string, undefinedValue?: string | undefined) => string;
readonly activateStep: <TStep extends sequential_workflow_model.Step>(stepType: string) => TStep;
}
type I18n = (key: string, defaultValue: string, replacements?: Record<string, string>) => string;
declare const defaultI18n: I18n;
declare class ParentsProvider {
private readonly step;
private readonly definition;
private readonly definitionModel;
private readonly definitionWalker;
private readonly i18n;
static createForStep(step: Step, definition: Definition, definitionModel: DefinitionModel, definitionWalker: DefinitionWalker, i18n: I18n): ParentsProvider;
static createForRoot(definition: Definition, definitionModel: DefinitionModel, definitionWalker: DefinitionWalker, i18n: I18n): ParentsProvider;
private constructor();
getVariables(): ContextVariable[];
private appendVariables;
readonly getParentStepTypes: () => string[];
}
declare class ScopedPropertyContext<TProperties extends Properties> {
readonly propertyContext: PropertyContext<TProperties>;
readonly i18n: I18n;
private readonly parentsProvider;
static create<TProps extends Properties>(propertyContext: PropertyContext<TProps>, parentsProvider: ParentsProvider, i18n: I18n): ScopedPropertyContext<TProps>;
private constructor();
readonly tryGetStepType: () => string | null;
readonly getPropertyValue: <Key extends keyof TProperties>(name: Key) => TProperties[Key];
readonly formatPropertyValue: <Key extends keyof TProperties>(name: Key, formatter: (value: NonNullable<TProperties[Key]>) => string, undefinedValue?: string | undefined) => string;
readonly getValueTypes: () => string[];
readonly hasVariable: (variableName: string, valueType: string | null) => boolean;
readonly findFirstUndefinedVariable: (variableNames: string[]) => string | undefined;
readonly isVariableDuplicated: (variableName: string) => boolean;
readonly tryGetVariableType: (variableName: string) => ValueType | null;
readonly getVariables: () => ContextVariable[];
}
declare class SimpleEvent<T> {
private readonly listeners;
subscribe(listener: SimpleEventListener<T>): void;
unsubscribe(listener: SimpleEventListener<T>): void;
readonly forward: (value: T) => void;
count(): number;
}
type SimpleEventListener<T> = (value: T) => void;
declare class DefinitionContext {
readonly object: Step | Definition;
readonly definition: Definition;
readonly definitionModel: DefinitionModel;
readonly parentsProvider: ParentsProvider;
static createForStep(step: Step, definition: Definition, definitionModel: DefinitionModel, definitionWalker: DefinitionWalker, i18n: I18n): DefinitionContext;
static createForRoot(definition: Definition, definitionModel: DefinitionModel, definitionWalker: DefinitionWalker, i18n: I18n): DefinitionContext;
private constructor();
}
declare class ValueContext<TValueModel extends ValueModel = ValueModel, TProperties extends Properties = Properties> {
readonly model: TValueModel;
readonly scopedPropertyContext: ScopedPropertyContext<TProperties>;
static createFromDefinitionContext<TValModel extends ValueModel, TProps extends Properties = Properties>(valueModel: TValModel, propertyModel: PropertyModel, definitionContext: DefinitionContext, i18n: I18n): ValueContext<TValModel, TProps>;
readonly onValueChanged: SimpleEvent<Path>;
private constructor();
readonly tryGetStepType: () => string | null;
readonly getPropertyValue: <Key extends keyof TProperties>(name: Key) => TProperties[Key];
readonly formatPropertyValue: <Key extends keyof TProperties>(name: Key, formatter: (value: NonNullable<TProperties[Key]>) => string, undefinedValue?: string | undefined) => string;
readonly getValueTypes: () => string[];
readonly hasVariable: (variableName: string, valueType: string | null) => boolean;
readonly findFirstUndefinedVariable: (variableNames: string[]) => string | undefined;
readonly isVariableDuplicated: (variableName: string) => boolean;
readonly tryGetVariableType: (variableName: string) => string | null;
readonly getVariables: () => ContextVariable[];
readonly i18n: I18n;
readonly getValue: () => ReturnType<TValueModel['getDefaultValue']>;
readonly setValue: (value: ReturnType<TValueModel['getDefaultValue']>) => void;
readonly validate: () => ValidationResult;
createChildContext<TChildModel extends ValueModel<PropertyValue, object, TProperties>>(childValueModel: TChildModel): ValueContext<TChildModel>;
}
declare class DefinitionValidator {
private readonly model;
private readonly walker;
private readonly i18n;
static create(definitionModel: DefinitionModel, definitionWalker: DefinitionWalker, i18n?: I18n): DefinitionValidator;
private constructor();
/**
* Deeply validates the given definition.
* @param definition The definition to validate.
* @returns `null` if the definition is valid, otherwise an object describing the validation error.
*/
validate(definition: Definition): DefinitionValidationError | null;
validateStep(step: Step, definition: Definition): PropertyValidationError | null;
validateRoot(definition: Definition): PropertyValidationError | null;
private validateProperties;
private validateProperty;
}
interface PropertyValidationError {
propertyPath: Path;
error: ValidationError;
}
interface DefinitionValidationError extends PropertyValidationError {
/**
* Step id. If it is `null` then the error is related to the root.
*/
stepId: string | null;
}
declare class PropertyValidatorContext<TValue extends PropertyValue = PropertyValue, TProperties extends Properties = Properties> {
private readonly valueContext;
static create<TVal extends PropertyValue, TProps extends Properties>(valueContext: ValueContext<ValueModel, TProps>): PropertyValidatorContext<TVal, TProps>;
protected constructor(valueContext: ValueContext<ValueModel, TProperties>);
readonly getPropertyValue: <Key extends keyof TProperties>(name: Key) => TProperties[Key];
readonly formatPropertyValue: <Key extends keyof TProperties>(name: Key, formatter: (value: NonNullable<TProperties[Key]>) => string, undefinedValue?: string | undefined) => string;
readonly getSupportedValueTypes: () => string[];
readonly hasVariable: (variableName: string, valueType: string | null) => boolean;
readonly findFirstUndefinedVariable: (variableNames: string[]) => string | undefined;
readonly isVariableDuplicated: (variableName: string) => boolean;
readonly tryGetVariableType: (variableName: string) => string | null;
readonly getVariables: () => ContextVariable[];
getValue(): TValue;
}
declare class StepValidatorContext {
private readonly parentsProvider;
static create(definitionContext: DefinitionContext): StepValidatorContext;
private constructor();
/**
* @returns The parent step types.
* @example `['loop', 'if']`
*/
readonly getParentStepTypes: () => string[];
}
declare function variableNameValidator(i18n: I18n, name: string): string | null;
interface DefinitionModel<TDefinition extends Definition = Definition> {
root: RootModel;
steps: StepModels;
valueTypes: ValueType[];
}
interface RootModel {
sequence: PropertyModel<Sequence>;
properties: PropertyModels;
}
type StepModels = Record<string, StepModel>;
interface StepModel {
type: string;
componentType: string;
category?: string;
toolbox: boolean;
label: string;
description?: string;
name: PropertyModel<string>;
properties: PropertyModels;
validator?: StepValidator;
}
type PropertyModels = PropertyModel[];
interface PropertyModel<TValue extends PropertyValue = PropertyValue, TConfiguration extends object = object> {
path: Path;
label: string;
hint?: string;
dependencies: Path[];
validator?: PropertyValidator<TValue>;
value: ValueModel<TValue, TConfiguration, Properties>;
}
interface ValueModelFactory<TValue extends PropertyValue = PropertyValue, TConfiguration extends object = object, TProperties extends Properties = Properties> {
create(path: Path): ValueModel<TValue, TConfiguration, TProperties>;
}
type ValueModelFactoryFromModel<TValueModel extends ValueModel = ValueModel> = ValueModelFactory<ReturnType<TValueModel['getDefaultValue']>, TValueModel['configuration']>;
interface StepValidator {
validate(context: StepValidatorContext): string | null;
}
interface ValueModel<TValue extends PropertyValue = PropertyValue, TConfiguration extends object = object, TProperties extends Properties = Properties> {
id: ValueModelId;
editorId?: string;
path: Path;
/**
* Default translation for the label.
*/
label: string;
configuration: TConfiguration;
subModels?: ValueModel[];
getDefaultValue(context: DefaultValueContext): TValue;
getVariableDefinitions(context: ValueContext<ValueModel<TValue, TConfiguration, TProperties>>): VariableDefinition[] | null;
validate(context: ValueContext<ValueModel<TValue, TConfiguration, TProperties>>): ValidationResult;
}
interface PropertyValidator<TValue extends PropertyValue = PropertyValue, TProperties extends Properties = Properties> {
validate(context: PropertyValidatorContext<TValue, TProperties>): string | null;
}
type ValidationError = Record<string, string | null>;
type ValidationResult = ValidationError | null;
declare function createValidationSingleError(error: string): ValidationError;
interface ContextVariable {
readonly name: string;
readonly type: ValueType;
readonly stepId: string | null;
readonly valueModelPath: Path;
}
type UidGenerator = () => string;
declare class ModelActivator<TDefinition extends Definition = Definition> {
private readonly definitionModel;
private readonly uidGenerator;
static create<TDef extends Definition>(definitionModel: DefinitionModel<TDef>, uidGenerator: UidGenerator): ModelActivator<TDef>;
private constructor();
readonly activateDefinition: () => TDefinition;
readonly activateStep: <TStep extends Step>(stepType: string) => TStep;
private activatePropertiesInOrder;
private activateProperty;
}
declare class CircularDependencyDetector {
private readonly dependencies;
check(source: Path, target: Path): void;
}
declare class PropertyModelBuilder<TValue extends PropertyValue = PropertyValue, TProperties extends Properties = Properties> {
private readonly path;
private readonly circularDependencyDetector;
private _value?;
private _label?;
private _hint?;
private _dependencies;
private _validator?;
constructor(path: Path, circularDependencyDetector: CircularDependencyDetector);
/**
* @returns `true` if the model of the value is set, otherwise `false`.
*/
hasValue(): boolean;
/**
* Sets the model of the value.
* @param valueModelFactory The factory function that creates the model of the value.
* @example `builder.value(stringValueModel({ defaultValue: 'Some value' }));`
*/
value(valueModelFactory: ValueModelFactory<TValue, object, TProperties>): this;
/**
* Sets the label of the property.
* @param label The label of the property.
* @example `builder.label('Foo');`
*/
label(label: string): this;
/**
* Sets the hint of the property. The hint is displayed in the property editor.
* @param hint The hint of the property.
* @example `builder.hint('This is a hint');`
*/
hint(hint: string): this;
/**
* Sets which properties the property depends on. Values of dependent properties are available in the custom validator.
* @param propertyName Name of the property in the step.
*/
dependentProperty(propertyName: keyof TProperties): this;
/**
* Sets the custom validator of the property.
* @param validator The custom validator of the property.
* @example `builder.customValidator({ validate(context) { return 'error'; } });`
*/
validator(validator: PropertyValidator<TValue, TProperties>): this;
build(): PropertyModel<TValue>;
private getDefaultLabel;
}
declare class StepModelBuilder<TStep extends Step> {
protected readonly type: string;
private readonly componentType;
protected readonly circularDependencyDetector: CircularDependencyDetector;
private _label?;
private _description?;
private _category?;
private _toolbox;
private _validator?;
private readonly nameBuilder;
private readonly propertyBuilder;
constructor(type: string, componentType: ComponentType);
/**
* Sets the label of the step. This field is used in the toolbox and the editor to display the step.
*/
label(label: string): this;
/**
* Sets the description of the step.
* @param description The description of the step.
* @example `builder.description('This step does something useful.');`
*/
description(description: string): this;
/**
* Sets the category of the step. This field is used in the toolbox to group steps.
* @param category The category of the step.
* @example `builder.category('Utilities');`
*/
category(category: string): this;
/**
* Sets whether the step should be displayed in the toolbox. Default is `true`.
* @param toolbox Whether the step should be displayed in the toolbox.
* @example `builder.toolbox(false);`
*/
toolbox(toolbox: boolean): this;
/**
* Sets the validator of the step.
* @param validator The validator.
*/
validator(validator: StepValidator): this;
/**
* @returns The builder for the `name` property.
* @example `builder.name().value(createStringValueModel({ defaultValue: 'Some name' })).label('Name');`
*/
name(): PropertyModelBuilder<string, TStep['properties']>;
/**
* @param propertyName Name of the property in the step.
* @returns The builder for the property.
* @example `builder.property('foo').value(createStringValueModel({ defaultValue: 'Some value' })).label('Foo');`
*/
property<Key extends keyof TStep['properties']>(propertyName: Key): PropertyModelBuilder<TStep['properties'][Key], TStep['properties']>;
build(): StepModel;
}
declare function createStepModel<TStep extends Step>(type: TStep['type'], componentType: TStep['componentType'], build: (builder: StepModelBuilder<TStep>) => void): StepModel;
declare class BranchedStepModelBuilder<TStep extends BranchedStep> extends StepModelBuilder<TStep> {
private readonly branchesBuilder;
/**
* @returns the builder for the branches property.
* @example `builder.branches().value(createBranchesValueModel(...));`
*/
branches(): PropertyModelBuilder<Branches, TStep['properties']>;
build(): StepModel;
}
declare function createBranchedStepModel<TStep extends BranchedStep>(type: TStep['type'], componentType: TStep['componentType'], build: (builder: BranchedStepModelBuilder<TStep>) => void): StepModel;
declare class RootModelBuilder<TProperties extends Properties> {
protected readonly circularDependencyDetector: CircularDependencyDetector;
private readonly propertyBuilders;
private readonly sequenceBuilder;
/**
* @param propertyName Name of the property.
* @returns The builder for the property.
* @example `builder.property('foo').value(createStringValueModel({ defaultValue: 'Some value' })).label('Foo');`
*/
property<Key extends keyof TProperties>(propertyName: Key): PropertyModelBuilder<TProperties[Key], TProperties>;
/**
* @returns the builder for the sequence property.
* @example `builder.sequence().value(createSequenceValueModel(...));`
*/
sequence(): PropertyModelBuilder<Sequence>;
build(): RootModel;
}
declare function createRootModel<TDefinition extends Definition>(build: (builder: RootModelBuilder<TDefinition['properties']>) => void): RootModel;
declare class DefinitionModelBuilder<TDefinition extends Definition> {
private rootModel?;
private readonly stepModels;
private _valueTypes?;
constructor();
root(modelOrCallback: RootModel | ((builder: RootModelBuilder<TDefinition['properties']>) => void)): this;
steps(models: StepModel[]): this;
step(model: StepModel): this;
valueTypes(valueTypes: ValueType[]): this;
build(): DefinitionModel<TDefinition>;
}
declare function createDefinitionModel<TDefinition extends Definition = Definition>(build: (builder: DefinitionModelBuilder<TDefinition>) => void): DefinitionModel<TDefinition>;
declare class SequentialStepModelBuilder<TStep extends SequentialStep> extends StepModelBuilder<TStep> {
private readonly sequenceBuilder;
/**
* @returns the builder for the sequence property.
* @example `builder.sequence().value(createSequenceValueModel(...));`
*/
sequence(): PropertyModelBuilder<Sequence>;
build(): StepModel;
}
declare function createSequentialStepModel<TStep extends SequentialStep>(type: TStep['type'], componentType: TStep['componentType'], build: (builder: SequentialStepModelBuilder<TStep>) => void): StepModel;
interface AnyVariablesValueModelConfiguration {
label?: string;
valueTypes?: ValueType[];
editorId?: string;
}
type AnyVariablesValueModel = ValueModel<AnyVariables, AnyVariablesValueModelConfiguration>;
declare const anyVariablesValueModelId = "anyVariables";
declare const createAnyVariablesValueModel: (configuration: AnyVariablesValueModelConfiguration) => ValueModelFactoryFromModel<AnyVariablesValueModel>;
interface BooleanValueModelConfiguration {
label?: string;
defaultValue?: boolean;
editorId?: string;
}
type BooleanValueModel = ValueModel<boolean, BooleanValueModelConfiguration>;
declare const booleanValueModelId = "boolean";
declare const createBooleanValueModel: (configuration: BooleanValueModelConfiguration) => ValueModelFactoryFromModel<BooleanValueModel>;
interface BranchesValueModelConfiguration {
/**
* @description Branches of the branched step. Each branch is a list of step types.
*/
branches: Record<string, string[]>;
/**
* @description If true, the branches are dynamic and can be changed by the user.
*/
dynamic?: boolean;
/**
* @description Override the default editor for the branches.
*/
editorId?: string;
}
type BranchesValueModel<TBranches extends Branches> = ValueModel<TBranches, BranchesValueModelConfiguration>;
type BranchesOf<TConfiguration extends BranchesValueModelConfiguration> = Record<keyof TConfiguration['branches'], Sequence>;
declare const branchesValueModelId = "branches";
declare const createBranchesValueModel: <TConfiguration extends BranchesValueModelConfiguration>(configuration: TConfiguration) => ValueModelFactoryFromModel<BranchesValueModel<BranchesOf<TConfiguration>>>;
interface ChoiceValueModelConfiguration<TValue extends string = string> {
/**
* Label. If not provided, the label is generated from the property name.
*/
label?: string;
/**
* Supported choices.
*/
choices: TValue[];
/**
* Default value.
*/
defaultValue?: TValue;
/**
* Custom editor ID.
*/
editorId?: string;
}
type ChoiceValueModel<TValue extends string = string> = ValueModel<TValue, ChoiceValueModelConfiguration<TValue>>;
declare const choiceValueModelId = "choice";
declare function createChoiceValueModel<TValue extends string>(configuration: ChoiceValueModelConfiguration<TValue>): ValueModelFactory<TValue, ChoiceValueModelConfiguration<TValue>>;
interface DynamicValueModelConfiguration<TSubModels extends ValueModelFactoryFromModel[]> {
models: TSubModels;
}
type DynamicValueModel<TSubModels extends ValueModelFactoryFromModel[] = ValueModelFactoryFromModel[]> = ValueModel<Dynamic<TValueOf<TSubModels>>, DynamicValueModelConfiguration<ValueModelFactoryFromModel[]>>;
type ReturnTypeOfModelFactory<TValueModelFactory> = TValueModelFactory extends ValueModelFactoryFromModel<infer U>[] ? ReturnType<U['getDefaultValue']> : never;
type TValueOf<TValueModelFactory extends ValueModelFactoryFromModel[]> = ReturnTypeOfModelFactory<TValueModelFactory>;
declare const dynamicValueModelId = "dynamic";
declare function createDynamicValueModel<TValueModelFactory extends ValueModelFactoryFromModel[]>(configuration: DynamicValueModelConfiguration<TValueModelFactory>): ValueModelFactoryFromModel<DynamicValueModel<TValueModelFactory>>;
interface GeneratedStringValueModelConfiguration<TProperties extends Properties = Properties> {
label?: string;
generator(context: GeneratedStringContext<TProperties>): string;
editorId?: string;
}
type GeneratedStringVariableValueModel<TProperties extends Properties = Properties> = ValueModel<string, GeneratedStringValueModelConfiguration<TProperties>>;
declare const generatedStringValueModelId = "generatedString";
declare function createGeneratedStringValueModel<TProperties extends Properties = Properties>(configuration: GeneratedStringValueModelConfiguration<TProperties>): ValueModelFactory<string, GeneratedStringValueModelConfiguration<TProperties>, TProperties>;
declare class GeneratedStringContext<TProperties extends Properties = Properties> {
private readonly context;
static create<TProps extends Properties = Properties>(context: ValueContext<GeneratedStringVariableValueModel<TProps>, TProps> | DefaultValueContext<TProps>): GeneratedStringContext<TProps>;
private constructor();
readonly getPropertyValue: <Key extends keyof TProperties>(name: Key) => TProperties[Key];
readonly formatPropertyValue: <Key extends keyof TProperties>(name: Key, formatter: (value: NonNullable<TProperties[Key]>) => string, undefinedValue?: string | undefined) => string;
}
interface NullableAnyVariableValueModelConfiguration {
label?: string;
isRequired?: boolean;
valueTypes?: ValueType[];
editorId?: string;
}
type NullableAnyVariableValueModel = ValueModel<NullableAnyVariable, NullableAnyVariableValueModelConfiguration>;
declare const nullableAnyVariableValueModelId = "nullableAnyVariable";
declare const createNullableAnyVariableValueModel: (configuration: NullableAnyVariableValueModelConfiguration) => ValueModelFactoryFromModel<NullableAnyVariableValueModel>;
interface NullableVariableValueModelConfiguration {
label?: string;
valueType: ValueType;
isRequired?: boolean;
editorId?: string;
}
type NullableVariableValueModel = ValueModel<NullableVariable, NullableVariableValueModelConfiguration>;
declare const nullableVariableValueModelId = "nullableVariable";
declare const createNullableVariableValueModel: (configuration: NullableVariableValueModelConfiguration) => ValueModelFactoryFromModel<NullableVariableValueModel>;
interface NullableVariableDefinitionValueModelConfiguration {
valueType: ValueType;
isRequired?: boolean;
defaultValue?: VariableDefinition;
}
type NullableVariableDefinitionValueModel = ValueModel<NullableVariableDefinition, NullableVariableDefinitionValueModelConfiguration>;
declare const nullableVariableDefinitionValueModelId = "nullableVariableDefinition";
declare const createNullableVariableDefinitionValueModel: (configuration: NullableVariableDefinitionValueModelConfiguration) => ValueModelFactoryFromModel<NullableVariableDefinitionValueModel>;
interface NumberValueModelConfiguration {
label?: string;
defaultValue?: number;
min?: number;
max?: number;
editorId?: string;
}
type NumberValueModel = ValueModel<number, NumberValueModelConfiguration>;
declare const numberValueModelId = "number";
declare const createNumberValueModel: (configuration: NumberValueModelConfiguration) => ValueModelFactoryFromModel<NumberValueModel>;
interface SequenceValueModelConfiguration {
sequence: string[];
}
type SequenceValueModel = ValueModel<Sequence, SequenceValueModelConfiguration>;
declare const sequenceValueModelId = "sequence";
declare const createSequenceValueModel: (configuration: SequenceValueModelConfiguration) => ValueModelFactoryFromModel<SequenceValueModel>;
interface StringValueModelConfiguration {
label?: string;
minLength?: number;
defaultValue?: string;
pattern?: RegExp;
multiline?: boolean | number;
editorId?: string;
}
type StringValueModel = ValueModel<string, StringValueModelConfiguration>;
declare const stringValueModelId = "string";
declare const createStringValueModel: (configuration: StringValueModelConfiguration) => ValueModelFactoryFromModel<StringValueModel>;
interface StringDictionaryValueModelConfiguration {
label?: string;
uniqueKeys?: boolean;
valueMinLength?: number;
editorId?: string;
}
type StringDictionaryValueModel = ValueModel<StringDictionary, StringDictionaryValueModelConfiguration>;
declare const stringDictionaryValueModelId = "stringDictionary";
declare const createStringDictionaryValueModel: (configuration: StringDictionaryValueModelConfiguration) => ValueModelFactoryFromModel<StringDictionaryValueModel>;
interface VariableDefinitionsValueModelConfiguration {
valueTypes?: ValueType[];
defaultValue?: VariableDefinitions;
}
type VariableDefinitionsValueModel = ValueModel<VariableDefinitions, VariableDefinitionsValueModelConfiguration>;
declare const variableDefinitionsValueModelId = "variableDefinitions";
declare const createVariableDefinitionsValueModel: (configuration: VariableDefinitionsValueModelConfiguration) => ValueModelFactoryFromModel<VariableDefinitionsValueModel>;
export { type AnyVariable, type AnyVariables, type AnyVariablesValueModel, type AnyVariablesValueModelConfiguration, type BooleanValueModel, type BooleanValueModelConfiguration, BranchedStepModelBuilder, type BranchesValueModel, type BranchesValueModelConfiguration, type ChoiceValueModel, type ChoiceValueModelConfiguration, type ContextVariable, DefaultValueContext, DefinitionContext, type DefinitionModel, DefinitionModelBuilder, type DefinitionValidationError, DefinitionValidator, type Dynamic, type DynamicValueModel, type DynamicValueModelConfiguration, GeneratedStringContext, type GeneratedStringValueModelConfiguration, type GeneratedStringVariableValueModel, type I18n, ModelActivator, type NullableAnyVariable, type NullableAnyVariableValueModel, type NullableAnyVariableValueModelConfiguration, type NullableVariable, type NullableVariableDefinition, type NullableVariableDefinitionValueModel, type NullableVariableDefinitionValueModelConfiguration, type NullableVariableValueModel, type NullableVariableValueModelConfiguration, type NumberValueModel, type NumberValueModelConfiguration, Path, PropertyContext, type PropertyModel, PropertyModelBuilder, type PropertyModels, type PropertyValidationError, type PropertyValidator, PropertyValidatorContext, type RootModel, RootModelBuilder, ScopedPropertyContext, type SequenceValueModel, type SequenceValueModelConfiguration, SequentialStepModelBuilder, SimpleEvent, type SimpleEventListener, type StepModel, StepModelBuilder, type StepModels, type StepValidator, StepValidatorContext, type StringDictionary, type StringDictionaryItem, type StringDictionaryValueModel, type StringDictionaryValueModelConfiguration, type StringValueModel, type StringValueModelConfiguration, type UidGenerator, type ValidationError, type ValidationResult, ValueContext, type ValueModel, type ValueModelFactory, type ValueModelFactoryFromModel, type ValueModelId, type ValueType, type Variable, type VariableDefinition, type VariableDefinitions, type VariableDefinitionsValueModel, type VariableDefinitionsValueModelConfiguration, WellKnownValueType, anyVariablesValueModelId, booleanValueModelId, branchesValueModelId, choiceValueModelId, createAnyVariablesValueModel, createBooleanValueModel, createBranchedStepModel, createBranchesValueModel, createChoiceValueModel, createDefinitionModel, createDynamicValueModel, createGeneratedStringValueModel, createNullableAnyVariableValueModel, createNullableVariableDefinitionValueModel, createNullableVariableValueModel, createNumberValueModel, createRootModel, createSequenceValueModel, createSequentialStepModel, createStepModel, createStringDictionaryValueModel, createStringValueModel, createValidationSingleError, createVariableDefinitionsValueModel, defaultI18n, dynamicValueModelId, generatedStringValueModelId, nullableAnyVariableValueModelId, nullableVariableDefinitionValueModelId, nullableVariableValueModelId, numberValueModelId, sequenceValueModelId, stringDictionaryValueModelId, stringValueModelId, variableDefinitionsValueModelId, variableNameValidator };