From 972b76b42bf0bbe4e151ecdc5675882fdd378a15 Mon Sep 17 00:00:00 2001 From: brendanjbond Date: Mon, 12 Feb 2024 14:19:14 -0600 Subject: [PATCH] remove stale types --- package.json | 1 - types/builders.d.ts | 7 - .../_classes/component/component.d.ts | 174 ------------- .../componentmodal/componentmodal.d.ts | 31 --- types/components/_classes/field/field.d.ts | 5 - types/components/_classes/input/input.d.ts | 30 --- .../_classes/multivalue/multivalue.d.ts | 16 -- .../_classes/nested/nestedComponent.d.ts | 61 ----- .../widgetcomponent/widgetComponent.d.ts | 6 - types/components/components.d.ts | 69 ----- types/components/schema.d.ts | 240 ------------------ types/displays.d.ts | 7 - types/element.d.ts | 45 ---- types/eventEmitter.d.ts | 3 - types/form.d.ts | 18 -- types/formbuilder.d.ts | 6 - types/formio.d.ts | 121 --------- types/index.d.ts | 18 -- types/licenses.d.ts | 7 - types/providers.d.ts | 8 - types/rulesEngine/conjunctions.d.ts | 7 - types/rulesEngine/operators.d.ts | 7 - types/rulesEngine/quckRules.d.ts | 7 - types/rulesEngine/rules.d.ts | 7 - types/rulesEngine/transformers.d.ts | 7 - types/rulesEngine/valueSources.d.ts | 7 - types/templates.d.ts | 8 - types/utils.d.ts | 157 ------------ types/widgets.d.ts | 4 - 29 files changed, 1084 deletions(-) delete mode 100644 types/builders.d.ts delete mode 100644 types/components/_classes/component/component.d.ts delete mode 100644 types/components/_classes/componentmodal/componentmodal.d.ts delete mode 100644 types/components/_classes/field/field.d.ts delete mode 100644 types/components/_classes/input/input.d.ts delete mode 100644 types/components/_classes/multivalue/multivalue.d.ts delete mode 100644 types/components/_classes/nested/nestedComponent.d.ts delete mode 100644 types/components/_classes/widgetcomponent/widgetComponent.d.ts delete mode 100644 types/components/components.d.ts delete mode 100644 types/components/schema.d.ts delete mode 100644 types/displays.d.ts delete mode 100644 types/element.d.ts delete mode 100644 types/eventEmitter.d.ts delete mode 100644 types/form.d.ts delete mode 100644 types/formbuilder.d.ts delete mode 100644 types/formio.d.ts delete mode 100644 types/index.d.ts delete mode 100644 types/licenses.d.ts delete mode 100644 types/providers.d.ts delete mode 100644 types/rulesEngine/conjunctions.d.ts delete mode 100644 types/rulesEngine/operators.d.ts delete mode 100644 types/rulesEngine/quckRules.d.ts delete mode 100644 types/rulesEngine/rules.d.ts delete mode 100644 types/rulesEngine/transformers.d.ts delete mode 100644 types/rulesEngine/valueSources.d.ts delete mode 100644 types/templates.d.ts delete mode 100644 types/utils.d.ts delete mode 100644 types/widgets.d.ts diff --git a/package.json b/package.json index 92e364fcce..89f1f79f20 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "require": "./lib/cjs/formio.embed.js" } }, - "types": "index.d.ts", "files": [ "dist", "lib", diff --git a/types/builders.d.ts b/types/builders.d.ts deleted file mode 100644 index fee9af8a82..0000000000 --- a/types/builders.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class Builders { - static readonly builders: any; - static addBuilder(name: string, builder: any): void; - static addBuilders(builders: any): void; - static getBuilder(name: string): any; - static getBuilder(): any; -} diff --git a/types/components/_classes/component/component.d.ts b/types/components/_classes/component/component.d.ts deleted file mode 100644 index 443c94441f..0000000000 --- a/types/components/_classes/component/component.d.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { Element } from '../../../element'; -import { ComponentSchema, ElementInfo, ExtendedComponentSchema, ValidateOptions } from './../../schema.d'; - -export class Component extends Element { - static schema(sources: ExtendedComponentSchema): ExtendedComponentSchema; - static tableView(value: any, options: any): void; - constructor(component: any, options: Object, data: Object); - public originalComponent: any | Component; - public refs: Object; - public attached: boolean; - public rendered: boolean; - public data: Object; - public component: any; - public error: string; - public tooltip: string; - public row: any; - public pristine: boolean; - public parent: any; - public root: any; - public lastChanged: any; - public triggerRedraw: Function; - public tooltips: any[]; - public invalid: boolean; - public isBuilt: boolean; - readonly ready: any; - readonly labelInfo: any; - init(): void; - destroy(): void; - readonly shouldDisabled: any | boolean; - readonly isInputComponent: boolean; - readonly defaultSchema: ComponentSchema; - readonly hasInput: boolean; - readonly key: any; - public parentVisible: any | boolean; - public parentDisabled: any | boolean; - public visible: any | boolean; - public currentForm: any; - readonly fullMode: boolean; - readonly builderMode: boolean; - getModifiedSchema( - schema: ExtendedComponentSchema, - defaultSchema: ComponentSchema, - recursion: boolean, - ): ExtendedComponentSchema; - readonly schema: ExtendedComponentSchema; - t(text: string, params?: Object): any; - labelIsHidden(): boolean; - readonly transform: any; - getTemplate(names: any, modes: any): any; - checkTemplate(templates: any, names: any, modes: any): any; - checkTemplateMode(templatesByName: any, modes: any): any; - renderTemplate(name: any, data: any, modeOption?: any[]): any; - sanitize(dirty: string): any; - renderString(template: any, data: any): HTMLElement; - performInputMapping(input: any): any; - getBrowserLanguage(): string | null; - beforeNext(): any; - beforePage(): any; - beforeSubmit(): any; - readonly submissionTimezone: string | any; - readonly canDisable: boolean; - loadRefs(element: any, refs: any): any; - build(element: any): any; - render(children: any, topLevel?: boolean): any; - attach(element: any): any; - addShortcut(element: any, shortcut: any): void; - removeShortcut(element: any, shortcut: any): void; - detach(): void; - attachRefreshEvent(refreshData: any): void; - attachRefreshOn(): void; - refresh(value: any): void; - inContext(component: any): boolean; - readonly viewOnly: boolean | any; - createViewOnlyElement(): HTMLElement; - readonly defaultViewOnlyValue: '-'; - getValueAsString(value: any): string; - getView(value: any): string; - updateItems(...args: any[]): void; - createModal(): HTMLElement; - readonly className: string; - readonly customStyle: string; - getElement(): HTMLElement; - evalContext(additional: any): any; - setPristine(pristine: boolean): void; - removeValue(index: number): void; - iconClass(name: any, spinning: any): any; - readonly name: string; - readonly errorLabel: string; - errorMessage(type: any): any; - setContent(element: any, content: any): boolean; - redraw(): any; - rebuild(): any; - removeEventListeners(): void; - hasClass(element: any, className: string): any; - addClass(element: any, className: string): any; - removeClass(element: any, className: string): any; - hasCondition(): boolean; - conditionallyVisible(data: any): boolean; - checkCondition(row: any, data: Object): boolean; - checkConditions(data: any): any; - readonly logic: any[]; - fieldLogic(data: any): any; - applyActions(actions: any[], result: any, data: any, newComponent: any): boolean; - addInputError(message: any, dirty: boolean): void; - clearOnHide(show: boolean): void; - onChange(flags: Object, fromRoot: boolean): void; - readonly wysiwygDefault: { - theme: string; - placeholder: any | string; - modules: { - clipboard: { - matchVisual: boolean; - }; - toolbar: any[]; - }; - }; - addCKE(element: HTMLElement | any, settings: Object, onChange: (input: any) => any): any; - addQuill(element: HTMLElement | any, settings: Object, onChange: (input: any) => any): any; - addAce(element: HTMLElement | any, settings: Object, onChange: (input: any) => any): any; - readonly emptyValue: null; - hasValue(data: Object): boolean; - readonly rootValue: any; - readonly rootPristine: any; - public dataValue: any; - splice(index: number | string): void; - deleteValue(): void; - readonly defaultValue: any; - getValue(): any; - getValueAt(index: number): any; - setValue(value: any, flags: any): boolean; - setValueAt(index: number, value: any, flags: any): void; - readonly hasSetValue: boolean; - restoreValue(): void; - normalizeValue(value: any): any; - getIcon(name: any | string, content: any, styles: any, ref?: string): any | HTMLElement; - resetValue(): void; - hasChanged(before: any, after: any): boolean; - updateOnChange(flags: any, changed: boolean | any): boolean; - calculateValue(data: Object, flags: any): boolean; - public label: any | string; - getRoot(): Component; - invalidMessage(data: any, dirty: boolean, ignoreCondition?: boolean): any; - isValid(data: any, dirty: boolean): boolean; - checkValidity(data: any, dirty: any | boolean, rowData: any): boolean; - readonly validationValue: any; - isEmpty(value: any): boolean; - validateMultiple(): boolean; - readonly errors: any[]; - setCustomValidity(message: any, dirty: any): void; - shouldSkipValidation(data: any, dirty: any, rowData: any): boolean; - whenReady(): any | Promise; - readonly dataReady: any | Promise; - asString(value: any): string; - public disabled: boolean; - setDisabled(element: any, disabled: any | boolean): void; - setLoading(element: any, loading: any | boolean): void; - selectOptions(select: any, tag: any, options: any, defaultValue: any): void; - setSelectValue(select: any, value: any): void; - clear(): any; - append(element: HTMLElement): void; - prepend(element: HTMLElement): void; - removeChild(element: HTMLElement): void; - attachLogic(): void; - elementInfo(): ElementInfo; - autofocus(): void; - focus(): void; - readonly shouldDisable: boolean; - readonly info: ElementInfo; - public element: any; - public validators: (keyof ValidateOptions)[]; - public calculatedValue: any; - public options: any; - public labelElement: any; -} diff --git a/types/components/_classes/componentmodal/componentmodal.d.ts b/types/components/_classes/componentmodal/componentmodal.d.ts deleted file mode 100644 index 9c6b65ab14..0000000000 --- a/types/components/_classes/componentmodal/componentmodal.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Component } from '../component/component'; - -export class ComponentModal { - constructor(component: Component | any, element: any, isOpened: boolean, currentValue: any); - public isOpened: boolean; - public component: Component | any; - public element: any; - public currentValue: any; - public dataLoaded: boolean; - static render(component: Component | any, data: any, topLevel: boolean): any; - readonly refs: any; - init(): void; - setValue(value: any): any; - setOpenModalElement(template: string): void; - readonly templateRefs: any; - loadRefs(): void; - removeEventListeners(): void; - setEventListeners(): void; - isValueChanged(): boolean; - setOpenEventListener(): void; - openModalHandler(event: Event): void; - positionOverElement(): void; - openModal(): void; - updateView(): void; - closeModal(): void; - closeModalHandler(event: Event): void; - showDialog(): void; - closeDialog(event: Event): void; - saveDialog(event: Event): void; - saveModalValueHandler(event: Event): void; -} diff --git a/types/components/_classes/field/field.d.ts b/types/components/_classes/field/field.d.ts deleted file mode 100644 index 25590c4f6a..0000000000 --- a/types/components/_classes/field/field.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Component } from '../component/component'; - -export class Field extends Component { - render(element: any): any; -} diff --git a/types/components/_classes/input/input.d.ts b/types/components/_classes/input/input.d.ts deleted file mode 100644 index a49179abab..0000000000 --- a/types/components/_classes/input/input.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Component } from '../component/component'; -import { Multivalue } from '../multivalue/multivalue'; -import { Element } from './../../../element.d'; - -export class Input extends Multivalue { - constructor(component: Component | any, options: Object, data: any); - readonly inputInfo: { - id: string | number; - type: string; - changeEvent: string; - content?: any; - attr: any; - }; - readonly maskOptions: { label: any; value: any }[]; - readonly isMultipleMasksField: boolean; - getMaskByName(maskName: string): any; - setInputMask(input: any, inputMask: any): any; - getMaskOptions(): { label: any; value: any }[]; - readonly remainingWords: number; - renderElement(value: any, index: string | number): any; - setCounter(type: string, element: any | Element, count: number, max: number): void; - updateValueAt(value: any, flags: any, index: string | number): void; - getValueAt(index: string | number): any; - updateValue(value: any, flags: any, index: string | number): any; - attach(element: any): any; - attachElement(element: any | Element, index: string | number): void; - readonly widget: any; - createWidget(index: string | number): any; - addFocusBlurEvents(element: any | Element): void; -} diff --git a/types/components/_classes/multivalue/multivalue.d.ts b/types/components/_classes/multivalue/multivalue.d.ts deleted file mode 100644 index 7e700d46c3..0000000000 --- a/types/components/_classes/multivalue/multivalue.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Field } from '../field/field'; - -export class Multivalue extends Field { - public dataValue: any; - readonly defaultValue: any; - readonly addAnother: any; - useWrapper(): boolean; - renderRow(value: any, index: any): any; - attach(dom: any): any; - attachElement(element: any, index: number | string): any; - onSelectMaskHandler(event: any): void; - tryAttachMultipleMasksInput(): boolean; - updateMask(input: any, mask: any): void; - addNewValue(value: any): void; - addValue(): void; -} diff --git a/types/components/_classes/nested/nestedComponent.d.ts b/types/components/_classes/nested/nestedComponent.d.ts deleted file mode 100644 index c73ff4299d..0000000000 --- a/types/components/_classes/nested/nestedComponent.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Field } from '../field/field'; -import { Component } from './../component/component.d'; - -export class NestedComponent extends Field { - constructor(component: any | Component, options: Object, data: any); - readonly defaultSchema: any; - readonly schema: any; - public collapsed: any | boolean; - public visible: any | boolean; - public parentVisible: boolean; - public disabled: boolean; - public parentDisabled: any | boolean; - readonly ready: any; - public currentForm: any; - public data: any; - getComponents(): any[] | Component[]; - getAllComponents(): any[] | Component[]; - everyComponent(fn: Function): void; - flattenComponents(): Object; - eachComponent(fn: Function): void; - getComponent(path: string, fn: Function): Object; - getComponentById(id: string, fn: Function): Object; - createComponent(component: any | Component, options: Object, data: any, before: any): any | Object; - getContainer(): any; - readonly componentComponents: any[]; - readonly nestedKey: string; - readonly templateName: string; - init(): void; - addComponents(data: any, options: Object): void; - addComponent(component: any, data: Object, before: HTMLElement, noAdd?: any): Component; - render(children: any): any; - renderComponents(components: any): any; - attach(element: any): any; - attachComponents(element: any, components: any | Component[], container: any): any; - removeComponent(component: Component, components: Component[]): any; - removeComponentByKey(key: string, fn: Function): null; - removeComponentById(id: string, fn: Function): null; - updateValue(value: any, flags: any, source: any): any; - hasChanged(): boolean; - checkData(data: any, flags: any, source: any): boolean; - checkModal(isValid: boolean, dirty: boolean): void; - checkConditions(data: any, norecurse?: any): any; - clearOnHide(show: boolean): void; - restoreComponentsContext(): void; - beforePage(next?: any): any; - beforeSubmit(): any; - calculateValue(data: any, flags: any): any; - isLastPage(): boolean; - isValid(data: any, dirty: any): boolean; - checkValidity(data: any, dirty: any): any | boolean; - setPristine(pristine: any): void; - detach(): void; - destroy(): void; - destroyComponents(): void; - readonly errors: any[]; - getValue(): any; - resetValue(): void; - readonly dataReady: any; - setNestedValue(component: any | Component, value: any, flags: any | Object, changed: boolean): any; - setValue(value: any, flags: any | Object): boolean; -} diff --git a/types/components/_classes/widgetcomponent/widgetComponent.d.ts b/types/components/_classes/widgetcomponent/widgetComponent.d.ts deleted file mode 100644 index daffa44f94..0000000000 --- a/types/components/_classes/widgetcomponent/widgetComponent.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Input } from '../input/input'; - -export class WidgetComponent extends Input { - readonly widgetLocale: any; - readonly widgetData: any; -} diff --git a/types/components/components.d.ts b/types/components/components.d.ts deleted file mode 100644 index 9bdb2a5399..0000000000 --- a/types/components/components.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { ExtendedComponentSchema } from './schema'; -import { Component } from './_classes/component/component'; -import { ComponentModal } from './_classes/componentmodal/componentmodal'; -import { Field } from './_classes/field/field'; -import { Input } from './_classes/input/input'; -import { Multivalue } from './_classes/multivalue/multivalue'; -import { NestedComponent } from './_classes/nested/nestedComponent'; -import { WidgetComponent } from './_classes/widgetcomponent/widgetComponent'; - -type ClassWithEditForm = C & { editForm: () => { components: ExtendedComponentSchema[] } }; - -export namespace Components { - function setComponents(comps: Object): void; - function setComponent(name: string, comp: Object): void; - function addComponent(name: string, comp: Object): void; - function create(component: any, options: Object, data?: any, flag?: any): Object; - let baseEditForm: any; - let EditFormUtils: any; - namespace components { - class base extends Component {} - class componentmodal extends ComponentModal {} - class input extends Input {} - class nested extends NestedComponent {} - class multivalue extends Multivalue {} - class field extends Field {} - - const address: ClassWithEditForm; - const button: ClassWithEditForm; - const checkbox: ClassWithEditForm; - const columns: ClassWithEditForm; - const container: ClassWithEditForm; - const content: ClassWithEditForm; - const currency: ClassWithEditForm; - const datagrid: ClassWithEditForm; - const datamap: ClassWithEditForm; - const datetime: ClassWithEditForm; - const day: ClassWithEditForm; - const editgrid: ClassWithEditForm; - const email: ClassWithEditForm; - const fieldset: ClassWithEditForm; - const file: ClassWithEditForm; - const form: ClassWithEditForm; - const hidden: ClassWithEditForm; - const htmlelement: ClassWithEditForm; - const number: ClassWithEditForm; - const panel: ClassWithEditForm; - const password: ClassWithEditForm; - const phoneNumber: ClassWithEditForm; - const radio: ClassWithEditForm; - const recaptcha: ClassWithEditForm; - const resource: ClassWithEditForm; - const select: ClassWithEditForm; - const selectboxes: ClassWithEditForm; - const signature: ClassWithEditForm; - const sketchpad: ClassWithEditForm; - const survey: ClassWithEditForm; - const table: ClassWithEditForm; - const tabs: ClassWithEditForm; - const tagpad: ClassWithEditForm; - const tags: ClassWithEditForm; - const textarea: ClassWithEditForm; - const textfield: ClassWithEditForm; - const time: ClassWithEditForm; - const tree: ClassWithEditForm; - const unknown: ClassWithEditForm; - const url: ClassWithEditForm; - const well: ClassWithEditForm; - } -} diff --git a/types/components/schema.d.ts b/types/components/schema.d.ts deleted file mode 100644 index fc3b2e7186..0000000000 --- a/types/components/schema.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -export interface ComponentSchema { - /** - * The type of component - */ - type?: string; - - /** - * The data key for this component (how the data is stored in the database, referenced as API key in docs). - */ - key?: string; - - /** - * The HTML label to give this component. - */ - label?: string; - - /** - * The input placeholder for this component. - */ - placeholder?: string; - - /** - * Determines if this component provides an input. - */ - input?: boolean; - - /** - * If this component should be included as a column within a submission table. - * Determines if this field will show in the data tables output. - */ - tableView?: boolean; - - /** - * If this component should allow an array of values to be captured. - */ - multiple?: boolean; - - /** - * If the data of this component should be protected (no GET api requests can see the data) - */ - protected?: boolean; - - /** - * The prefix text to put in front of the input - */ - prefix?: string; - - /** - * The suffix text to put after the input - */ - suffix?: string; - - /** - * The default value of this compoennt. - */ - defaultValue?: T; - - /** - * If the value of this field should be cleared when it is conditionally hidden. - */ - clearOnHide?: boolean; - - /** - * Validate if the value of this component should be unique within the form. - */ - unique?: boolean; - - /** - * If the value of this component should be persisted within the backend api database. - */ - persistent?: boolean; - - /** - * Determines if the component should be within the form, but not visible. - * This can be overridden with the conditionals. - */ - hidden?: boolean; - - /** - * The validation criteria for this component. - */ - validate?: ValidateOptions; - - /** - * Determines when this component should be added to the form for both processing and input. - */ - conditional?: ConditionalOptions; - - /** - * Allows customizable errors to be displayed for each component when an error occurs. This is an object with the following keys: - required - min - max - minLength - maxLength - invalid_email - invalid_date - pattern - custom - - An object (keys listed above), values are the strings you wish to display. Each string has the {{ field }} to use within the string. Example. - {"required": "{{ field }} is required. Try again."} - */ - errors?: Object; - - /** - * Allows changing the component definition in reaction to data entered in a form. For example, changing a field to required, disabled or hidden when a value is entered. - An array of instances of the Field Logic Schema - Fyi: https://github.com/formio/formio.js/wiki/Field-Logic-Schema - */ - logic?: Object[]; - - /** - * The custom CSS class to provide to this component. - */ - customClass?: string; - - /** - * If true, will show label when component is in a datagrid. - */ - dataGridLabel?: boolean; - - labelPosition?: 'top' | 'bottom' | 'left' | 'right'; - labelWidth?: number; - labelMargin?: number; - description?: string; - errorLabel?: string; - tooltip?: string; - hideLabel?: boolean; - tabindex?: string; - disabled?: boolean; - autofocus?: boolean; - dbIndex?: boolean; - customDefaultValue?: any; - calculateValue?: any; - allowCalculateOverride?: boolean; - widget?: any; // Input widgets i.e. calendar widget - - /** - * This will refresh this component when this field changes. - */ - refreshOn?: string; - - /** - * Determines if we should clear our value when a refresh occurs. - */ - clearOnRefresh?: boolean; - - /** - * This will perform the validation on either "change" or "blur" of the input element. - */ - validateOn?: 'change' | 'blur'; -} - -export type ExtendedComponentSchema = ComponentSchema & { [key: string]: any }; - -export interface ConditionalOptions { - /** If the field should show if the condition is true */ - show?: boolean; - /** The field API key that it should compare its value against to determine if the condition is triggered. */ - when?: string; - /** The value that should be checked against the comparison component */ - eq?: string; - /** The JSON Logic to determine if this component is conditionally available. - * Fyi: http://jsonlogic.com/ - */ - json?: Object; -} - -export interface ValidateOptions { - /** - * If this component is required. - */ - required?: boolean; - - /** - * For text input, this checks the minimum length of text for valid input - */ - minLength?: number; - - /** - * For text input, this checks the maximum length of text for valid input - */ - maxLength?: number; - - /** - * For text input, this checks the text agains a Regular expression pattern. - */ - pattern?: string; - - /** - * A custom javascript based validation or a JSON object for using JSON Logic - */ - custom?: any; - - /** - * If the custom validation should remain private (only the backend will see it and execute it). - */ - customPrivate?: boolean; - - /** - * Minimum value for numbers - */ - min?: number; - - /** - * Maximum value for numbers - */ - max?: number; - - minSelectedCount?: number; - maxSelectedCount?: number; - minWords?: number; - maxWords?: number; - email?: boolean; - url?: boolean; - date?: boolean; - day?: boolean; - json?: string; - mask?: boolean; - minDate?: any; - maxDate?: any; -} - -export interface ElementInfo { - type: string; - component: ExtendedComponentSchema; - changeEvent: string; - attr: any; - content: string; -} - -export interface BuilderInfo { - title: string; - group: string; - icon: string; - documentation?: string; - weight?: number; - schema?: ExtendedComponentSchema; -} diff --git a/types/displays.d.ts b/types/displays.d.ts deleted file mode 100644 index 4585dff10f..0000000000 --- a/types/displays.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class Displays { - static readonly displays: any; - static addDisplay(name: string, display: any): void; - static addDisplays(name: string, display: any): void; - static getDisplay(name: string): any; - static getDisplays(name: string): any; -} diff --git a/types/element.d.ts b/types/element.d.ts deleted file mode 100644 index 3419ce9537..0000000000 --- a/types/element.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { EventEmitter } from './eventEmitter.d'; - -export class Element { - options: Object; - id: string; - eventHandlers: any[]; - i18next: any; - events: EventEmitter; - defaultMask: any; - inputMasks: any[]; - constructor(options: any); - on(event: string, cb: Function, internal: boolean, once?: boolean): any; - once(event: string, cb: Function, internal: boolean): any; - onAny(cb: Function): any; - off(event: string): void; - emit(event: string, data: Object): void; - addEventListener(obj: HTMLElement, type: string, func: Function, persistent?: boolean): any; - removeEventListener(obj: Object, type: any): any; - removeEventListeners(): void; - removeAllEvents(includeExternal: boolean): void; - destroy(): void; - appendTo(element: HTMLElement, container: HTMLElement): any; - prependTo(element: HTMLElement, container: HTMLElement): any; - removeChildFrom(element: HTMLElement, container: HTMLElement): any; - ce(type: string, attr?: Object, children?: HTMLElement | string | Array): HTMLElement; - appendChild(element: any, child: any): any; - maskPlaceholder(mask: HTMLElement): string; - setInputMask(input: HTMLElement, inputMask: string, placeholder: boolean): void; - t(text: string, params?: Object): string; - text(text: string): Text; - attr(element: HTMLElement, attr: Object): void; - hasClass(element: HTMLElement | any, className: string): boolean; - addClass(element: HTMLElement, className: string): any; - removeClass(element: HTMLElement, className: string): any; - empty(element: HTMLElement): void; - evalContext(additional: any): any; - interpolate(string: any, data: any): any; - evaluate( - func: any, - args: { component: any; form: any; instance: any; row: any; data: any } | any, - ret: any, - tokenize?: any, - ): any; - hook(...args: any[]): any; -} diff --git a/types/eventEmitter.d.ts b/types/eventEmitter.d.ts deleted file mode 100644 index 6b95e0a09f..0000000000 --- a/types/eventEmitter.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class EventEmitter /* extends EventEmitter3 */ { - constructor(conf: Object); -} diff --git a/types/form.d.ts b/types/form.d.ts deleted file mode 100644 index c7652f44b4..0000000000 --- a/types/form.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Element } from './element'; - -export class Form extends Element { - form: any; - instance: any; - ready: Promise; - constructor(...args: any[]); - create(display: 'wizard' | 'form' | 'pdf'): any; - setForm(formParam: any): any; - setDisplay(display: any): any; - empty(): void; - render(): any | Promise; - static embed(element: any): any; - sanitize(dirty: string): any; - setContent(element: any, content: any): boolean; - build(): Promise; - attach(element: any): any | Promise; -} diff --git a/types/formbuilder.d.ts b/types/formbuilder.d.ts deleted file mode 100644 index 745d31527e..0000000000 --- a/types/formbuilder.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Form } from './form'; - -export class FormBuilder extends Form { - constructor(element: any, form: any, options: any); - create(display: string): any; -} diff --git a/types/formio.d.ts b/types/formio.d.ts deleted file mode 100644 index 91266641d9..0000000000 --- a/types/formio.d.ts +++ /dev/null @@ -1,121 +0,0 @@ -export class Formio { - constructor(url: string, options?: Object); - public base: string; - public projectsUrl: string; - public projectUrl: string; - public projectId: string; - public formId: string; - public submissionId: string; - public actionsUrl: string; - public actionId: string; - public actionUrl: string; - public vsUrl: string; - public vId: string; - public vUrl: string; - public query: string; - public formUrl?: string; - public formsUrl?: string; - public submissionUrl?: string; - public submissionsUrl?: string; - public token: any | string; - static libraries: any; - static Promise: any; - static fetch: any; - static Headers: any; - static baseUrl: string; - static projectUrl: string; - static authUrl: string; - static projectUrlSet: boolean; - static plugins: any; - static cache: any; - static license: string; - static providers: any; - static events: any; // EventEmitter3 - static namespace: string; - static formOnly?: boolean; - static rulesEntities: any; - static options: any; - delete(type: any, opts?: any): any; - index(type: any, query?: any, opts?: any): any; - save(type: any, data: any, opts?: any): any; - load(type: any, query?: any, opts?: any): any; - makeRequest(...args: any[]): any; - loadProject(query?: any, opts?: any): any; - saveProject(data: any, opts?: any): any; - deleteProject(opts?: any): any; - static loadProjects(query?: any, opts?: any): any; - static createForm(element: any, form: string | Object, options?: Object): Promise; - static setBaseUrl(url: string): void; - static setProjectUrl(url: string): void; - static setAuthUrl(url: string): void; - static getToken(options?: any): any; - static makeStaticRequest(url: string, method?: string, data?: any, opts?: Object): any; - static makeRequest(formio?: Formio, type?: string, url?: string, method?: string, data?: any, opts?: Object): any; - static currentUser(formio?: Formio, options?: Object): any; - static logout(formio?: Formio, options?: Object): any; - static clearCache(): void; - static setUser(user: any, opts?: Object): any; - loadForm(query?: any, opts?: Object): any; - loadForms(query?: any, opts?: Object): any; - loadSubmission(query?: any, opts?: Object): any; - loadSubmissions(query?: any, opts?: Object): any; - userPermissions( - user?: any, - form?: any, - submission?: any, - ): Promise<{ create: boolean; read: boolean; edit: boolean; delete: boolean }>; - createform(form: Object): Promise; - saveForm(data: any, opts?: Object): any; - saveSubmission(data: any, opts?: Object): any; - deleteForm(opts?: Object): any; - deleteSubmission(opts?: Object): any; - saveAction(data: any, opts?: any): any; - deleteAction(opts?: any): any; - loadAction(query?: any, opts?: any): any; - loadActions(query?: any, opts?: any): any; - availableActions(): any; - actionInfo(name: any): any; - isObjectId(id: any): any; - getProjectId(): any; - getFormId(): any; - currentUser(options?: Object): any; - accessInfo(): any; - getToken(options?: Object): any; - setToken(token: any, options?: Object): any; - getTempToken(expire: any, allowed: any, options?: Object): any; - getDownloadUrl(form: any): any; - uploadFile(storage: any, file: any, fileName: any, dir: any, progressCallback: any, url: any, options?: Object): any; - downloadFile(file: any, options?: Object): any; - canSubmit(): any; - getUrlParts(url: any): any; - static use(plugin: any): any; - static getUrlParts(url: any, formio?: Formio): any; - static serialize(obj: any, _interpolate: any): any; - static getRequestArgs(formio: Formio, type: string, url: string, method?: string, data?: any, opts?: any): any; - static request(url: any, method?: any, data?: any, header?: any, opts?: any): any; - static setToken(token: string, opts?: any): any; - static getUser(options?: Object): any; - static getBaseUrl(): string; - static setApiUrl(url: string): any; - static getApiUrl(): any; - static setAppUrl(url: string): any; - static getAppUrl(): any; - static getProjectUrl(): any; - static noop(): any; - static identity(value: any): any; - static deregisterPlugin(plugin: any): any; - static registerPlugin(plugin: any, name: string): any; - static getPlugin(name: any | string): any; - static pluginWait(pluginFn: any, ...args: any[]): any; - static pluginGet(pluginFn: any, ...args: any[]): any; - static pluginAlter(pluginFn: any, value: any, ...args: any[]): any; - static accessInfo(formio?: Formio): any; - static pageQuery(): any; - static oAuthCurrentUser(formio?: Formio, token?: any): any; - static samlInit(options?: Object): any; - static oktaInit(options?: Object): any; - static ssoInit(type: any, options?: Object): any; - static requireLibrary(name: any, property: any, src: any, polling?: boolean): any; - static libraryReady(name: string): any; - oauthLogoutURI(uri: string, options?: any): any; -} diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index c773e5f64b..0000000000 --- a/types/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './components/components'; -export * from './components/schema'; -export * from './form'; -export * from './formbuilder'; -export * from './formio'; -export * from './templates'; -export * from './displays'; -export * from './widgets'; -export * from './utils'; -export * from './builders'; -export * from './rulesEngine/conjunctions'; -export * from './rulesEngine/operators'; -export * from './rulesEngine/quckRules'; -export * from './rulesEngine/rules'; -export * from './rulesEngine/transformers'; -export * from './rulesEngine/valueSources'; -export * from './providers'; -export * from './licenses'; diff --git a/types/licenses.d.ts b/types/licenses.d.ts deleted file mode 100644 index a9ed473be2..0000000000 --- a/types/licenses.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class Licenses { - static readonly licenses: any; - static addLicense(name: string, license: any): void; - static removeLicense(name: string): void; - static getLicense(name: string): any; - static getLicenses(): any; -} diff --git a/types/providers.d.ts b/types/providers.d.ts deleted file mode 100644 index 39392df3fd..0000000000 --- a/types/providers.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export class Providers { - static readonly providers: any; - static addProvider(type: string, name: string, provider:any): void; - static addProviders(type:string, providers: any): void; - static getProvider(type: string, name: string): any; - static getProviders(type: string): any; -} - diff --git a/types/rulesEngine/conjunctions.d.ts b/types/rulesEngine/conjunctions.d.ts deleted file mode 100644 index 0fa8ef07fa..0000000000 --- a/types/rulesEngine/conjunctions.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class Conjunctions { - static readonly conjunctions: any; - static addConjunction(name: string, conjunction: any): void; - static addConjunctions(conjunctions: any): void; - static getConjunction(name: string): any; - static getConjunctions(): any; -} diff --git a/types/rulesEngine/operators.d.ts b/types/rulesEngine/operators.d.ts deleted file mode 100644 index 0205a1c3b0..0000000000 --- a/types/rulesEngine/operators.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class Operators { - static readonly operators: any; - static addOperator(name: string, conjunction: any): void; - static addOperators(conjunctions: any): void; - static getOperator(name: string): any; - static getOperators(): any; -} diff --git a/types/rulesEngine/quckRules.d.ts b/types/rulesEngine/quckRules.d.ts deleted file mode 100644 index 4dc7a5f8d0..0000000000 --- a/types/rulesEngine/quckRules.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class QuickRules { - static readonly quickRules: any; - static addQuickRule(name: string, conjunction: any): void; - static addQuickRules(conjunctions: any): void; - static getQuickRule(name: string): any; - static getQuickRules(): any; -} diff --git a/types/rulesEngine/rules.d.ts b/types/rulesEngine/rules.d.ts deleted file mode 100644 index 567f0f6934..0000000000 --- a/types/rulesEngine/rules.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class Rules { - static readonly rules: any; - static addRule(name: string, conjunction: any): void; - static addRules(conjunctions: any): void; - static getRule(name: string): any; - static getRules(): any; -} diff --git a/types/rulesEngine/transformers.d.ts b/types/rulesEngine/transformers.d.ts deleted file mode 100644 index b516fc86b9..0000000000 --- a/types/rulesEngine/transformers.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class Transformers { - static readonly transformers: any; - static addTransformer(name: string, conjunction: any): void; - static addTransformers(conjunctions: any): void; - static getTransformer(name: string): any; - static getTransformers(): any; -} diff --git a/types/rulesEngine/valueSources.d.ts b/types/rulesEngine/valueSources.d.ts deleted file mode 100644 index 8f0227585c..0000000000 --- a/types/rulesEngine/valueSources.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class ValueSources { - static readonly valueSources: any; - static addValueSource(name: string, conjunction: any): void; - static addValueSources(conjunctions: any): void; - static getValueSource(name: string): any; - static getValueSources(): any; -} diff --git a/types/templates.d.ts b/types/templates.d.ts deleted file mode 100644 index 296fe6541c..0000000000 --- a/types/templates.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export class Templates { - static readonly templates: any; - static addTemplate(name: string, template: any): void; - static setTemplate(name: string, template: any): void; - static current: any; - static readonly defaultTemplates: any; - static framework: any; -} diff --git a/types/utils.d.ts b/types/utils.d.ts deleted file mode 100644 index 7bbaa15ca7..0000000000 --- a/types/utils.d.ts +++ /dev/null @@ -1,157 +0,0 @@ -import * as moment from 'moment'; - -export type AnyForJSON = { [key: string]: any } | any; - -export namespace Utils { - const ConditionOperators: any; - const componentValueTypes: { [key: string]: string }; - const Evaluator: any; - const _: any; - function getComponentSavedTypes(schema: object): Array | null; - function evaluate( - func: any, - args: { component: any; form: any; instance: any; row: any; data: any } | any, - ret: any, - tokenize?: any, - ): any; - function getRandomComponentId(): string; - function getPropertyValue(style: CSSStyleDeclaration, prop: string): number; - function getElementRect(element: any): { x: number; y: number; width: number; height: number }; - function boolValue(value: boolean | string): boolean; - function isMongoId(text: any): any; - function checkCalculated(component: { calculateValue?: any; key: any } | any, submission: any, rowData: any): void; - function checkSimpleConditional( - component: any /* unused */, - condition: { eq: any; show: any; when: any } & any, - row: any, - data: any, - instance: any - ): boolean; - function checkCustomConditional( - component: any /* unused */, - custom: string | any, - row: any, - data: any, - form: any, - variable: any, - onError: any, - instance: { evaluate?: any } | any, - ): any; - function checkJsonConditional( - component: { key: string | any } | any, - json: AnyForJSON, - row: any, - data: any, - form: any, - onError: any, - ): any; - function checkCondition( - component: { customConditional: any; conditional: { when: any; json: AnyForJSON } } | any, - row: any, - data: any, - form: any, - instance: any, - ): boolean; - function checkTrigger( - component: any, - trigger: { type: string; simple: any; json: AnyForJSON; javascript: any } | any, - row: any, - data: any, - form: any, - instance: any, - ): boolean | any; - function setActionProperty( - component: any, - action: { property: { type: string | any; value: any } | any; state: boolean | any; text: any }, - row: any, - data: any, - result: any, - instance?: { interpolate: (textValue: any, evalData: any) => any | any }, - ): any; - function interpolateTemplate(template: string): any; - function addTemplateHash(template: string): number; - function interpolate(rawTemplate: number | string, data: any): any; - function uniqueName(name: string, template: string, evalContext: Object): string; - function guid(): string; - function getDateSetting(date: any): null | Date; - function isValidDate(date: any): boolean; - function currentTimezone(): string; - function offsetDate(date: Date, timezone: string): { date: Date; abbr: string }; - function zonesLoaded(): boolean; - function shouldLoadZones(timezone: string): boolean; - function loadZones(timezone?: string): Promise; - function momentDate(value: moment.MomentInput, format: string, timezone: string): moment.Moment; - function formatDate(value: moment.MomentInput, format: string, timezone: string): string; - function formatOffset( - formatFn: (date: any, format: any) => string, - date: Date | any, - format: string | any, - timezone: string, - ): string; - function getLocaleDateFormatInfo(locale: string | string[]): { dayFirst: boolean }; - function convertFormatToFlatpickr(format: string): string; - function convertFormatToMoment(format: string): string; - function convertFormatToMask(format: string): string; - function getInputMask(mask: string | RegExp[]): RegExp[]; - function matchInputMask(value: string | RegExp, inputMask?: string | RegExp): boolean; - function getNumberSeparators(lang: string): { delimiter: string; decimalSeparator: string }; - function getNumberDecimalLimit(component: any): number; - function getCurrencyAffixes(input: { - currency: string; - decimalLimit: number; - decimalSeparator: string; - lang: string | string[]; - }): { prefix: string; suffix: string }; - function fieldData(data: Object, component: { key: string | any[]; multiple: boolean | any } | any): any; - function delay(fn: Function, delay: number, args: any[]): any; - function iterateKey(key: string): string; - function uniqueKey(map: Object, base: string): string; - function bootstrapVersion(options: { bootstrap?: any } | any): number; - function unfold(e: any): any; - const firstNonNil: any; - function withSwitch(a: any, b: any): [Function, Function]; - function observeOverload(callback: Function, options?: { limit?: number; delay?: number }): any; - function getContextComponents(context: any, excludeNested?: any, excludedTypes?: any): any; - function sanitize(string: string, options: any): any; - - // Form Utils - function isLayoutComponent(component: { columns: any; rows: any; components: any } | any): boolean; - function eachComponent(components: any[], fn: Function, includeAll?: boolean, path?: string, parent?: Object): any; - function matchComponent(component: any, query: any): boolean; - function getComponent(components: any[], key: string | Object | any, includeAll: boolean): any; - function searchComponents(components: any[], query: any): any; - function findComponent(components: any[], key: any, path: any, fn: Function): boolean; - function removeComponent(components: any[], path: any): void; - function fastCloneDeep(json: any): any; - function generateFormChange( - type: string | any, - data: { schema: any; parent: { key: any } | any; originalComponent: any }, - ): { - op: string; - key: any; - container?: any; - index?: number; - component?: any; - patches?: any; - }; - function applyFormChanges(form: any, changes: any[]): { form: any; failed: any[] }; - function flattenComponents(components: any[], includeAll: boolean): any; - function hasCondition(component: any): boolean; - function parseFloatExt(value: any): number; - function formatAsCurrency(value: any): string; - function escapeRegExCharacters(value: string): string; - function getValue(submission: any, key: string): any; - function getStrings( - form: { components: any[] } | any, - ): { key: any; type?: any; property: string; string: string | any }; - - // Builder Utils - namespace BuilderUtils { - function uniquify(container: any[], component: any): boolean; - const additionalShortcuts: { button: ['Enter', 'Esc'] }; - function getAlphaShortcuts(): string[]; - function getAdditionalShortcuts(type: string): string[]; - function getBindedShortcuts(components: any[], input: any): any[]; - function getAvailableShortcuts(form: { components: any[] } | any, component: { type: any } | any): string[]; - } -} diff --git a/types/widgets.d.ts b/types/widgets.d.ts deleted file mode 100644 index ad62c4446b..0000000000 --- a/types/widgets.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export class Widgets { - static readonly calendar: any; - static readonly input: any; -}