From 9f65bbf5cec474e5e55c23ff22c2c3bd069df4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=23=E4=BA=91=E6=B7=A1=E7=84=B6?= Date: Sat, 15 Apr 2023 11:46:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=8F=82=E6=95=B0=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/writers/BaseWriter.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/writers/BaseWriter.ts b/src/writers/BaseWriter.ts index 990c96f..1e1f87d 100644 --- a/src/writers/BaseWriter.ts +++ b/src/writers/BaseWriter.ts @@ -1,10 +1,9 @@ -import { TypeAlias, TypeItem } from '../readers/types'; +import { TypeAlias, TypeDocument, TypeItem } from '../readers/types'; import { StrictWriterOptions, WriterOptions } from './types'; import prettier from 'prettier'; export class BaseWriter { static defaults: WriterOptions = { - document: { components: [], paths: [] }, prettier: { singleQuote: true, }, @@ -15,7 +14,7 @@ export class BaseWriter { }; options: StrictWriterOptions; - constructor(options: WriterOptions) { + constructor(readonly document: TypeDocument, options?: WriterOptions) { this.options = Object.assign({}, BaseWriter.defaults, options) as StrictWriterOptions; }