-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor type definitions, bringing in other vodyani toolkits t…
…o combine information
- Loading branch information
Showing
4 changed files
with
32 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,40 @@ | ||
import { DeployAsyncClient, DeployClient, Method, PromiseMethod, RemoteSubscribe } from '../type'; | ||
import { DeployAsyncClient, DeployClient, Method, PromiseMethod } from '../type'; | ||
|
||
export interface Client<T = any> { | ||
get: () => T; | ||
close: Method<any>; | ||
getInstance: Method<T>; | ||
close: Method<void>; | ||
} | ||
|
||
export interface AsyncClient<T = any> { | ||
get: () => T; | ||
close: PromiseMethod<any>; | ||
getInstance: Method<T>; | ||
close: PromiseMethod<void>; | ||
} | ||
|
||
export interface ClientAdapter<T = any, O = any> { | ||
getClient: (key: string) => Client<T>; | ||
create: (options: O) => Client<T>; | ||
} | ||
|
||
export interface AsyncClientAdapter<T = any, O = any> { | ||
getClient: (key: string) => AsyncClient<T>; | ||
create: (options: O) => Promise<AsyncClient<T>>; | ||
} | ||
|
||
export interface IClientProxy<T = any, O = any> { | ||
get: () => T; | ||
getClient: () => Client<T>; | ||
|
||
deploy: DeployClient<T, O>; | ||
redeploy: (option: O) => void; | ||
|
||
close: Method<void>; | ||
} | ||
|
||
export interface IAsyncClientProxy<T = any, O = any> { | ||
get: () => T; | ||
getClient: () => AsyncClient<T>; | ||
|
||
deploy: DeployAsyncClient<T, O>; | ||
redeploy: (option: O) => Promise<void>; | ||
|
||
close: PromiseMethod<void>; | ||
} | ||
|
||
export interface ClientAdapter<T = any, O = any> { | ||
connect: (key: string) => T; | ||
create: (options: O) => Client<T>; | ||
} | ||
|
||
export interface AsyncClientAdapter<O = any, T = any> { | ||
connect: (key: string) => T; | ||
create: (options: O) => Promise<AsyncClient<T>>; | ||
} | ||
|
||
export interface DynamicDataSourceOptions { | ||
key: string, | ||
configKey: string, | ||
args?: any[], | ||
} | ||
|
||
export interface RemoteConfigClient { | ||
init: PromiseMethod<any>; | ||
sync?: PromiseMethod<any>; | ||
subscribe?: RemoteSubscribe; | ||
close?: PromiseMethod<any>; | ||
} | ||
|
||
export interface RemoteConfigInfo<O = any, E = any> { | ||
key: string; | ||
options?: O; | ||
extra?: E; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './dynamic-data-source'; | ||
export * from './manager'; | ||
export * from './monitor'; | ||
export * from './remote-config'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ export interface WatchInfo { | |
key: any; | ||
value: any; | ||
callback: Method; | ||
hashToken: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { PromiseMethod, RemoteSubscribe } from '../type'; | ||
|
||
export interface RemoteConfigClient { | ||
init: PromiseMethod<any>; | ||
sync?: PromiseMethod<any>; | ||
subscribe?: RemoteSubscribe; | ||
close?: PromiseMethod<any>; | ||
} | ||
|
||
export interface RemoteConfigInfo<O = any, E = any> { | ||
key: string; | ||
options?: O; | ||
extra?: E; | ||
} |