Skip to content

Commit

Permalink
fix: use types from @asyncapi/parser and interface Options
Browse files Browse the repository at this point in the history
  • Loading branch information
aeworxet committed Aug 17, 2024
1 parent 7afdae8 commit fb0518d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 473 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.6.2",
"description": "Bundle references from an single AsyncAPI document into a single file.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"types": "lib/types.d.ts",
"scripts": {
"build": "tsc",
"test": "jest",
Expand Down
2 changes: 1 addition & 1 deletion src/document.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import yaml from 'js-yaml';

import type { AsyncAPIObject } from './spec-types';
import type { AsyncAPIObject } from './types';

/**
* @class
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import { Document } from './document';

import type { AsyncAPIObject } from './spec-types';
import type { AsyncAPIObject, Options } from './types';

// remember the directory where execution of the program started
const originDir = String(process.cwd());
Expand Down Expand Up @@ -89,7 +89,7 @@ const originDir = String(process.cwd());
*/
export default async function bundle(
files: string[] | string,
options: any = {}
options: Options = {}
) {
let bundledDocument: any = {};
let validationResult: any = [];
Expand Down
4 changes: 2 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import $RefParser from '@apidevtools/json-schema-ref-parser';

import type { ParserOptions as $RefParserOptions } from '@apidevtools/json-schema-ref-parser';
import type { AsyncAPIObject } from 'spec-types';
import type { AsyncAPIObject, Options as BundlerOptions } from './types';

let RefParserOptions: $RefParserOptions;

Expand All @@ -15,7 +15,7 @@ let RefParserOptions: $RefParserOptions;
export async function parse(
JSONSchema: AsyncAPIObject,
specVersion: number,
options: any = {}
options: BundlerOptions = {}
) {
/* eslint-disable indent */
// It is assumed that there will be major Spec versions 4, 5 and on.
Expand Down
Loading

0 comments on commit fb0518d

Please sign in to comment.