form.vue.d.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { Arrayable } from "../../../utils/typescript.js";
  2. import { FormItemContext, FormValidateCallback, FormValidationResult } from "./types.js";
  3. import { FormItemProp } from "./form-item.js";
  4. import { FormProps } from "./form.js";
  5. import * as _$vue from "vue";
  6. //#region ../../packages/components/form/src/form.vue.d.ts
  7. declare var __VLS_1: {};
  8. type __VLS_Slots = {} & {
  9. default?: (props: typeof __VLS_1) => any;
  10. };
  11. declare const __VLS_base: _$vue.DefineComponent<FormProps, {
  12. /**
  13. * @description Validate the whole form. Receives a callback or returns `Promise`.
  14. */
  15. validate: (callback?: FormValidateCallback) => FormValidationResult;
  16. /**
  17. * @description Validate specified fields.
  18. */
  19. validateField: (props?: Arrayable<FormItemProp>, callback?: FormValidateCallback) => FormValidationResult;
  20. /**
  21. * @description Reset specified fields and remove validation result.
  22. */
  23. resetFields: (props?: Arrayable<FormItemProp>) => void;
  24. /**
  25. * @description Clear validation message for specified fields.
  26. */
  27. clearValidate: (props?: Arrayable<FormItemProp>) => void;
  28. /**
  29. * @description Scroll to the specified fields.
  30. */
  31. scrollToField: (prop: FormItemProp) => void;
  32. /**
  33. * @description Get a field context.
  34. */
  35. getField: (prop: FormItemProp) => FormItemContext | undefined;
  36. /**
  37. * @description All fields context.
  38. */
  39. fields: _$vue.Reactive<FormItemContext[]>;
  40. /**
  41. * @description Set initial values for form fields. When `resetFields` is called, fields will reset to these values.
  42. */
  43. setInitialValues: (initModel: Record<string, any>) => void;
  44. }, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {
  45. validate: (prop: FormItemProp, isValid: boolean, message: string) => void;
  46. }, string, _$vue.PublicProps, Readonly<FormProps> & Readonly<{
  47. onValidate?: ((prop: FormItemProp, isValid: boolean, message: string) => any) | undefined;
  48. }>, {
  49. labelWidth: string | number;
  50. labelPosition: "left" | "right" | "top";
  51. requireAsteriskPosition: "left" | "right";
  52. labelSuffix: string;
  53. showMessage: boolean;
  54. validateOnRuleChange: boolean;
  55. scrollIntoViewOptions: ScrollIntoViewOptions | boolean;
  56. }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
  57. declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
  58. declare const _default: typeof __VLS_export;
  59. type __VLS_WithSlots<T, S> = T & {
  60. new (): {
  61. $slots: S;
  62. };
  63. };
  64. //#endregion
  65. export { _default as default };