@lightweightform/theme-common
Version:
Common utilities for Lightweightform themes
31 lines (30 loc) • 1.46 kB
TypeScript
import { Path } from '@angular-devkit/core';
import { Tree } from '@angular-devkit/schematics';
import { SchemaExplorer } from './schema-explorer';
/**
* Returns the root schema for a given form.
* @param host Source tree.
* @param moduleDir Path of the module directory where the root schema should be
* found.
* @returns Path of the root schema.
*/
export declare function getRootSchemaPath(host: Tree, moduleDir: Path): Path;
/**
* Gets the parent storage path of a form's schema given its file path.
* @param schemaExplorer `SchemaExplorer` instance.
* @param schemaPath File path of the schema for which to find the parent
* storage path.
* @returns Storage path of the parent schema.
*/
export declare function getParentStoragePath(schemaExplorer: SchemaExplorer, schemaPath: Path): string;
/**
* Adds a schema as a field of its parent record schema.
* @param host Source tree.
* @param schemaExplorer `SchemaExplorer` instance.
* @param schemaPath File path of the schema being added.
* @param tsSchemaName Name of the identifier being imported in the parent
* schema.
* @param storagePathId Identifier to use for access in the storage.
* @param parentStoragePath Storage path of the parent record schema.
*/
export declare function addSchemaToParentSchema(host: Tree, schemaExplorer: SchemaExplorer, schemaPath: Path, tsSchemaName: string, storagePathId: string, parentStoragePath: string): void;