Skip to content

Commit

Permalink
chore: add nacos auth supportt typings (#114)
Browse files Browse the repository at this point in the history
* Update index.d.ts

add nacos auth support

* Update interface.ts

add nacos auth support
  • Loading branch information
sun2008mt committed Dec 13, 2023
1 parent cdea9a2 commit 22c0e57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/nacos-config/src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ export interface ClientOptions {
serverAddr?: string; // 用于直连,包含端口
unit?: string; // 内部单元化用
nameServerAddr?: string; // 老的兼容参数,逐步废弃,同 endpoint
username?: string; // 认证的用户名
password?: string; // 认证的密码
cacheDir?: string; // 缓存文件的路径
identityKey?: string; // Identity Key
identityValue?: string; // Identity Value
Expand Down
4 changes: 2 additions & 2 deletions packages/nacos-naming/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface SubscribeInfo {
* Nacos服务发现组件
*/
export class NacosNamingClient {
constructor (config: { logger: typeof console, serverList: string | string[], namespace?: string })
constructor (config: { logger: typeof console, serverList: string | string[], namespace?: string, username?: string, password?: string })

ready: () => Promise<void>;
// Register an instance to service
Expand Down Expand Up @@ -54,4 +54,4 @@ export class NacosNamingClient {
info: SubscribeInfo | string, //service info, if type is string, it's the serviceName
listener: (host: Hosts) => void //the listener function
) => void;
}
}

0 comments on commit 22c0e57

Please sign in to comment.