/* Jovian (c) 2020, License: MIT */ export const runtimeLocation = (new Function('try {return this===global;}catch(e){return false;}'))() ? 'server' : 'client'; // tslint:disable-next-line: callable-types interface Class { new (...args): T; } export const Context = { location: 'all' as 'all' | 'client' | 'server', online: true, onlineUpstream: {} as { [className: string]: { online: boolean; } }, throwErrors: true, trackErrors: true, trackCancels: true, disabled: false, disabledClasses: {} as { [className: string]: Class }, disabledExtensions: {} as { [extName: string]: Class }, defineDisabled: false, target: null as any, current: null as Class, beforeDefCurrent: null as Class, gettingSkeleton: false, gettingSampleInstance: false, getter: { ignoredClasses: {} as { [className: string]: Class } }, setter: { ignoredClasses: {} as { [className: string]: Class } }, change: { ignoredClasses: {} as { [className: string]: Class } }, beforeDefinition: {} as { [className: string]: ((inst: any) => any)[] }, serializeMeta: false, validationError: null as Error, anyPropertyFailed: false, lineageMap: null as (a: any) => {[implementType: string]: Class}, lineageHas: null as (a: any, type: Class) => boolean, cast: null as (a: any, type: Class) => T, defineOnUnlock: false, throwErrorsForCommonValidations: false, beforeSuper: false, };