UNPKG

979 BPlain TextView Raw
1
2import Types from './index'
3
4/**
5 * A Client is a component that produces its own webpack configuration
6 *
7 *
8 * it can run in webpack-hot-middleware-mode
9 * TODO extend respectively
10 */
11export interface IClient {
12 /**
13 * A client can implement this function to insulate/hide the components of the specified from higher level
14 * components
15 *
16 * @param component the component that a higher level component wants to have
17 * @return true if the component does NOT want to provide its children to higher level components
18 */
19 insulatesChildComponent?: (component: any) => boolean
20}
21
22/**
23 * check whether the provided object serves as a client
24 *
25 * can be used in the parser, we get a real object here!
26 *
27 * @param parsedComponent
28 */
29export const isClient = (parsedComponent): boolean => {
30 if (parsedComponent !== undefined) {
31 return parsedComponent.infrastructureType === Types.INFRASTRUCTURE_TYPE_CLIENT
32 }
33
34 return false;
35};
36