@omnia/fx-models 8.0.129-dev → 8.0.131-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/internal-do-not-import-from-here/shared/broadcasting/Broadcast.d.ts +37 -0
- package/internal-do-not-import-from-here/shared/broadcasting/InternalTopics.d.ts +23 -0
- package/internal-do-not-import-from-here/shared/broadcasting/index.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/factory/DefineFactory.d.ts +12 -0
- package/internal-do-not-import-from-here/shared/factory/Inject.d.ts +30 -0
- package/internal-do-not-import-from-here/shared/factory/Injectable.d.ts +4 -0
- package/internal-do-not-import-from-here/shared/factory/ServiceContainer.d.ts +45 -0
- package/internal-do-not-import-from-here/shared/factory/index.d.ts +4 -0
- package/internal-do-not-import-from-here/shared/http/Http.d.ts +141 -0
- package/internal-do-not-import-from-here/shared/http/index.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/index.d.ts +12 -0
- package/internal-do-not-import-from-here/shared/messaging/MessageBus.d.ts +48 -0
- package/internal-do-not-import-from-here/shared/messaging/MessageBusMediator.d.ts +30 -0
- package/internal-do-not-import-from-here/shared/messaging/index.d.ts +2 -0
- package/internal-do-not-import-from-here/shared/models/theming/Blueprints.d.ts +25 -5
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +8 -5
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.js +2 -0
- package/internal-do-not-import-from-here/shared/models/theming/index.d.ts +0 -1
- package/internal-do-not-import-from-here/shared/models/theming/index.js +0 -1
- package/internal-do-not-import-from-here/shared/services/ActivityService.d.ts +27 -0
- package/internal-do-not-import-from-here/shared/services/ActivitySubscriptionService.d.ts +15 -0
- package/internal-do-not-import-from-here/shared/services/DefineService.d.ts +9 -0
- package/internal-do-not-import-from-here/shared/services/RealtimeService.d.ts +8 -0
- package/internal-do-not-import-from-here/shared/services/ThemingService.d.ts +8 -0
- package/internal-do-not-import-from-here/shared/services/index.d.ts +5 -0
- package/internal-do-not-import-from-here/shared/shared.manifest.d.ts +1 -0
- package/internal-do-not-import-from-here/shared/utils/index.d.ts +4 -0
- package/internal-do-not-import-from-here/shared/workers/Leader.d.ts +6 -0
- package/internal-do-not-import-from-here/shared/workers/WorkerProxy.d.ts +11 -0
- package/internal-do-not-import-from-here/shared/workers/index.d.ts +2 -0
- package/package.json +1 -1
- package/ux/ThemingApi.d.ts +31 -25
- package/internal-do-not-import-from-here/shared/models/theming/Chrome.d.ts +0 -16
- package/internal-do-not-import-from-here/shared/models/theming/Chrome.js +0 -2
@@ -0,0 +1,37 @@
|
|
1
|
+
import { BroadcastTopic, BroadcastInvokeTopic, Future } from "../models";
|
2
|
+
/**
|
3
|
+
*Broadcast between render, worker thread and windows, tabs
|
4
|
+
* @class MessageBus
|
5
|
+
*/
|
6
|
+
export declare class Broadcast {
|
7
|
+
private static _subscribers;
|
8
|
+
private static _channel;
|
9
|
+
private static _initialized;
|
10
|
+
private static _disableSync;
|
11
|
+
private static _invokeRequests;
|
12
|
+
private static _invokeHandlers;
|
13
|
+
/**
|
14
|
+
* Broadcasts a message on the topic
|
15
|
+
*/
|
16
|
+
static publish<TMessage>(topic: BroadcastTopic<TMessage>, message: TMessage): void;
|
17
|
+
static invoke<TMessage, TReturnValue>(topic: BroadcastInvokeTopic<TMessage, TReturnValue>, data: TMessage): Future<TReturnValue>;
|
18
|
+
static invokeHandler<TMessage, TReturnValue>(topic: BroadcastInvokeTopic<TMessage, TReturnValue>, fn: (message: TMessage, messageId?: string) => Future<TReturnValue>): void;
|
19
|
+
/**
|
20
|
+
* Subscribes to the specified Topic and triggers function when a message is published
|
21
|
+
*/
|
22
|
+
static subscribe<TMessage>(topic: BroadcastTopic<TMessage>, fn: (message: TMessage) => void): void;
|
23
|
+
/**
|
24
|
+
* Unsubscribes from the specified Topic
|
25
|
+
*/
|
26
|
+
static unsubscribe<TMessage>(topic: BroadcastTopic<TMessage>, fn: (message: TMessage) => void): void;
|
27
|
+
/**
|
28
|
+
* Creates a topic if it dosent exists
|
29
|
+
* @param topic
|
30
|
+
* @param settings
|
31
|
+
* @returns true/false created
|
32
|
+
*/
|
33
|
+
private static ensureTopic;
|
34
|
+
private static ensureInitialized;
|
35
|
+
private static onMessage;
|
36
|
+
private static get channel();
|
37
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { BroadcastTopic, RealtimeChannelUpdateMessage, RealtimeSendMessage, RealtimChannelMessage, BroadcastInvokeTopic, GuidValue } from "../models";
|
2
|
+
export declare const realtimeTopics: {
|
3
|
+
getActiveChannels: BroadcastTopic<void>;
|
4
|
+
updateChannels: BroadcastTopic<RealtimeChannelUpdateMessage[]>;
|
5
|
+
sendMessage: BroadcastTopic<RealtimeSendMessage>;
|
6
|
+
getUsersInChannel: BroadcastInvokeTopic<RealtimChannelMessage, number[]>;
|
7
|
+
messageReceived: BroadcastTopic<RealtimeSendMessage>;
|
8
|
+
};
|
9
|
+
export declare const endpointTopics: {
|
10
|
+
getActivityHubUrl: BroadcastTopic<{
|
11
|
+
threadId: GuidValue;
|
12
|
+
}>;
|
13
|
+
activityHubUrlUpdated: BroadcastTopic<{
|
14
|
+
threadId: GuidValue;
|
15
|
+
activityHubUrl: string;
|
16
|
+
tokenRefBase64: string;
|
17
|
+
}>;
|
18
|
+
};
|
19
|
+
export declare const workerTopics: {
|
20
|
+
leaderElected: BroadcastTopic<{
|
21
|
+
workerThreadId: GuidValue;
|
22
|
+
}>;
|
23
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./Broadcast";
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { GuidValue, InstanceLifetimes } from "@omnia/fx-models";
|
2
|
+
import { SubscriptionHandler } from "../messaging";
|
3
|
+
export interface SetupFactoryContext {
|
4
|
+
onDeactivated(fn: () => void): any;
|
5
|
+
subscriptions: SubscriptionHandler;
|
6
|
+
}
|
7
|
+
export declare function defineFactory<InferReturnSetup>(setup: (ctx: SetupFactoryContext, ...args: any) => InferReturnSetup, lifetime: InstanceLifetimes, typeIdentifier?: GuidValue): () => InferReturnSetup;
|
8
|
+
export declare function defineFactory<InferReturnSetup, T1>(setup: (ctx: SetupFactoryContext, param1: T1) => InferReturnSetup, lifetime: InstanceLifetimes, typeIdentifier?: GuidValue): (param1: T1) => InferReturnSetup;
|
9
|
+
export declare function defineFactory<InferReturnSetup, T1, T2>(setup: (ctx: SetupFactoryContext, param1: T1, param2: T2) => InferReturnSetup, lifetime: InstanceLifetimes, typeIdentifier?: string): (param1: T1, param2: T2) => InferReturnSetup;
|
10
|
+
export declare function defineFactory<InferReturnSetup, T1, T2, T3>(setup: (ctx: SetupFactoryContext, param1: T1, param2: T2, param3: T3) => InferReturnSetup, lifetime: InstanceLifetimes, typeIdentifier?: GuidValue): (param1: T1, param2: T2, param3: T3) => InferReturnSetup;
|
11
|
+
export declare function defineFactory<InferReturnSetup, T1, T2, T3, T4>(setup: (ctx: SetupFactoryContext, param1: T1, param2: T2, param3: T3, param4: T4) => InferReturnSetup, lifetime: InstanceLifetimes, typeIdentifier?: GuidValue): (param1: T1, param2: T2, param3: T3, param4: T4) => InferReturnSetup;
|
12
|
+
export declare function defineFactory<InferReturnSetup, T1, T2, T3, T4, T5>(setup: (ctx: SetupFactoryContext, param1: T1, param2: T2, param3: T3, param4: T4, param5: T5) => InferReturnSetup, lifetime: InstanceLifetimes, typeIdentifier?: GuidValue): (param1: T1, param2: T2, param3: T3, param4: T4, param5: T5) => InferReturnSetup;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
type Resolver = <TClass, TConstructor>(type: Class<TClass> | (() => TClass), constructorArgs?: TConstructor) => TClass;
|
2
|
+
export declare function registerInjectResolver(resolver: Resolver): void;
|
3
|
+
/**
|
4
|
+
* Injects an instance of the specifed type. That instance maybe come from higer level relation provide it.
|
5
|
+
*
|
6
|
+
* @param classType - Type to inject
|
7
|
+
* @param constructorArgs - Optional arguments for the constructor, by naming convention an interface should be supplied specifying the expected parameters
|
8
|
+
* the name of the interface should follow <classType>Constructor i.e.
|
9
|
+
* Type: HttpClient, if supporting constructor arguments an interface named: "HttpClientConstructor" should be supplied.
|
10
|
+
*
|
11
|
+
* E.g.:
|
12
|
+
* Inject<HttpClientConstructor>(HttpClient,{someConstructorArg1:"",someConstructorArg2})
|
13
|
+
*/
|
14
|
+
export declare function Inject<T>(classType: any, constructorArgs?: T): any;
|
15
|
+
type Class<T> = {
|
16
|
+
new (...args: any[]): T;
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* Injects an instance of the specifed type. That instance maybe come from higer level relation provide it.
|
20
|
+
*
|
21
|
+
* @param type - Type to inject
|
22
|
+
* @param constructorArgs - Optional arguments for the constructor, by naming convention an interface should be supplied specifying the expected parameters
|
23
|
+
* the name of the interface should follow <classType>Constructor i.e.
|
24
|
+
* Type: HttpClient, if supporting constructor arguments an interface named: "HttpClientConstructor" should be supplied.
|
25
|
+
*
|
26
|
+
* E.g.:
|
27
|
+
* useInject<HttpClientConstructor>(HttpClient,{someConstructorArg1:"",someConstructorArg2})
|
28
|
+
*/
|
29
|
+
export declare function useInject<TClass, TConstructor>(type: Class<TClass> | (() => TClass), constructorArgs?: TConstructor): TClass;
|
30
|
+
export {};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { ActivationOptions } from "../models";
|
2
|
+
export declare function isInjectable(type: any): boolean;
|
3
|
+
export declare function Injectable<T>(options: ActivationOptions): any;
|
4
|
+
export declare function defineInjectable<TFunc extends Function>(targetFunc: TFunc, options: ActivationOptions): TFunc;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { GuidValue } from "../models";
|
2
|
+
type Class<T> = {
|
3
|
+
new (...args: any[]): T;
|
4
|
+
};
|
5
|
+
interface MockInstance {
|
6
|
+
type: any;
|
7
|
+
instance: any;
|
8
|
+
}
|
9
|
+
export declare function registerTypeResolver(resolver: (type: any) => any): void;
|
10
|
+
export declare class InternalServiceContainer {
|
11
|
+
private id;
|
12
|
+
private static creatingFromType;
|
13
|
+
private static singletonInstances;
|
14
|
+
private transientInstances;
|
15
|
+
private destroyedContainer;
|
16
|
+
private scopedInstances;
|
17
|
+
constructor(id: GuidValue);
|
18
|
+
createInstance<TConstructor, TClass>(type: Class<TClass> | (() => TClass), constructorArgs?: TConstructor, forceNewInstanceLifetimeScope?: boolean): TClass;
|
19
|
+
static isCreatingInstanceFromType(type: any): boolean;
|
20
|
+
private getActiveInstance;
|
21
|
+
/** Only used it for Scope lifetime - Use to create a proxy to monitor instance, will auto recreate a instance if disposed */
|
22
|
+
private createInstanceProxy;
|
23
|
+
dispose(destroyContainer?: boolean): void;
|
24
|
+
private disposeInstance;
|
25
|
+
}
|
26
|
+
export declare class ServiceContainer {
|
27
|
+
private static mockInstances;
|
28
|
+
private static registeredOnDisposing;
|
29
|
+
static addMock<T>(type: T, instance: any): void;
|
30
|
+
static getMock<TClass>(type: Class<TClass> | (() => TClass)): MockInstance;
|
31
|
+
/**
|
32
|
+
* @param forceNewInstanceLifetimeScope that used in Provide/Inject pattern in ui layer.
|
33
|
+
*/
|
34
|
+
static createInstance<TConstructor, TClass = any>(type: Class<TClass> | (() => TClass), constructorArgs?: TConstructor, forceNewInstanceLifetimeScope?: boolean): TClass;
|
35
|
+
static disposeScopedAndTransient(): void;
|
36
|
+
static onDisposing(func: (instance: any) => void): void;
|
37
|
+
static getRegisteredOnDisposing(): ((activatedInstance: any) => void)[];
|
38
|
+
}
|
39
|
+
export declare class ServiceContainerContext {
|
40
|
+
private container;
|
41
|
+
constructor();
|
42
|
+
createInstance<TConstructor, TClass = any>(type: Class<TClass> | (() => TClass), constructorArgs?: TConstructor, forceNewInstanceLifetimeScope?: boolean): TClass;
|
43
|
+
dispose(): void;
|
44
|
+
}
|
45
|
+
export {};
|
@@ -0,0 +1,141 @@
|
|
1
|
+
import { HttpConfig, HttpCredentials, HttpResponse, Future, Guid } from "../models";
|
2
|
+
export declare class HttpBuilder {
|
3
|
+
_config?: HttpConfig;
|
4
|
+
constructor(_config?: HttpConfig);
|
5
|
+
/**
|
6
|
+
* The base url for the client e.g. https://api.com
|
7
|
+
*
|
8
|
+
* @param {string} baseUrl
|
9
|
+
* @return {*} {HttpBuilder}
|
10
|
+
* @memberof HttpBuilder
|
11
|
+
*/
|
12
|
+
withBaseUrl(baseUrl: string): HttpBuilder;
|
13
|
+
/**
|
14
|
+
* If headers should be included in the request
|
15
|
+
*
|
16
|
+
* @param {{ [name: string]: string }} headers
|
17
|
+
* @return {*} {HttpBuilder}
|
18
|
+
* @memberof HttpBuilder
|
19
|
+
*/
|
20
|
+
withHeaders(headers: {
|
21
|
+
[name: string]: string;
|
22
|
+
}): HttpBuilder;
|
23
|
+
/**
|
24
|
+
* If credential options should be included in the request, Default is "include" for this method
|
25
|
+
*
|
26
|
+
* @param {HttpCredentials} [credentials]
|
27
|
+
* @return {*} {HttpBuilder}
|
28
|
+
* @memberof HttpBuilder
|
29
|
+
*/
|
30
|
+
withCredentials(credentials?: HttpCredentials): HttpBuilder;
|
31
|
+
/**
|
32
|
+
* Sets up the client defaults to call a json api
|
33
|
+
*
|
34
|
+
* @return {*}
|
35
|
+
* @memberof HttpBuilder
|
36
|
+
*/
|
37
|
+
withJsonApiSupport(): HttpBuilder;
|
38
|
+
withExecuteOnWorker(): this;
|
39
|
+
/**
|
40
|
+
* Sets up the client defaults to call a json api
|
41
|
+
*
|
42
|
+
* @return {*}
|
43
|
+
* @memberof HttpBuilder
|
44
|
+
*/
|
45
|
+
getConfig(): HttpConfig;
|
46
|
+
/**
|
47
|
+
* Creates the Http instance with the configuration options
|
48
|
+
*
|
49
|
+
* @return {*} {Http}
|
50
|
+
* @memberof HttpBuilder
|
51
|
+
*/
|
52
|
+
build(): Http;
|
53
|
+
}
|
54
|
+
export declare class Http {
|
55
|
+
_baseConfig: HttpConfig | Future<HttpConfig> | Promise<HttpConfig>;
|
56
|
+
/**
|
57
|
+
* Create a new instance of Http using the HttpBuilder
|
58
|
+
* @static
|
59
|
+
* @param {(HttpConfig | Future<HttpConfig> | Promise<HttpConfig>)} [config]
|
60
|
+
* @return {*} {Http}
|
61
|
+
* @memberof Http
|
62
|
+
*/
|
63
|
+
static new(config?: HttpConfig): HttpBuilder;
|
64
|
+
/**
|
65
|
+
* Creates a new instance of Http with default configurations for calling Omnia Service Apis
|
66
|
+
*
|
67
|
+
* @static
|
68
|
+
* @return {*}
|
69
|
+
* @memberof Http
|
70
|
+
*/
|
71
|
+
static default(config?: HttpConfig): Http;
|
72
|
+
constructor(config?: HttpConfig | Future<HttpConfig> | Promise<HttpConfig>);
|
73
|
+
/**
|
74
|
+
*Performs a GET request for provided url
|
75
|
+
*
|
76
|
+
* @template TReturnType
|
77
|
+
* @param {string} url
|
78
|
+
* @param {HttpConfig} [config]
|
79
|
+
* @return {*} {Future<HttpResponse<TReturnType>>}
|
80
|
+
* @memberof Http
|
81
|
+
*/
|
82
|
+
get<TReturnType>(url: string, config?: HttpConfig): Future<HttpResponse<TReturnType>>;
|
83
|
+
/**
|
84
|
+
* Performs a DELETE request for provided url
|
85
|
+
*
|
86
|
+
* @template TReturnType
|
87
|
+
* @param {string} url
|
88
|
+
* @param {HttpConfig} [config]
|
89
|
+
* @return {*} {Future<HttpResponse<TReturnType>>}
|
90
|
+
* @memberof Http
|
91
|
+
*/
|
92
|
+
delete<TReturnType>(url: string, config?: HttpConfig): Future<HttpResponse<TReturnType>>;
|
93
|
+
/**
|
94
|
+
* Performs a HEAD request for provided url
|
95
|
+
*
|
96
|
+
* @template TReturnType
|
97
|
+
* @param {string} url
|
98
|
+
* @param {HttpConfig} [config]
|
99
|
+
* @return {*} {Future<HttpResponse<TReturnType>>}
|
100
|
+
* @memberof Http
|
101
|
+
*/
|
102
|
+
head<TReturnType>(url: string, config?: HttpConfig): Future<HttpResponse<TReturnType>>;
|
103
|
+
/**
|
104
|
+
* Performs a HEAD request for provided url
|
105
|
+
*
|
106
|
+
* @template TReturnType
|
107
|
+
* @param {string} url
|
108
|
+
* @param {Object} body
|
109
|
+
* @param {HttpConfig} [config]
|
110
|
+
* @return {*} {Future<HttpResponse<TReturnType>>}
|
111
|
+
* @memberof Http
|
112
|
+
*/
|
113
|
+
post<TReturnType>(url: string, body: Object, config?: HttpConfig): Future<HttpResponse<TReturnType>>;
|
114
|
+
/**
|
115
|
+
* Performs a POST request for provided url
|
116
|
+
*
|
117
|
+
* @template TReturnType
|
118
|
+
* @param {string} url
|
119
|
+
* @param {Object} body
|
120
|
+
* @param {HttpConfig} [config]
|
121
|
+
* @return {*} {Future<HttpResponse<TReturnType>>}
|
122
|
+
* @memberof Http
|
123
|
+
*/
|
124
|
+
put<TReturnType>(url: string, body: Object, config?: HttpConfig): Future<HttpResponse<TReturnType>>;
|
125
|
+
/**
|
126
|
+
* Performs a POST request for provided url
|
127
|
+
*
|
128
|
+
* @template TReturnType
|
129
|
+
* @param {string} url
|
130
|
+
* @param {Object} body
|
131
|
+
* @param {HttpConfig} [config]
|
132
|
+
* @return {*} {Future<HttpResponse<TReturnType>>}
|
133
|
+
* @memberof Http
|
134
|
+
*/
|
135
|
+
patch<TReturnType>(url: string, body: Object, config?: HttpConfig): Future<HttpResponse<TReturnType>>;
|
136
|
+
private createRequest;
|
137
|
+
private buildRequestInit;
|
138
|
+
private appendQueryParamsToUrl;
|
139
|
+
}
|
140
|
+
export declare function http(omniaServiceId: Guid, executeOnWorker?: boolean): Http;
|
141
|
+
export declare function http(options: HttpConfig): Http;
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./Http";
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/**
|
2
|
+
* fx/shared that contain all code to share between worker and browser.
|
3
|
+
* NOTE: it cant have any dependencies to fx core, worker and vendors stuffs
|
4
|
+
* ***/
|
5
|
+
export * from "./models";
|
6
|
+
export * from "./broadcasting";
|
7
|
+
export * from "./workers";
|
8
|
+
export * from "./http";
|
9
|
+
export * from "./services";
|
10
|
+
export * from "./utils";
|
11
|
+
export * from "./factory";
|
12
|
+
export * from "./messaging";
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { Topic, TopicSettings } from "../models";
|
2
|
+
/**
|
3
|
+
* A message bus where messages can be published and subscribed to based on a path
|
4
|
+
* @class MessageBus
|
5
|
+
*/
|
6
|
+
export declare class MessageBus {
|
7
|
+
private static _subscribers;
|
8
|
+
private static _subscriptionConfigs;
|
9
|
+
/**
|
10
|
+
* Publishes a message on the topic
|
11
|
+
*/
|
12
|
+
static publish<T>(topic: Topic<T>, obj: T): void;
|
13
|
+
/**
|
14
|
+
* Clears the message cache for the topic
|
15
|
+
*/
|
16
|
+
static clearCache<T>(topic: Topic<T>): number;
|
17
|
+
/**
|
18
|
+
* Subscribes to the specified Topic and triggers function when a message is published
|
19
|
+
*/
|
20
|
+
static subscribe<T>(topic: Topic<T>, fn: (obj: T) => void): void;
|
21
|
+
/**
|
22
|
+
* Unsubscribes from the specified Topic
|
23
|
+
*/
|
24
|
+
static unsubscribe<T>(topic: Topic<T>, fn: (obj: T) => void): void;
|
25
|
+
/**
|
26
|
+
* Creates a topic that messages can be published to, if topic already exists it will throw exception
|
27
|
+
*/
|
28
|
+
static createTopic<T>(topic: Topic<T>, settings?: TopicSettings): void;
|
29
|
+
/**
|
30
|
+
* Creates a topic if it dosent exists, if it already exists it will ignore and continue without exception
|
31
|
+
* @param topic
|
32
|
+
* @param settings
|
33
|
+
* @returns true/false created
|
34
|
+
*/
|
35
|
+
static ensureTopic<T>(topic: Topic<T>, settings?: TopicSettings): boolean;
|
36
|
+
/**
|
37
|
+
* Returns true if the topic exists already
|
38
|
+
*/
|
39
|
+
static topicExists<T>(topic: Topic<T>): boolean;
|
40
|
+
/**
|
41
|
+
* Builds the full path
|
42
|
+
*/
|
43
|
+
private static buildTopicPath;
|
44
|
+
/**
|
45
|
+
* Ensures the subscribers array on the path
|
46
|
+
*/
|
47
|
+
private static ensureSubscribers;
|
48
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { Topic, TopicSettings, IMessageBusSubscriptionHandler, IMessageBusTopicSubscription, IMessageBusTopicPublishSubscriber, IMessageBusTopicPublication, TopicCreatedFunc } from "../models";
|
2
|
+
export declare class SubscriptionHandler implements IMessageBusSubscriptionHandler {
|
3
|
+
private unSubcribeHandlers;
|
4
|
+
constructor();
|
5
|
+
/**
|
6
|
+
* Unsubscribe to the related subscription(s)
|
7
|
+
* and/or any subscriptions added using add method)
|
8
|
+
* */
|
9
|
+
unsubscribe: () => void;
|
10
|
+
/**
|
11
|
+
* Adds another unsubscribe handler, all will be unsubscribed to if calling unsubscribe
|
12
|
+
* @param unSubscriptionHandler
|
13
|
+
*/
|
14
|
+
add: (unSubscriptionHandler: IMessageBusSubscriptionHandler) => void;
|
15
|
+
}
|
16
|
+
export declare class MessageBusExposeOnlySubscription<T> implements IMessageBusTopicSubscription<T> {
|
17
|
+
subscribe: (fn: (obj: T) => void) => IMessageBusSubscriptionHandler;
|
18
|
+
constructor(publishSubscriber: IMessageBusTopicPublishSubscriber<T>);
|
19
|
+
}
|
20
|
+
export declare class MessageBusExposeOnlyPublication<T> implements IMessageBusTopicPublication<T> {
|
21
|
+
publish: (msg: T) => void;
|
22
|
+
constructor(publishSubscriber: IMessageBusTopicPublishSubscriber<T>);
|
23
|
+
}
|
24
|
+
export declare class MessageBusTopicMediator<T> implements IMessageBusTopicPublishSubscriber<T> {
|
25
|
+
private _topic;
|
26
|
+
constructor(topic: Topic<T>, settings?: TopicSettings, onTopicCreated?: TopicCreatedFunc<T>);
|
27
|
+
publish: (msg: T) => void;
|
28
|
+
subscribe: (fn: (obj: T) => void) => IMessageBusSubscriptionHandler;
|
29
|
+
clearMessageCache: () => number;
|
30
|
+
}
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import { BackgroundDefinition, ColorValue, FillDefinition } from "./ThemeDefinitionV2";
|
2
|
-
import { ChromeBlueprint } from "./Chrome";
|
1
|
+
import { BackgroundDefinition, ColorSchemaType, ColorValue, FillDefinition } from "./ThemeDefinitionV2";
|
3
2
|
import { SpacingDefinition, Spacing } from "./Spacing";
|
4
3
|
import { TypographyValue } from "./Typography";
|
5
4
|
export interface BoxDimensions extends Spacing {
|
6
5
|
}
|
7
6
|
import { TypographyBlueprint } from "./Typography";
|
7
|
+
import { Guid, GuidValue, VelcronAppDefinition } from "@omnia/fx-models";
|
8
8
|
export interface Blueprints {
|
9
|
+
id: Guid;
|
9
10
|
name?: string;
|
10
11
|
}
|
11
12
|
export type BlueprintVariant = "primary" | "secondary" | "variant1" | "variant2" | "variant3";
|
@@ -22,7 +23,19 @@ export interface TypographyBlueprints extends Blueprints {
|
|
22
23
|
export interface SpacingBlueprints extends Blueprints {
|
23
24
|
primary: SpacingBlueprint;
|
24
25
|
}
|
25
|
-
export
|
26
|
+
export interface ChromeBlueprint {
|
27
|
+
name?: string;
|
28
|
+
colorSchemaType?: ColorSchemaType;
|
29
|
+
header: {
|
30
|
+
definitionId: GuidValue;
|
31
|
+
definition?: VelcronAppDefinition;
|
32
|
+
};
|
33
|
+
styles: {
|
34
|
+
background?: BackgroundDefinition;
|
35
|
+
spacing?: Spacing;
|
36
|
+
};
|
37
|
+
}
|
38
|
+
export type ButtonTypes = "primary" | "basic" | "accent1" | "warn" | "link" | "variant1" | "variant2" | "variant3" | "variant4";
|
26
39
|
export interface ComponentBlueprints extends Blueprints {
|
27
40
|
buttons?: {
|
28
41
|
text?: {
|
@@ -30,16 +43,22 @@ export interface ComponentBlueprints extends Blueprints {
|
|
30
43
|
basic?: ButtonBlueprint;
|
31
44
|
accent1?: ButtonBlueprint;
|
32
45
|
warn?: ButtonBlueprint;
|
33
|
-
disabled?: ButtonBlueprint;
|
34
46
|
link?: ButtonBlueprint;
|
47
|
+
variant1?: ButtonBlueprint;
|
48
|
+
variant2?: ButtonBlueprint;
|
49
|
+
variant3?: ButtonBlueprint;
|
50
|
+
variant4?: ButtonBlueprint;
|
35
51
|
};
|
36
52
|
icon?: {
|
37
53
|
primary?: ButtonBlueprint;
|
38
54
|
basic?: ButtonBlueprint;
|
39
55
|
accent1?: ButtonBlueprint;
|
40
56
|
warn?: ButtonBlueprint;
|
41
|
-
disabled?: ButtonBlueprint;
|
42
57
|
link?: ButtonBlueprint;
|
58
|
+
variant1?: ButtonBlueprint;
|
59
|
+
variant2?: ButtonBlueprint;
|
60
|
+
variant3?: ButtonBlueprint;
|
61
|
+
variant4?: ButtonBlueprint;
|
43
62
|
};
|
44
63
|
};
|
45
64
|
tabs?: {
|
@@ -48,6 +67,7 @@ export interface ComponentBlueprints extends Blueprints {
|
|
48
67
|
variant2?: TabsBlueprint;
|
49
68
|
variant3?: TabsBlueprint;
|
50
69
|
};
|
70
|
+
blocks?: ChromeBlueprints;
|
51
71
|
}
|
52
72
|
export interface SpacingBlueprint {
|
53
73
|
layout: SpacingDefinition;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Guid } from "../Guid";
|
2
|
-
import { BoxDimensions
|
2
|
+
import { BoxDimensions } from "./Blueprints";
|
3
3
|
export interface ColorTypeResult<resultType> {
|
4
4
|
base: resultType;
|
5
5
|
baseTone: resultType;
|
@@ -38,15 +38,16 @@ export interface ColorSchemas {
|
|
38
38
|
background: ColorSchema;
|
39
39
|
error: ColorSchema;
|
40
40
|
info: ColorSchema;
|
41
|
+
warning: ColorSchema;
|
42
|
+
notification: ColorSchema;
|
41
43
|
}
|
42
44
|
export interface ThemeDefinitionV2 {
|
43
45
|
id: Guid;
|
44
46
|
name?: string;
|
45
47
|
colors: ColorSchemas;
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
components: ComponentBlueprints;
|
48
|
+
typographyId: Guid;
|
49
|
+
spacingId: Guid;
|
50
|
+
componentId: Guid;
|
50
51
|
}
|
51
52
|
export type ColorSchemaType = keyof typeof ColorSchemaTypes;
|
52
53
|
export declare enum ColorSchemaTypes {
|
@@ -56,6 +57,8 @@ export declare enum ColorSchemaTypes {
|
|
56
57
|
accent2 = "accent2",
|
57
58
|
accent3 = "accent3",
|
58
59
|
neutral = "neutral",
|
60
|
+
warning = "warning",
|
61
|
+
notification = "notification",
|
59
62
|
background = "background",
|
60
63
|
error = "error",
|
61
64
|
info = "info",
|
@@ -9,6 +9,8 @@ var ColorSchemaTypes;
|
|
9
9
|
ColorSchemaTypes["accent2"] = "accent2";
|
10
10
|
ColorSchemaTypes["accent3"] = "accent3";
|
11
11
|
ColorSchemaTypes["neutral"] = "neutral";
|
12
|
+
ColorSchemaTypes["warning"] = "warning";
|
13
|
+
ColorSchemaTypes["notification"] = "notification";
|
12
14
|
ColorSchemaTypes["background"] = "background";
|
13
15
|
ColorSchemaTypes["error"] = "error";
|
14
16
|
ColorSchemaTypes["info"] = "info";
|
@@ -8,5 +8,4 @@ tslib_1.__exportStar(require("./UseThemeMethods"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./Spacing"), exports);
|
9
9
|
tslib_1.__exportStar(require("./SharedBlueprintMethods"), exports);
|
10
10
|
tslib_1.__exportStar(require("./SharedColorMethods"), exports);
|
11
|
-
tslib_1.__exportStar(require("./Chrome"), exports);
|
12
11
|
tslib_1.__exportStar(require("./Blueprints"), exports);
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { FileOwnerId, ChannelId, ActivityFeed, FeedActivityDefinition, SourceRelatedHubProperty, NotificationTeaser, FeedQuery, TemporaryFileId, ActorActivityBase, ActivityCategoryCount, ActorActivityCategory, ActivityRendererLoadingReferences, ActivityRendererLoadReference, ActivityRenderer, HubReaction, HubComment, ExternalActorId, ActivityId, ActorId, Actor } from "../models";
|
2
|
+
export declare const activityService: () => {
|
3
|
+
getFeed: (channelId: ChannelId, options?: FeedQuery) => Promise<ActivityFeed>;
|
4
|
+
createActivity: <TRenderState>(channelId: ChannelId, createdBy: ActorId, activityDefinition: FeedActivityDefinition<TRenderState>, targeting: Array<Array<SourceRelatedHubProperty>>, notification: NotificationTeaser, category?: ActorActivityCategory, expires?: Date, createdAt?: Date, activityIdPlaceHolder?: TemporaryFileId) => Promise<void>;
|
5
|
+
getActors: (actorIds: Array<ActorId>) => Promise<Actor[]>;
|
6
|
+
getActorsByExternalIds: (externalIds: Array<ExternalActorId>) => Promise<{
|
7
|
+
actorId: ActorId;
|
8
|
+
externalId: string;
|
9
|
+
}[]>;
|
10
|
+
dismissNotificationsByActorIds: (channelId: ChannelId, actorIds: Array<ActorId>) => Promise<boolean>;
|
11
|
+
updateActorActivity: (channelId: ChannelId, actorActivity: ActorActivityBase) => Promise<ActivityCategoryCount[]>;
|
12
|
+
tempDelete: (channelId: ChannelId) => Promise<boolean>;
|
13
|
+
tempActorActivitiesDelete: (channelId: ChannelId) => Promise<boolean>;
|
14
|
+
getActivityRenderersLoadReferences: (currentLoadStateHash?: string) => Promise<ActivityRendererLoadingReferences>;
|
15
|
+
getActivityRenderer: (toLoad: ActivityRendererLoadReference) => Promise<ActivityRenderer>;
|
16
|
+
addCommentAsync: (activityId: ActivityId, rendererJson: string, mentions: ExternalActorId[], inReplyToCommentId?: number) => Promise<HubComment>;
|
17
|
+
getCommentsAsync: (activityId: ActivityId, offSet?: HubComment | null, limt?: number) => Promise<HubComment[]>;
|
18
|
+
updateCommentAsync: (activityId: ActivityId, comment: HubComment) => Promise<HubComment>;
|
19
|
+
deleteCommentAsync: (activityId: ActivityId, toDelete: HubComment) => Promise<number[]>;
|
20
|
+
addReactionAsync: (activityId: ActivityId, reactionType: string) => Promise<HubReaction[]>;
|
21
|
+
deleteReactionAsync: (activityId: ActivityId, toDelete: HubReaction) => Promise<HubReaction[]>;
|
22
|
+
getReactionsAsync: (activityId: ActivityId) => Promise<HubReaction[]>;
|
23
|
+
getFiles: (fileOwnerId: FileOwnerId, startPath: string[]) => Promise<string[]>;
|
24
|
+
getTempFiles: (tempFilesId: TemporaryFileId, startPath: string[]) => Promise<string[]>;
|
25
|
+
takeOwnership: (tempFilesId: TemporaryFileId, subPath: string[]) => Promise<void>;
|
26
|
+
upload: (uniqueGuid: TemporaryFileId, files: File[]) => Promise<TemporaryFileId>;
|
27
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { SubscriptionInformation, Subscription, ActorSubscription, ActorId, SubscriptionId } from "../models";
|
2
|
+
export declare const activitySubscriptionService: () => {
|
3
|
+
upsertSubscription: (subscriptionOwner: ActorId, id: SubscriptionId, title: Record<string, string>, description: Record<string, string>) => Promise<SubscriptionInformation>;
|
4
|
+
removeSubscription: (actorSubscription: ActorSubscription) => Promise<SubscriptionInformation>;
|
5
|
+
get: (actorSubscription: ActorSubscription) => Promise<SubscriptionInformation>;
|
6
|
+
getByActorId: (subscriptionOwner: ActorId) => Promise<SubscriptionInformation[]>;
|
7
|
+
getAll: () => Promise<SubscriptionInformation[]>;
|
8
|
+
addActorAsSubscriber: (actorSubscription: ActorSubscription, newSubscriber: ActorId) => Promise<SubscriptionId>;
|
9
|
+
removeActorAsSubscriber: (actorSubscription: ActorSubscription, actorToRemove: ActorId) => Promise<SubscriptionId>;
|
10
|
+
getActorSubscriptions: (actorToGetFor: ActorId) => Promise<SubscriptionInformation[]>;
|
11
|
+
getSubscribers: (subscriptionOwner: ActorId, ownerSubscriptions: SubscriptionId[]) => Promise<Subscription[]>;
|
12
|
+
addFollowingSubscription: (actorToFollow: ActorId) => Promise<void>;
|
13
|
+
isFollowingSubscription: (actorToFollow: ActorId) => Promise<boolean>;
|
14
|
+
removeFollowingSubscription: (actorToFollow: ActorId) => Promise<SubscriptionId>;
|
15
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { SetupFactoryContext } from "../factory";
|
2
|
+
import { http } from "../http";
|
3
|
+
interface SetupServiceContext extends SetupFactoryContext {
|
4
|
+
http: typeof http;
|
5
|
+
}
|
6
|
+
export declare function defineService<TActions extends {
|
7
|
+
[key: string]: Function;
|
8
|
+
}, TArgs extends any[]>(setup: (ctx: SetupServiceContext) => TActions): () => TActions;
|
9
|
+
export {};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Future, RealtimeChannel, RealtimeData } from "../models";
|
2
|
+
export declare const useRealtimeService: () => {
|
3
|
+
activateChannel: (channel: RealtimeChannel) => void;
|
4
|
+
deactivateChannel: (channel: RealtimeChannel) => void;
|
5
|
+
send: <TRealtimeChannel extends RealtimeChannel, TRealtimeData extends RealtimeData<TRealtimeChannel, any>>(data: TRealtimeData, value: TRealtimeData["value"]) => void;
|
6
|
+
getUsersInChannel: (channel: RealtimeChannel) => Future<Array<number>>;
|
7
|
+
onMessage: <TRealtimeChannel_1 extends RealtimeChannel, TRealtimeData_1 extends RealtimeData<TRealtimeChannel_1, any>>(data: TRealtimeData_1, callback: (value: TRealtimeData_1["value"]) => void) => void;
|
8
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ButtonBlueprint, Guid, ITemplateRegistration } from "@omnia/fx-models";
|
2
|
+
export declare const useThemingService: () => {
|
3
|
+
buttonBlueprints: () => {
|
4
|
+
upsert: (blueprint: ITemplateRegistration<ButtonBlueprint>) => Promise<void>;
|
5
|
+
delete: (id: Guid) => Promise<void>;
|
6
|
+
getAll: () => Promise<ITemplateRegistration<ButtonBlueprint>[]>;
|
7
|
+
};
|
8
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { WorkerProxyFunction } from "../models";
|
2
|
+
export declare class WorkerProxy {
|
3
|
+
static _worker: Worker;
|
4
|
+
private static _initialized;
|
5
|
+
private static _handlers;
|
6
|
+
private static _promiseResolvers;
|
7
|
+
static call<TParamType, TReturnType>(topic: WorkerProxyFunction<TParamType, TReturnType>, parameter: TParamType): Promise<TReturnType>;
|
8
|
+
static addFunction<TSendType, TReturnType>(topic: WorkerProxyFunction<TSendType, TReturnType>, handler: (data: TSendType) => TReturnType): void;
|
9
|
+
private static ensureInitialized;
|
10
|
+
private static callHandlerMessage;
|
11
|
+
}
|
package/package.json
CHANGED
package/ux/ThemingApi.d.ts
CHANGED
@@ -1,34 +1,40 @@
|
|
1
|
-
import { BorderStylingDefinition, ButtonBlueprint, ChromeBlueprint, ChromeBlueprints, ColorSchema, ComponentBlueprints, FillDefinition, SpacingBlueprints, SpacingDefinition, TabsBlueprint, ThemeDefinitionV2, TypographyBlueprints } from "@omnia/fx-models";
|
1
|
+
import { BorderStylingDefinition, ButtonBlueprint, ChromeBlueprint, ChromeBlueprints, ColorSchema, ComponentBlueprints, FillDefinition, Guid, SpacingBlueprints, SpacingDefinition, TabsBlueprint, ThemeDefinitionV2, TypographyBlueprints } from "@omnia/fx-models";
|
2
2
|
import { ApiPath } from "../Extends";
|
3
|
+
export interface ITemplateRegistration<TTemplateType = any> {
|
4
|
+
id: Guid;
|
5
|
+
template: TTemplateType;
|
6
|
+
hidden?: boolean;
|
7
|
+
custom?: boolean;
|
8
|
+
}
|
3
9
|
export interface IThemeRegistrationApiHandler {
|
4
|
-
|
5
|
-
registerTheme(definitions: ThemeDefinitionV2 | ThemeDefinitionV2[]): any;
|
6
|
-
registerColorSchema(colorSchema: ColorSchema | ColorSchema[]): any;
|
7
|
-
|
10
|
+
getAllThemeRegistrations(): ITemplateRegistration<ThemeDefinitionV2>[];
|
11
|
+
registerTheme(definitions: ITemplateRegistration<ThemeDefinitionV2> | ITemplateRegistration<ThemeDefinitionV2>[]): any;
|
12
|
+
registerColorSchema(colorSchema: ITemplateRegistration<ColorSchema> | ITemplateRegistration<ColorSchema>[]): any;
|
13
|
+
getAllColorSchemaRegistrations(): any;
|
8
14
|
templates: {
|
9
15
|
get: {
|
10
|
-
spacingDefinition: () => SpacingDefinition[];
|
11
|
-
spacingBlueprints: () => SpacingBlueprints[];
|
12
|
-
fillDefinition: () => FillDefinition[];
|
13
|
-
borderDefinition: () => BorderStylingDefinition[];
|
14
|
-
buttonBlueprint: () => ButtonBlueprint[];
|
15
|
-
tabsBlueprint: () => TabsBlueprint[];
|
16
|
-
chromeBlueprint: () => ChromeBlueprint[];
|
17
|
-
chromeBlueprints: () => ChromeBlueprints[];
|
18
|
-
componentBlueprints: () => ComponentBlueprints[];
|
19
|
-
typographyBlueprints: () => TypographyBlueprints[];
|
16
|
+
spacingDefinition: () => ITemplateRegistration<SpacingDefinition>[];
|
17
|
+
spacingBlueprints: () => ITemplateRegistration<SpacingBlueprints>[];
|
18
|
+
fillDefinition: () => ITemplateRegistration<FillDefinition>[];
|
19
|
+
borderDefinition: () => ITemplateRegistration<BorderStylingDefinition>[];
|
20
|
+
buttonBlueprint: () => ITemplateRegistration<ButtonBlueprint>[];
|
21
|
+
tabsBlueprint: () => ITemplateRegistration<TabsBlueprint>[];
|
22
|
+
chromeBlueprint: () => ITemplateRegistration<ChromeBlueprint>[];
|
23
|
+
chromeBlueprints: () => ITemplateRegistration<ChromeBlueprints>[];
|
24
|
+
componentBlueprints: () => ITemplateRegistration<ComponentBlueprints>[];
|
25
|
+
typographyBlueprints: () => ITemplateRegistration<TypographyBlueprints>[];
|
20
26
|
};
|
21
27
|
add: {
|
22
|
-
spacingDefinition: (spacing: SpacingDefinition | SpacingDefinition[]) => void;
|
23
|
-
spacingBlueprints: (spacing: SpacingBlueprints | SpacingBlueprints[]) => void;
|
24
|
-
fillDefinition: (fill: FillDefinition | FillDefinition[]) => void;
|
25
|
-
borderDefinition: (border: BorderStylingDefinition | BorderStylingDefinition[]) => void;
|
26
|
-
buttonBlueprint: (blueprint: ButtonBlueprint | ButtonBlueprint[]) => void;
|
27
|
-
tabsBlueprint: (blueprint: TabsBlueprint | TabsBlueprint[]) => void;
|
28
|
-
chromeBlueprint: (blueprint: ChromeBlueprint | ChromeBlueprint[]) => void;
|
29
|
-
chromeBlueprints: (blueprint: ChromeBlueprints | ChromeBlueprints[]) => void;
|
30
|
-
componentBlueprints: (blueprint: ComponentBlueprints | ComponentBlueprints[]) => void;
|
31
|
-
typographyBlueprints: (blueprints: TypographyBlueprints | TypographyBlueprints[]) => void;
|
28
|
+
spacingDefinition: (spacing: ITemplateRegistration<SpacingDefinition> | ITemplateRegistration<SpacingDefinition>[]) => void;
|
29
|
+
spacingBlueprints: (spacing: ITemplateRegistration<SpacingBlueprints> | ITemplateRegistration<SpacingBlueprints>[]) => void;
|
30
|
+
fillDefinition: (fill: ITemplateRegistration<FillDefinition> | ITemplateRegistration<FillDefinition>[]) => void;
|
31
|
+
borderDefinition: (border: ITemplateRegistration<BorderStylingDefinition> | ITemplateRegistration<BorderStylingDefinition>[]) => void;
|
32
|
+
buttonBlueprint: (blueprint: ITemplateRegistration<ButtonBlueprint> | ITemplateRegistration<ButtonBlueprint>[]) => void;
|
33
|
+
tabsBlueprint: (blueprint: ITemplateRegistration<TabsBlueprint> | ITemplateRegistration<TabsBlueprint>[]) => void;
|
34
|
+
chromeBlueprint: (blueprint: ITemplateRegistration<ChromeBlueprint> | ITemplateRegistration<ChromeBlueprint>[]) => void;
|
35
|
+
chromeBlueprints: (blueprint: ITemplateRegistration<ChromeBlueprints> | ITemplateRegistration<ChromeBlueprints>[]) => void;
|
36
|
+
componentBlueprints: (blueprint: ITemplateRegistration<ComponentBlueprints> | ITemplateRegistration<ComponentBlueprints>[]) => void;
|
37
|
+
typographyBlueprints: (blueprints: ITemplateRegistration<TypographyBlueprints> | ITemplateRegistration<TypographyBlueprints>[]) => void;
|
32
38
|
};
|
33
39
|
};
|
34
40
|
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { GuidValue } from "../Guid";
|
2
|
-
import { VelcronAppDefinition } from "../velcron";
|
3
|
-
import { Spacing } from "./Spacing";
|
4
|
-
import { BackgroundDefinition, ColorSchemaType } from "./ThemeDefinitionV2";
|
5
|
-
export interface ChromeBlueprint {
|
6
|
-
name?: string;
|
7
|
-
colorSchemaType?: ColorSchemaType;
|
8
|
-
header: {
|
9
|
-
definitionId: GuidValue;
|
10
|
-
definition?: VelcronAppDefinition;
|
11
|
-
};
|
12
|
-
styles: {
|
13
|
-
background?: BackgroundDefinition;
|
14
|
-
spacing?: Spacing;
|
15
|
-
};
|
16
|
-
}
|