@vue.ts/complex-types
Version:
Resolve complex types in Vue SFCs.
37 lines (36 loc) • 1.25 kB
TypeScript
import MagicString from "magic-string";
import ts from "typescript";
import { FilterPattern } from "@rollup/pluginutils";
//#region ../shared/src/types.d.ts
interface BaseOptions {
include?: FilterPattern;
exclude?: FilterPattern;
}
//#endregion
//#region src/core/printer.d.ts
declare class Printer {
private checker;
constructor(checker: ts.TypeChecker);
private typeToString;
private printUnionOrIntersection;
private containsUndefined;
private printConditionType;
private printPrimitiveType;
private printType;
printPropsTypeArg(node: ts.Node): string;
private printEventsByCallSignatures;
private printEventsByMembers;
printEventsRuntimeArg(node: ts.Node): string;
}
//#endregion
//#region src/core/types.d.ts
type ValidTransforms = "defineEmits" | "defineProps";
type Options = {
tsconfigPath?: string;
} & Partial<Record<ValidTransforms, boolean>> & BaseOptions;
type ResolvedOptions = Required<Options>;
type TransformOptions = Pick<ResolvedOptions, ValidTransforms>;
type Transformer = (printer: Printer, s: MagicString, id: string) => void;
type Transformers = [ValidTransforms, Transformer][];
//#endregion
export { Options, ResolvedOptions, TransformOptions, Transformer, Transformers, ValidTransforms };