@sassoftware/vi-api
Version:
Types used in the SAS Visual Investigator API
79 lines (78 loc) • 1.94 kB
TypeScript
import { Type } from "@angular/core";
import { ActionState } from "../object/object-api";
export declare enum PageModeEvent {
CREATE = "create",
EDIT = "edit",
OPEN = "open",
INSPECT = "inspect",
SUMMARY = "summary"
}
export interface Control<ControlTypeAttributes extends TypeAttributes = TypeAttributes> {
id?: string;
attributes?: ControlAttributes;
typeAttributes: ControlTypeAttributes;
attrs: ControlAttrs;
childNodes?: Control[];
}
export type ToolbarControl<T extends Record<any, any> = {}> = Control<{}> & {
attrs: {
attributes: {
disabled: boolean;
state?: ActionState;
} & T;
};
typeAttributes: never;
};
export interface ControlAttrs {
attributes?: {
disabled: boolean;
state?: ActionState;
};
id: string;
category: string;
type: string;
states?: ControlStates;
}
export interface TypeAttributes {
[property: string]: any;
}
export interface ControlAttributes extends TypeAttributes {
global?: {
state?: GlobalControlStates;
groupRestrictions?: Array<{
id: string;
name: string;
}>;
};
}
export interface ControlStates {
readOnly?: boolean;
required?: boolean;
hidden?: boolean;
}
export interface GlobalControlStates {
conditions?: any[];
readOnly?: boolean;
required?: boolean;
hidden?: boolean;
}
export interface SlidingPanelProperties {
[property: string]: any;
}
/**
* Represents the content of a sliding panel.
*/
export interface SlidingPanelContent<T> {
/**
* The name of a custom element to be created in the content pane.
*/
customElementName?: string;
/**
* An Angular component to be included in the content pane.
*/
instanceClass?: Type<T>;
}
export interface RefreshablePageControlOptions {
refreshCategory?: string;
requiresIndex?: boolean;
}