@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
132 lines (131 loc) • 6.63 kB
TypeScript
export * from "./expose";
import * as Exposes from "./expose";
import * as Models from "internal/fx/models";
import { IExtend, ThemeDefinitionV2, WebComponentBundleManifest } from "./models";
interface IExtendApi {
extendApi: <T>(targetApi: (extend: IExtend) => Promise<T>, callback?: (api: T) => void | Promise<void>) => void;
}
declare module "@omnia/fx-models/Extends" {
interface IOmniaFxApi {
apis: typeof Exposes & IExtendApi;
}
}
declare global {
let omniaApi: IExtend;
}
export interface IWebComponentInstance {
}
export interface IWebComponentRegistrationHandler {
(webComponentManifest: WebComponentBundleManifest): void;
}
export interface IConnectedWebComponent {
setRegistrationHandler: (registrationHandler: IWebComponentRegistrationHandler) => void;
addElementInstanceHandler: (instanceHandler: IWebComponentInstance, htmlElement: HTMLElement) => IWebComponentInstanceContext;
getManifest: () => WebComponentBundleManifest;
}
export interface IWebComponentInstanceContext {
getManifest: () => WebComponentBundleManifest;
}
export declare class WebComponentBootstrapper {
static registerElement: (registrationHandler: IWebComponentRegistrationHandler) => void;
static registerElementInstance(instanceHandler: IWebComponentInstance, htmlElement: HTMLElement | Element): IWebComponentInstanceContext;
}
export declare function extendApi<T>(targetApi: (extend: IExtend) => Promise<T>, callback?: (api: T) => void | Promise<void>): void;
export declare function setCurrentManifest(omniaServiceId: any, resourceId: any): {
extendApi: (api: any, callback: any) => void;
WebComponentBootstrapper: {
registerElement: (registrationHandler: any) => void;
registerElementInstance: (instanceHandler: any, htmlElement: any) => any;
};
ImageProxyService: typeof Exposes.ImageProxyService;
UserTypeStore: typeof Exposes.UserTypeStore;
ReplaceToken: typeof Exposes.ReplaceToken;
OmniaContextProvider: typeof Exposes.OmniaContextProvider;
OmniaContext: typeof Exposes.OmniaContext;
ContextProviderCollection: typeof Exposes.ContextProviderCollection;
Extend: Models.IExtend;
registerApi: typeof Exposes.registerApi;
ManifestResourceLoader: typeof Exposes.ManifestResourceLoader;
Provide<T>(classType: any, constructorArgs?: T): any;
useProvide<TProvide, TConstructor>(provide: TProvide, constructorArgs?: TConstructor): TProvide extends new (...args: any) => infer P ? P : TProvide extends Object ? TProvide : never;
Inject<T_1>(classType: any, constructorArgs?: T_1): any;
useInject<TClass, TConstructor_1>(classType: new (...args: any[]) => TClass, constructorArgs?: TConstructor_1): TClass;
isInjectable(type: any): boolean;
Injectable<T_2>(options: Models.ActivationOptions): any;
Cookies: typeof Exposes.Cookies;
LocalStorage: typeof Exposes.LocalStorage;
ServiceContainer: typeof Exposes.ServiceContainer;
ServiceContainerContext: typeof Exposes.ServiceContainerContext;
Encoder: typeof Exposes.Encoder;
Require: typeof Exposes.Require;
propertyPath: <StartType, TargetType = any>() => <Path extends string>(propertyPathToCheck: Exposes.PropPathCheckTargetType<StartType, Path, TargetType>) => string;
propertyPathValue: <T_3, P_1 extends string>(obj: T_3, path: Exposes.PropPathCheckTargetType<T_3, P_1, Exposes.PropPathType<T_3, P_1>>) => Exposes.PropPathType<T_3, P_1>;
SubscriptionHandler: typeof Exposes.SubscriptionHandler;
MessageBusExposeOnlySubscription: typeof Exposes.MessageBusExposeOnlySubscription;
MessageBusExposeOnlyPublication: typeof Exposes.MessageBusExposeOnlyPublication;
MessageBusTopicMediator: typeof Exposes.MessageBusTopicMediator;
Topics: typeof Exposes.Topics;
useOmniaClient(serviceId?: Models.GuidValue): Exposes.HttpClient;
HttpContextProviderCollection: typeof Exposes.HttpContextProviderCollection;
HttpClient: typeof Exposes.HttpClient;
useRequestAborter: () => {
addRequest: (request: Models.Future<any>) => Models.Future<any>;
abortRequests: () => void;
};
MD5Util: typeof Exposes.MD5Util;
WebUtils: typeof Exposes.WebUtils;
Utils: typeof Exposes.Utils;
ScrollPagingUtils: typeof Exposes.ScrollPagingUtils;
EnterprisePropertyHandler: typeof Exposes.EnterprisePropertyHandler;
MigrationUtils: typeof Exposes.MigrationUtils;
UserAgentUtils: typeof Exposes.UserAgentUtils;
Console: typeof Exposes.Console;
ConsoleUIService: typeof Exposes.ConsoleUIService;
ServiceLocator: typeof Exposes.ServiceLocator;
ServiceManifestProvider: typeof Exposes.ServiceManifestProvider;
NamedPropertyOperationsFactory: typeof Exposes.NamedPropertyOperationsFactory;
IBusinessProfileFactory: typeof Exposes.IBusinessProfileFactory;
OmniaPropertyBagBase: typeof Exposes.OmniaPropertyBagBase;
BusinessProfilePropertyBagFactory: typeof Exposes.BusinessProfilePropertyBagFactory;
BusinessProfilePathPropertyBagFactory: typeof Exposes.BusinessProfilePathPropertyBagFactory;
AppRoutePropertyBagFactory: typeof Exposes.AppRoutePropertyBagFactory;
TenantPropertyBagFactory: typeof Exposes.TenantPropertyBagFactory;
ITenantFactory: typeof Exposes.ITenantFactory;
ErrorBus: typeof Exposes.ErrorBus;
UserPropertyBagFactory: typeof Exposes.UserPropertyBagFactory;
IAppRouteFactory: typeof Exposes.IAppRouteFactory;
TokenService: typeof Exposes.TokenService;
AuthenticationSessionService: typeof Exposes.AuthenticationSessionService;
GraphClient: typeof Exposes.GraphClient;
VueWebComponentSlot: typeof Exposes.VueWebComponentSlot;
Localize(namespace?: string): any;
useLocalize<T_4>(namespace: string): T_4;
vueCustomElement(tag: string, componentDefinition: Exposes.ComponentDefinition | Exposes.ComponentDefinitionFunc, options?: Exposes.VueCustomElementOptions): HTMLElement;
install(Vue: any): void;
DisplayRules: typeof Exposes.DisplayRules;
ApiHelper: typeof Exposes.ApiHelper;
omniaScriptApi: Exposes.IOmniaScriptApi;
};
declare global {
namespace JSX {
interface Element {
[name: string]: any;
}
interface ElementClass {
}
interface IntrinsicElements {
[name: string]: any;
}
}
namespace VueTsxSupport.JSX {
interface Element {
}
interface ElementClass {
}
interface IntrinsicElements {
themeTargetId?: string;
themeDefinitionId?: string;
themeDefinition?: ThemeDefinitionV2;
}
}
}