/** * FileFormService class */ export class FileFormService { /** * Add form from a file * @param {string} filepath - the file path * @param {FormMetadata} metadata - the metadata to use for this form * @returns {Promise} */ addForm(filepath: string, metadata: FormMetadata): Promise; /** * Read the form definition from file * @param {string} filepath - the file path * @returns {Promise} */ readForm(filepath: string): Promise; /** * Read the form definition from a json file * @param {string} filepath - the file path * @returns {Promise} */ readJsonForm(filepath: string): Promise; /** * Read the form definition from a yaml file * @param {string} filepath - the file path * @returns {Promise} */ readYamlForm(filepath: string): Promise; /** * Get the form metadata by slug * @param {string} slug - the form slug * @returns {FormMetadata} */ getFormMetadata(slug: string): FormMetadata; /** * Get the form metadata by form id * @param {string} id - the form id * @returns {FormMetadata} */ getFormMetadataById(id: string): FormMetadata; /** * Get the form defintion by id * @param {string} id - the form id * @returns {FormDefinition} */ getFormDefinition(id: string): FormDefinition; /** * Returns a FormsService compliant interface * @returns {import('~/src/server/types.js').FormsService} */ toFormsService(): import("~/src/server/types.js").FormsService; #private; } import type { FormMetadata } from '@defra/forms-model'; import type { FormDefinition } from '@defra/forms-model';