@muban/muban
Version:
Writing components for server-rendered HTML
23 lines (22 loc) • 958 B
TypeScript
import type { PropTypeInfo } from '../propDefinitions.types';
declare type PossibleTypes = 'number' | 'string' | 'boolean' | 'date' | 'array' | 'object';
declare type MixedProptypeInfo = {
asForm: PropTypeInfo;
asInput: PropTypeInfo;
};
declare type FullPropTypeInfo = {
[key in PossibleTypes]: MixedProptypeInfo;
};
/**
* For a given form return an object containg two PropTypeInfo, one where the
* target is the form itself and one where the target is the form's child input
*
* Useful for testing value extraction for a form and it's child inputs
* @param {string} name prop info name
* @param {Element} targetElement target element
* @param {string} sourceName to be used as source.name
* @param {boolean } formData to be used as source.formData
* @returns {FullPropTypeInfo}
*/
export declare function getFullPropTypeInfo(name: string, targetElement: Element, sourceName?: string, formData?: boolean): FullPropTypeInfo;
export {};