Skip to content

Commit

Permalink
fix: interface define
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoGathK committed Oct 14, 2022
1 parent 328c3ea commit f740279
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 30 deletions.
8 changes: 0 additions & 8 deletions src/common/interface/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ export interface IClientAdapter<T = any, C = any> {
* @publicApi
*/
create: (config: C) => void | Promise<void>;
/**
* Redeploy the client instance.
*
* @param config C The configuration of client instance
*
* @publicApi
*/
redeploy: (config: C) => void | Promise<void>;
}

export interface IClientMediator<T = any, C = any> extends IConfigSubscriber {
Expand Down
41 changes: 19 additions & 22 deletions src/common/interface/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
interface Observer {
contrast: (...args: any[]) => void;
subscribe: (...args: any[]) => void | Promise<void>;
notify: (...args: any[]) => void;
polling: (...args: any[]) => void | Promise<void>;
unPolling: (...args: any[]) => void | Promise<void>;
unSubscribe: (...args: any[]) => void;
notify: (...args: any[]) => void;
}

export interface IConfig<T = any> {
Expand Down Expand Up @@ -101,6 +98,14 @@ export interface IConfigObserver extends Observer {
*/
subscribe: (key: string, subscriber: IConfigSubscriber) => void;
/**
* Remove the subscriber from client by the key of configuration..
*
* @param key string The key of configuration.
*
* @publicApi
*/
unSubscribe: (key: string) => void;
/**
* Notify subscribers of configuration updates.
*
* @param key string The key of configuration.
Expand All @@ -114,21 +119,13 @@ export interface IConfigObserver extends Observer {
*
* @publicApi
*/
polling: () => void;
polling?: (...args: any[]) => void;
/**
* Close the polling.
*
* @publicApi
*/
unPolling: () => void;
/**
* Remove the subscriber from client by the key of configuration..
*
* @param key string The key of configuration.
*
* @publicApi
*/
unSubscribe: (key: string) => void;
unPolling?: () => void;
}

export interface IConfigClient extends Observer {
Expand All @@ -149,6 +146,12 @@ export interface IConfigClient extends Observer {
*/
subscribe: (subscriber: IConfigClientSubscriber) => void;
/**
* Remove the subscriber from client by the key of configuration..
*
* @publicApi
*/
unSubscribe: () => void;
/**
* Notify subscribers of configuration updates.
*
* @param value any The configuration value.
Expand All @@ -161,17 +164,11 @@ export interface IConfigClient extends Observer {
*
* @publicApi
*/
polling: () => void;
polling?: (...args: any[]) => void;
/**
* Close the polling.
*
* @publicApi
*/
unPolling: () => void;
/**
* Remove the subscriber from client by the key of configuration..
*
* @publicApi
*/
unSubscribe: () => void;
unPolling?: () => void;
}

0 comments on commit f740279

Please sign in to comment.