UNPKG

ferngully-aurelia-tools

Version:

Ferngully Tools for Aurelia

101 lines (100 loc) 3.3 kB
import { Ajax } from "../ajax"; import { ISelectOption } from "../../interfaces/ISelectOption"; import { ISortRowValueResolver } from "../sort-column-service"; import { EventAggregator } from 'aurelia-event-aggregator'; export declare class FormSchemaService implements IFormSchemaService { private ajax; private eventAggregator; constructor(ajax: Ajax, eventAggregator: EventAggregator); webServiceName: string; getFormSchema(): Promise<IFormSchema | null>; private convertToFormSchema(jsonSchema?); private getDropdownData(schema); private getDropdownCheckboxData(schema); } export interface IFormSchema { key: string; name: string; properties: Array<IFormPropertySchema>; identifierPropertyName: string | null | undefined; } export interface IFormPropertySchema { name: string; description: string; isKey: boolean; type: string; required: boolean; sortValueResolver: ISortRowValueResolver; sortDataType: string; sortTieBreakerColumnName?: string; sortTieBreakerDataType?: string; hasValue(instance: any): boolean; dropdownTextFromValue(value: number | string): string; default: any; properties: IFormPropertySchema; enum?: Array<any>; multipleOf?: number; allOf?: Array<IFormPropertySchema>; anyOf?: Array<IFormPropertySchema>; oneOf?: Array<IFormPropertySchema>; not?: IFormPropertySchema; format?: string; dropdownConfiguration?: IDropdownConfiguration; dropdownCheckboxConfiguration?: IDropdownCheckboxConfiguration; calendarConfiguration?: ICalendarConfiguration; passwordRequirements?: IPasswordRequirements; multiLineStringConfiguration?: IMultiLineStringConfiguration; maxLength?: number; minLength?: number; matches?: RegExp; maximum?: number; exclusiveMaximum?: boolean; minimum?: number; exclusiveMinimum?: boolean; range: IRange; additionalItems?: IFormPropertySchema | boolean; items?: IFormPropertySchema | Array<IFormPropertySchema>; maxItems?: number; minItems?: number; uniqueItems?: boolean; maxProperties?: number; minProperties?: number; additionalProperties?: IFormPropertySchema | boolean; patternProperties?: Object; } export interface IPasswordRequirements { PasswordRequiresNonAlphanumeric: boolean; PasswordRequiresDigit: boolean; PasswordRequiresUpper: boolean; MinLength?: number; MaxLength?: number; } export interface IMultiLineStringConfiguration { Rows: number; Encode: boolean; } export interface IDropdownConfiguration { ValueType: string; DataUrl: string; RefetchEventName: string; DropdownData: Array<ISelectOption>; } export interface IDropdownCheckboxConfiguration { ValueType: string; DataUrl: string; RefetchEventName: string; DropdownData: Array<ISelectOption>; NoItemsText: string; } export interface ICalendarConfiguration { ViewmodelFormat: string; DisplayFormat: string; } export interface IRange { Minimum: number; Maximum: number; } export interface IFormSchemaService { webServiceName: string; getFormSchema(): Promise<IFormSchema | null>; }