agljs
Version:
AGL.js is a lightweight framework for integrating web apps with Epic's Active Guidelines platform, using modern JavaScript features. Manage action queuing, event handling, subscriptions, and state within Epic Hyperspace.
31 lines (27 loc) • 951 B
TypeScript
declare global {
type AGLConfig = {
debug?: boolean
timeout?: number
subscribe?: { [key: string]: Record<string, any> }
onError?: AGLEvents['error']
onNavigate?: AGLEvents['navigate']
onReload?: AGLEvents['reload']
onAGLEvent?: AGLEvents['aglEvent']
onSubscribed?: AGLEvents['subscribed']
}
type AGLDetails = {
availableActions: string[]
interfaceVersion: string | null
readOnly: boolean
token: string | null
[key: string]: unknown;
}
type AGLEvents = {
error: (error: { message: string | null, details: string[] }) => void
navigate: (event: { direction: 'Back' | 'Forward' }) => void
reload: (event: { state: string, fromHibernation: boolean }) => void
aglEvent: (event: { name: string, args: any }) => void
subscribed: (results: any) => void
}
}
export { AGLConfig, AGLDetails, AGLEvents }