UNPKG

927 BPlain TextView Raw
1
2import Types from './index'
3
4/**
5 * A Component has no required function beyond the ones defined in IInfrastructure
6 *
7 */
8export interface IComponent {
9
10 /**
11 * A component can implement this function to insulate/hide the components of the specified from higher level
12 * components
13 *
14 * @param component the component that a higher level component wants to have
15 * @return true if the component does NOT want to provide its children to higher level components
16 */
17 insulatesChildComponent?: (component: any) => boolean
18}
19
20/**
21 * check whether the provided object serves as a client
22 *
23 * can be used in the parser, we get a real object here!
24 *
25 * @param parsedComponent
26 */
27export const isComponent = (parsedComponent): boolean => {
28 if (parsedComponent !== undefined) {
29 return parsedComponent.infrastructureType === Types.INFRASTRUCTURE_TYPE_COMPONENT
30 }
31
32 return false;
33};
34