ng-mocks 14.10.1 → 14.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -312,6 +312,13 @@ export interface IMockBuilder extends Promise<IMockBuilderResult> {
312
312
  */
313
313
  replace(source: AnyType<any>, destination: AnyType<any>, config?: IMockBuilderConfigAll & IMockBuilderConfigModule): this;
314
314
  }
315
+ /**
316
+ * IMockBuilderExtended
317
+ *
318
+ * @see https://ng-mocks.sudo.eu/api/MockBuilder#extending-mockbuilder
319
+ */
320
+ export interface IMockBuilderExtended extends IMockBuilder {
321
+ }
315
322
  export type ngMocksMockConfig = {
316
323
  config?: IMockBuilderConfig;
317
324
  hostBindings?: string[];
@@ -1117,7 +1124,17 @@ export type MockBuilderParam = string | AnyDeclaration<any> | NgModuleWithProvid
1117
1124
  *
1118
1125
  * @see https://ng-mocks.sudo.eu/api/MockBuilder
1119
1126
  */
1120
- export declare function MockBuilder(keepDeclaration?: MockBuilderParam | MockBuilderParam[] | null | undefined, itsModuleToMock?: MockBuilderParam | MockBuilderParam[] | null | undefined): IMockBuilder;
1127
+ export declare function MockBuilder(keepDeclaration?: MockBuilderParam | MockBuilderParam[] | null | undefined, itsModuleToMock?: MockBuilderParam | MockBuilderParam[] | null | undefined): IMockBuilderExtended;
1128
+ export declare namespace MockBuilder {
1129
+ /**
1130
+ * Adds a custom function to MockBuilder
1131
+ */
1132
+ function extend<K extends keyof IMockBuilderExtended & string>(func: K, callback: (builder: IMockBuilderExtended, parameters: never) => void): void;
1133
+ /**
1134
+ * Removes a custom function from MockBuilder
1135
+ */
1136
+ function extend<K extends keyof IMockBuilderExtended & string>(func: K): void;
1137
+ }
1121
1138
  /**
1122
1139
  * MockModule creates a mock module class out of an arbitrary module.
1123
1140
  * All declarations, imports, exports and providers will be mocked too.