ProsperWorks/pw-app-sdk

View on GitHub
src/interfaces.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { ENTITY_TYPE, HTTP_METHOD } from './constant';

export enum UITarget {
  ActivityLog = 'ActivityLog',
  ListView = 'ListView',
  Related = 'Related',
}

export interface IContextMessageData {
  entityType: ENTITY_TYPE;
  entityData: object;
  editableFields: string[];
}

export interface IMessageData {
  type: string;
  error?: string;
  data?: any;
}

export interface IRefreshTargetMessage {
  name: UITarget;
  data?: any;
}

export interface IActionApiData {
  url: string;
  method?: HTTP_METHOD;
  data: object;
  target: IRefreshTargetMessage | null;
}

export interface IApiOptions {
  method?: HTTP_METHOD;
  body?: string;
}

export interface IPostMessageData {
  type: string;
  instanceId: string;
  version: string;
  params?: { [name: string]: string };
  [propName: string]: any;
}

export interface ISdkInitOptions {
  isGlobal: boolean;
}