@dbs-portal/tool-mock
Version:
API mocking toolkit using MSW for DBS Portal development workflows
43 lines • 1.01 kB
TypeScript
/**
* Utility types
*/
/**
* Delay options
*/
export type DelayOptions = number | [number, number];
/**
* URL matching options
*/
export interface UrlMatchOptions {
/** URL pattern to match */
pattern: string | RegExp;
/** HTTP method to match */
method?: string;
/** Case sensitive matching */
caseSensitive?: boolean;
}
/**
* Error simulation options
*/
export interface ErrorSimulationOptions {
/** Error probability (0-1) */
probability: number;
/** Error type */
type: 'network' | 'server' | 'timeout' | 'custom';
/** Custom error details */
error?: any;
}
/**
* Network simulation options
*/
export interface NetworkSimulationOptions {
/** Connection type */
connection: 'fast' | 'slow' | 'unstable' | 'offline';
/** Packet loss rate (0-1) */
packetLoss?: number;
/** Latency range in ms */
latency?: [number, number];
/** Bandwidth limit in bytes/sec */
bandwidth?: number;
}
//# sourceMappingURL=types.d.ts.map