@orval/mock 8.14.0 → 8.16.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/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
- import * as _$_orval_core0 from "@orval/core";
2
- import { ClientMockGeneratorBuilder, ContextSpec, FakerMockOptions, GenerateMockImports, GeneratorImport, GeneratorOptions, GeneratorSchema, GeneratorVerbOptions, GlobalMockOptions, MswMockOptions } from "@orval/core";
1
+ import { ClientMockGeneratorBuilder, ContextSpec, FakerMockOptions, FinalizeMockImplementationOptions, GenerateMockImports, GeneratorImport, GeneratorOptions, GeneratorSchema, GeneratorVerbOptions, GlobalMockOptions, MswMockOptions } from "@orval/core";
3
2
 
4
3
  //#region src/faker/index.d.ts
5
4
  /**
@@ -18,6 +17,7 @@ declare function generateFaker(generatorVerbOptions: GeneratorVerbOptions, gener
18
17
  interface GenerateFakerForSchemasResult {
19
18
  implementation: string;
20
19
  imports: GeneratorImport[];
20
+ strictMockSchemaTypeNames?: string[];
21
21
  }
22
22
  /**
23
23
  * Builds the contents of a consolidated faker mock file for every entry under
@@ -30,6 +30,17 @@ interface GenerateFakerForSchemasResult {
30
30
  */
31
31
  declare function generateFakerForSchemas(schemas: GeneratorSchema[], context: ContextSpec, options: GlobalMockOptions): GenerateFakerForSchemasResult;
32
32
  //#endregion
33
+ //#region src/mock-types.d.ts
34
+ declare function buildStrictMockTypeFileHeader(schemaTypeNames: Iterable<string>): string;
35
+ /**
36
+ * Prepends shared strict-mock helper types and each `{Schema}Mock` alias once at
37
+ * the top of a mock file. Generators pass `strictSchemaTypeNames`; no scraping.
38
+ *
39
+ * Not idempotent — callers must invoke this exactly once per aggregated mock
40
+ * file (writers and `writeFakerSchemaMocks`), not from import hooks.
41
+ */
42
+ declare function dedupeStrictMockTypeDeclarations(implementation: string, options?: FinalizeMockImplementationOptions): string;
43
+ //#endregion
33
44
  //#region src/msw/index.d.ts
34
45
  declare const generateMSWImports: GenerateMockImports;
35
46
  declare function generateMSW(generatorVerbOptions: GeneratorVerbOptions, generatorOptions: GeneratorOptions): ClientMockGeneratorBuilder;
@@ -55,7 +66,7 @@ declare const generateMockImports: GenerateMockImports;
55
66
  */
56
67
  declare function generateMock(generatorVerbOptions: GeneratorVerbOptions, generatorOptions: Omit<GeneratorOptions, 'mock'> & {
57
68
  mock: GlobalMockOptions;
58
- }): _$_orval_core0.ClientMockGeneratorBuilder;
69
+ }): import("@orval/core").ClientMockGeneratorBuilder;
59
70
  //#endregion
60
- export { DEFAULT_FAKER_OPTIONS, DEFAULT_MSW_OPTIONS, type GenerateFakerForSchemasResult, generateFaker, generateFakerForSchemas, generateFakerImports, generateMSW, generateMSWImports, generateMock, generateMockImports, getDefaultMockOptionsForType };
71
+ export { DEFAULT_FAKER_OPTIONS, DEFAULT_MSW_OPTIONS, type GenerateFakerForSchemasResult, buildStrictMockTypeFileHeader, dedupeStrictMockTypeDeclarations, generateFaker, generateFakerForSchemas, generateFakerImports, generateMSW, generateMSWImports, generateMock, generateMockImports, getDefaultMockOptionsForType };
61
72
  //# sourceMappingURL=index.d.mts.map