Skip to content

Commit

Permalink
chore: update type
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Nov 6, 2023
1 parent f89d770 commit d7aa034
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/mock/src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import type { HttpRequest } from '@angular/common/http';
import type { Observable } from 'rxjs';

export type MockCallback = any | Observable<any> | Promise<any>;

export class MockOptions {
data?: any;
}
Expand All @@ -17,7 +19,7 @@ export interface MockCachedRule {

segments: string[];

callback(req: MockRequest): any;
callback(req: MockRequest): MockCallback;
}

export interface MockRule {
Expand All @@ -30,7 +32,7 @@ export interface MockRule {
/** 路由参数 */
params?: any;

callback(req: MockRequest): any | Observable<any> | Promise<any>;
callback(req: MockRequest): MockCallback;
}

export interface MockRequest {
Expand Down

0 comments on commit d7aa034

Please sign in to comment.