UNPKG

1.01 kBTypeScriptView Raw
1import * as React from 'react';
2
3import Types from '../types';
4import { IComponent } from "../types/component";
5import { IInfrastructure } from "../types";
6
7export const DATALAYER_INSTANCE_TYPE = "DataLayerComponent";
8
9
10/**
11 * Arguments provided by the user
12 */
13export interface IDataLayerArgs {
14
15}
16
17/**
18 * properties added programmatically
19 */
20export interface IDataLayerProps {
21
22}
23
24
25/**
26 * identifies a component as a DataLayer
27 *
28 * @param component to be tested
29 */
30export function isDataLayer(component) {
31 return component !== undefined &&
32 component.instanceType === DATALAYER_INSTANCE_TYPE
33}
34
35
36
37export default (props: IDataLayerArgs | any) => {
38
39 const componentProps: IInfrastructure & IComponent = {
40 infrastructureType: Types.INFRASTRUCTURE_TYPE_COMPONENT,
41 instanceType: DATALAYER_INSTANCE_TYPE,
42 instanceId: "props.name" //TODO
43 };
44
45 const datalayerProps: IDataLayerProps = {
46
47 }
48
49 return Object.assign(props, componentProps, datalayerProps);
50
51
52};
\No newline at end of file