perf: 支持cloudflare域名

This commit is contained in:
xiaojunnuo
2024-06-15 02:17:34 +08:00
parent 368132daae
commit fbb9a47e8f
14 changed files with 206 additions and 106 deletions
@@ -13,8 +13,9 @@ export type CreateRecordOptions = {
value: any;
domain: string;
};
export type RemoveRecordOptions = CreateRecordOptions & {
record: any;
export type RemoveRecordOptions<T> = CreateRecordOptions & {
// 本次创建的dns解析记录,实际上就是createRecord接口的返回值
record: T;
};
export type DnsProviderContext = {
@@ -23,9 +24,9 @@ export type DnsProviderContext = {
http: HttpClient;
};
export interface IDnsProvider {
export interface IDnsProvider<T = any> {
onInstance(): Promise<void>;
createRecord(options: CreateRecordOptions): Promise<any>;
removeRecord(options: RemoveRecordOptions): Promise<any>;
createRecord(options: CreateRecordOptions): Promise<T>;
removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
setCtx(ctx: DnsProviderContext): void;
}