@sassoftware/vi-api
Version:
Types used in the SAS Visual Investigator API
76 lines (75 loc) • 2.53 kB
TypeScript
import { PersistableObject } from "../metadata/metadata-api";
export interface ReferenceList extends ReferenceListBase {
maxCodeLength: number;
archived: boolean;
type?: string;
localizedLabels?: LocalizedLabel[];
items: ReferenceListItem[];
alphabeticalSort: boolean;
hierarchyLevel?: number;
referenceListType?: string;
usedByField?: boolean;
}
export interface ReferenceListBase {
id?: string | number;
name: string;
label: string;
referenceListType?: string;
localizedLabels?: LocalizedLabel[];
}
export interface ReferenceListItem {
id?: string | number;
label: string;
code: string;
localizedLabels?: LocalizedLabel[];
archived?: boolean;
displayIndex?: number;
parentCode?: string;
newItem?: boolean;
hasChildren?: boolean;
}
export interface HierarchicalList extends ReferenceListBase {
levels: ReferenceList[];
}
export interface LocalizedLabel extends PersistableObject {
localeCd: string;
label: string;
}
/**
* This API provides functionality related to retrieving reference data.
*
* Accessed from the window at `window.sas.vi.refData`.
*
* @example window.sas.vi.refData.getReferenceLists();
* @category API
*/
export interface RefDataApi {
/**
* @method
* @description Gets all reference data lists.
* @returns Promise containing the array of reference data lists.
*/
getReferenceLists(): Promise<ReferenceList[]>;
/**
* @method
* @description Gets all reference data hierarchies.
* @returns Promise containing the array of reference data hierarchies.
*/
getReferenceHierarchies(): Promise<HierarchicalList[]>;
/**
* @method
* @description Gets reference data list with the given name.
* @param name {string} Name of the reference data list.
* @param [includeArchived] {boolean} Boolean to determine if an archived list can be returned.
* @returns Promise containing the reference data list.
*/
getReferenceList(name: string, includeArchived?: boolean): Promise<ReferenceList>;
/**
* @method
* @description Gets reference data hierarchy with the given name.
* @param name {name} Name of the reference data hierarchy.
* @param [includeArchived] {boolean} Boolean to determine if an archived hierarchy can be returned.
* @returns Promise containing the reference data hierarchy.
*/
getReferenceHierarchy(name: string, includeArchived?: boolean): Promise<HierarchicalList>;
}